Merge "Code cleanup: StagedRollbackTest (5/n)"

This commit is contained in:
TreeHugger Robot
2019-10-21 14:08:54 +00:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 3 deletions

View File

@@ -292,6 +292,21 @@ public class StagedRollbackTest {
Uninstall.packages(TestApp.A);
}
@Test
public void testNetworkPassedDoesNotRollback_Phase1() throws Exception {
resetNetworkStack();
}
@Test
public void testNetworkPassedDoesNotRollback_Phase2() throws Exception {
assertNetworkStackRollbackAvailable();
}
@Test
public void testNetworkPassedDoesNotRollback_Phase3() throws Exception {
assertNoNetworkStackRollbackCommitted();
}
@Nullable
private static String getModuleMetadataPackageName() {
String packageName = InstrumentationRegistry.getContext().getResources().getString(

View File

@@ -166,7 +166,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
@Test
public void testNetworkPassedDoesNotRollback() throws Exception {
// Remove available rollbacks and uninstall NetworkStack on /data/
runPhase("resetNetworkStack");
runPhase("testNetworkPassedDoesNotRollback_Phase1");
// Reduce health check deadline, here unlike the network failed case, we use
// a longer deadline because joining a network can take a much longer time for
// reasons external to the device than 'not joining'
@@ -183,7 +183,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
getDevice().waitForDeviceAvailable();
// Verify rollback was enabled
runPhase("assertNetworkStackRollbackAvailable");
runPhase("testNetworkPassedDoesNotRollback_Phase2");
// Connect to internet so network health check passes
getDevice().executeShellCommand("svc wifi enable");
@@ -196,7 +196,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
// Sleep for > health check deadline
Thread.sleep(310000);
// Verify rollback was not executed after health check deadline
runPhase("assertNoNetworkStackRollbackCommitted");
runPhase("testNetworkPassedDoesNotRollback_Phase3");
}
/**