Loading tests/RollbackTest/Android.bp +7 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,12 @@ java_test_host { name: "StagedRollbackTest", srcs: ["StagedRollbackTest/src/**/*.java"], libs: ["tradefed"], static_libs: ["testng", "compatibility-tradefed", "RollbackTestLib"], static_libs: [ "compatibility-tradefed", "frameworks-base-hostutils", "RollbackTestLib", "testng", ], test_suites: ["general-tests"], test_config: "StagedRollbackTest.xml", data: [":com.android.apex.apkrollback.test_v1"], Loading @@ -39,7 +44,7 @@ java_test_host { name: "NetworkStagedRollbackTest", srcs: ["NetworkStagedRollbackTest/src/**/*.java"], libs: ["tradefed"], static_libs: ["RollbackTestLib"], static_libs: ["RollbackTestLib", "frameworks-base-hostutils"], test_suites: ["general-tests"], test_config: "NetworkStagedRollbackTest.xml", } Loading tests/StagedInstallTest/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ java_test_host { name: "StagedInstallInternalTest", srcs: ["src/**/*.java"], libs: ["tradefed"], static_libs: ["testng", "compatibility-tradefed"], static_libs: ["testng", "compatibility-tradefed", "frameworks-base-hostutils"], test_suites: ["general-tests"], test_config: "StagedInstallInternalTest.xml", } Loading tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java +8 −11 Original line number Diff line number Diff line Loading @@ -21,12 +21,14 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertTrue; import com.android.ddmlib.Log; import com.android.tests.rollback.host.AbandonSessionsRule; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; import com.android.tradefed.util.ProcessInfo; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -35,7 +37,9 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { private static final String TAG = StagedInstallInternalTest.class.getSimpleName(); private static final long SYSTEM_SERVER_TIMEOUT_MS = 60 * 1000; private boolean mWasRoot = false; @Rule public AbandonSessionsRule mHostTestRule = new AbandonSessionsRule(this); /** * Runs the given phase of a test by calling into the device. Loading @@ -62,21 +66,11 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { @Before public void setUp() throws Exception { mWasRoot = getDevice().isAdbRoot(); if (!mWasRoot) { getDevice().enableAdbRoot(); } cleanUp(); // Abandon all staged sessions getDevice().executeShellCommand("pm install-abandon $(pm get-stagedsessions --only-ready " + "--only-parent --only-sessionid)"); } @After public void tearDown() throws Exception { if (!mWasRoot) { getDevice().disableAdbRoot(); } cleanUp(); } Loading @@ -90,7 +84,10 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { private void restartSystemServer() throws Exception { // Restart the system server long oldStartTime = getDevice().getProcessByName("system_server").getStartTime(); getDevice().enableAdbRoot(); // Need root to restart system server assertThat(getDevice().executeShellCommand("am restart")).contains("Restart the system"); getDevice().disableAdbRoot(); // Wait for new system server process to start long start = System.currentTimeMillis(); Loading tests/RollbackTest/lib/src/com/android/tests/rollback/host/AbandonSessionsRule.java→tests/utils/hostutils/src/com/android/tests/rollback/host/AbandonSessionsRule.java +0 −0 File moved. View file Loading
tests/RollbackTest/Android.bp +7 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,12 @@ java_test_host { name: "StagedRollbackTest", srcs: ["StagedRollbackTest/src/**/*.java"], libs: ["tradefed"], static_libs: ["testng", "compatibility-tradefed", "RollbackTestLib"], static_libs: [ "compatibility-tradefed", "frameworks-base-hostutils", "RollbackTestLib", "testng", ], test_suites: ["general-tests"], test_config: "StagedRollbackTest.xml", data: [":com.android.apex.apkrollback.test_v1"], Loading @@ -39,7 +44,7 @@ java_test_host { name: "NetworkStagedRollbackTest", srcs: ["NetworkStagedRollbackTest/src/**/*.java"], libs: ["tradefed"], static_libs: ["RollbackTestLib"], static_libs: ["RollbackTestLib", "frameworks-base-hostutils"], test_suites: ["general-tests"], test_config: "NetworkStagedRollbackTest.xml", } Loading
tests/StagedInstallTest/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ java_test_host { name: "StagedInstallInternalTest", srcs: ["src/**/*.java"], libs: ["tradefed"], static_libs: ["testng", "compatibility-tradefed"], static_libs: ["testng", "compatibility-tradefed", "frameworks-base-hostutils"], test_suites: ["general-tests"], test_config: "StagedInstallInternalTest.xml", } Loading
tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java +8 −11 Original line number Diff line number Diff line Loading @@ -21,12 +21,14 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertTrue; import com.android.ddmlib.Log; import com.android.tests.rollback.host.AbandonSessionsRule; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; import com.android.tradefed.util.ProcessInfo; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -35,7 +37,9 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { private static final String TAG = StagedInstallInternalTest.class.getSimpleName(); private static final long SYSTEM_SERVER_TIMEOUT_MS = 60 * 1000; private boolean mWasRoot = false; @Rule public AbandonSessionsRule mHostTestRule = new AbandonSessionsRule(this); /** * Runs the given phase of a test by calling into the device. Loading @@ -62,21 +66,11 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { @Before public void setUp() throws Exception { mWasRoot = getDevice().isAdbRoot(); if (!mWasRoot) { getDevice().enableAdbRoot(); } cleanUp(); // Abandon all staged sessions getDevice().executeShellCommand("pm install-abandon $(pm get-stagedsessions --only-ready " + "--only-parent --only-sessionid)"); } @After public void tearDown() throws Exception { if (!mWasRoot) { getDevice().disableAdbRoot(); } cleanUp(); } Loading @@ -90,7 +84,10 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test { private void restartSystemServer() throws Exception { // Restart the system server long oldStartTime = getDevice().getProcessByName("system_server").getStartTime(); getDevice().enableAdbRoot(); // Need root to restart system server assertThat(getDevice().executeShellCommand("am restart")).contains("Restart the system"); getDevice().disableAdbRoot(); // Wait for new system server process to start long start = System.currentTimeMillis(); Loading
tests/RollbackTest/lib/src/com/android/tests/rollback/host/AbandonSessionsRule.java→tests/utils/hostutils/src/com/android/tests/rollback/host/AbandonSessionsRule.java +0 −0 File moved. View file