Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42c73d93 authored by JW Wang's avatar JW Wang
Browse files

Add tests for snapshot-deletion (4/n)

Tests that CE snapshots for APK are deleted after restoration.

Bug: 151805360
Test: atest StagedRollbackTest
Change-Id: I0e03909b4ac52ea60e399adf5e5a0066d71cb257
parent 1688bf47
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -256,11 +256,19 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {

    @Test
    public void testRollbackDataPolicy() throws Exception {
        List<String> before = getSnapshotDirectories("/data/misc_ce/0/rollback");

        runPhase("testRollbackDataPolicy_Phase1");
        getDevice().reboot();
        runPhase("testRollbackDataPolicy_Phase2");
        getDevice().reboot();
        runPhase("testRollbackDataPolicy_Phase3");

        // Verify snapshots are deleted after restoration
        List<String> after = getSnapshotDirectories("/data/misc_ce/0/rollback");
        // Only check directories newly created during the test
        after.removeAll(before);
        after.forEach(dir -> assertDirectoryIsEmpty(dir));
    }

    /**