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

Commit f23d9637 authored by JW Wang's avatar JW Wang Committed by Automerger Merge Worker
Browse files

Merge "Skip the test if no mainline modules installed" into rvc-dev am: a167a477

Change-Id: I94a332bfe95698745c0ea2315c7c4224a0f6d1d9
parents df5e84b1 a167a477
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -477,4 +477,12 @@ public class StagedRollbackTest {
        StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
        assertThat(sm.isCheckpointSupported()).isTrue();
    }

    @Test
    public void hasMainlineModule() throws Exception {
        String pkgName = getModuleMetadataPackageName();
        boolean existed =  InstrumentationRegistry.getInstrumentation().getContext()
                .getPackageManager().getModuleInfo(pkgName, 0) != null;
        assertThat(existed).isTrue();
    }
}
+13 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
     */
    @Test
    public void testRollbackWhitelistedApp() throws Exception {
        assumeTrue(hasMainlineModule());
        runPhase("testRollbackWhitelistedApp_Phase1");
        getDevice().reboot();
        runPhase("testRollbackWhitelistedApp_Phase2");
@@ -460,4 +461,16 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
            return false;
        }
    }

    /**
     * True if this build has mainline modules installed.
     */
    private boolean hasMainlineModule() throws Exception {
        try {
            runPhase("hasMainlineModule");
            return true;
        } catch (AssertionError ignore) {
            return false;
        }
    }
}