Loading tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java +3 −6 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ import static com.android.cts.rollback.lib.RollbackUtils.getUniqueRollbackInfoFo import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; import android.Manifest; import android.annotation.Nullable; import android.content.ComponentName; Loading Loading @@ -155,10 +153,9 @@ public class StagedRollbackTest { RollbackUtils.sendCrashBroadcast(TestApp.A, 1); // We expect the device to be rebooted automatically. Wait for that to happen. Thread.sleep(30 * 1000); // Raise an error anyway if reboot didn't happen. fail("watchdog did not trigger reboot"); // This device method will fail and the host will catch the assertion. // If reboot doesn't happen, the host will fail the assertion. Thread.sleep(TimeUnit.SECONDS.toMillis(120)); } /** Loading tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +1 −12 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.tests.rollback.host; import static org.junit.Assert.assertTrue; import static org.testng.Assert.assertThrows; import com.android.ddmlib.Log.LogLevel; import com.android.tradefed.log.LogUtil.CLog; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; Loading Loading @@ -57,17 +55,8 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { runPhase("testBadApkOnly_Phase1"); getDevice().reboot(); runPhase("testBadApkOnly_Phase2"); try { // This is expected to fail due to the device being rebooted out // from underneath the test. If this fails for reasons other than // the device reboot, those failures should result in failure of // the testApkOnlyConfirmRollback phase. CLog.logAndDisplay(LogLevel.INFO, "testBadApkOnlyTriggerRollback is expected to fail"); runPhase("testBadApkOnly_Phase3"); } catch (AssertionError e) { // AssertionError is expected. } assertThrows(AssertionError.class, () -> runPhase("testBadApkOnly_Phase3")); getDevice().waitForDeviceAvailable(); runPhase("testBadApkOnly_Phase4"); Loading Loading
tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java +3 −6 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ import static com.android.cts.rollback.lib.RollbackUtils.getUniqueRollbackInfoFo import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; import android.Manifest; import android.annotation.Nullable; import android.content.ComponentName; Loading Loading @@ -155,10 +153,9 @@ public class StagedRollbackTest { RollbackUtils.sendCrashBroadcast(TestApp.A, 1); // We expect the device to be rebooted automatically. Wait for that to happen. Thread.sleep(30 * 1000); // Raise an error anyway if reboot didn't happen. fail("watchdog did not trigger reboot"); // This device method will fail and the host will catch the assertion. // If reboot doesn't happen, the host will fail the assertion. Thread.sleep(TimeUnit.SECONDS.toMillis(120)); } /** Loading
tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +1 −12 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.tests.rollback.host; import static org.junit.Assert.assertTrue; import static org.testng.Assert.assertThrows; import com.android.ddmlib.Log.LogLevel; import com.android.tradefed.log.LogUtil.CLog; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; Loading Loading @@ -57,17 +55,8 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { runPhase("testBadApkOnly_Phase1"); getDevice().reboot(); runPhase("testBadApkOnly_Phase2"); try { // This is expected to fail due to the device being rebooted out // from underneath the test. If this fails for reasons other than // the device reboot, those failures should result in failure of // the testApkOnlyConfirmRollback phase. CLog.logAndDisplay(LogLevel.INFO, "testBadApkOnlyTriggerRollback is expected to fail"); runPhase("testBadApkOnly_Phase3"); } catch (AssertionError e) { // AssertionError is expected. } assertThrows(AssertionError.class, () -> runPhase("testBadApkOnly_Phase3")); getDevice().waitForDeviceAvailable(); runPhase("testBadApkOnly_Phase4"); Loading