Merge "Skip the test if no mainline modules installed" into rvc-dev
This commit is contained in:
@@ -477,4 +477,12 @@ public class StagedRollbackTest {
|
|||||||
StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
|
StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
|
||||||
assertThat(sm.isCheckpointSupported()).isTrue();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testRollbackWhitelistedApp() throws Exception {
|
public void testRollbackWhitelistedApp() throws Exception {
|
||||||
|
assumeTrue(hasMainlineModule());
|
||||||
runPhase("testRollbackWhitelistedApp_Phase1");
|
runPhase("testRollbackWhitelistedApp_Phase1");
|
||||||
getDevice().reboot();
|
getDevice().reboot();
|
||||||
runPhase("testRollbackWhitelistedApp_Phase2");
|
runPhase("testRollbackWhitelistedApp_Phase2");
|
||||||
@@ -460,4 +461,16 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
|
|||||||
return false;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user