diff --git a/test/test_install.py b/test/test_install.py index 65cc4d0d4..86e289859 100644 --- a/test/test_install.py +++ b/test/test_install.py @@ -178,6 +178,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")