Skip to content

Commit

Permalink
test: add test for A/B/C install
Browse files Browse the repository at this point in the history
Signed-off-by: Enrico Joerns <[email protected]>
  • Loading branch information
ejoerns committed Nov 29, 2024
1 parent 38cb2e4 commit 749709f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,32 @@ def test_install_rauc_external(rauc_dbus_service_with_system_external, tmp_path)
assert os.path.getsize(tmp_path / "images/rootfs-0") > 0


def test_install_abc(rauc_dbus_service_with_system_abc, tmp_path):
assert os.path.exists(tmp_path / "images/rootfs-1")
assert not os.path.getsize(tmp_path / "images/rootfs-1") > 0
assert os.path.exists(tmp_path / "images/rootfs-2")
assert not os.path.getsize(tmp_path / "images/rootfs-2") > 0

# copy to tmp path for safe ownership check
shutil.copyfile("good-verity-bundle.raucb", tmp_path / "good-verity-bundle.raucb")

# First installation should update rootfs-1 (implementation-defined)
out, err, exitcode = run(f"rauc install {tmp_path}/good-verity-bundle.raucb")

assert exitcode == 0
assert os.path.getsize(tmp_path / "images/rootfs-0") == 0
assert os.path.getsize(tmp_path / "images/rootfs-1") > 0
assert os.path.getsize(tmp_path / "images/rootfs-2") == 0

# Second installation should update rootfs-2 (implementation-defined)
out, err, exitcode = run(f"rauc install {tmp_path}/good-verity-bundle.raucb")

assert exitcode == 0
assert os.path.getsize(tmp_path / "images/rootfs-0") == 0
assert os.path.getsize(tmp_path / "images/rootfs-1") > 0
assert os.path.getsize(tmp_path / "images/rootfs-2") > 0


@no_service
def test_install_no_service(tmp_path, create_system_files, system):
assert os.path.exists(tmp_path / "images/rootfs-1")
Expand Down

0 comments on commit 749709f

Please sign in to comment.