summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author JW Wang <wangchun@google.com> 2020-03-04 01:46:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-03-04 01:46:02 +0000
commitdac57a3e5375b43aa2a9931de33e56983a31d6ef (patch)
tree0f4631f2a43350d9f3bc1554b98e025a9518b3b1
parent017df7f013f895de2e447e7db70007e789a13964 (diff)
parent757a3bad2ce48da2571a497c1db0aab75f16ba18 (diff)
Merge "Do cleanup before/after running the test" into rvc-dev
-rw-r--r--tests/RollbackTest/MultiUserRollbackTest.xml3
-rw-r--r--tests/RollbackTest/MultiUserRollbackTest/src/com/android/tests/rollback/host/MultiUserRollbackTest.java7
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/RollbackTest/MultiUserRollbackTest.xml b/tests/RollbackTest/MultiUserRollbackTest.xml
index 41cec461c377..ba86c3ff6777 100644
--- a/tests/RollbackTest/MultiUserRollbackTest.xml
+++ b/tests/RollbackTest/MultiUserRollbackTest.xml
@@ -15,9 +15,6 @@
-->
<configuration description="Runs rollback tests for multiple users">
<option name="test-suite-tag" value="MultiUserRollbackTest" />
- <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
- <option name="run-command" value="pm uninstall com.android.cts.install.lib.testapp.A" />
- </target_preparer>
<test class="com.android.tradefed.testtype.HostTest" >
<option name="class" value="com.android.tests.rollback.host.MultiUserRollbackTest" />
</test>
diff --git a/tests/RollbackTest/MultiUserRollbackTest/src/com/android/tests/rollback/host/MultiUserRollbackTest.java b/tests/RollbackTest/MultiUserRollbackTest/src/com/android/tests/rollback/host/MultiUserRollbackTest.java
index e616ac46830f..4c29e72ec713 100644
--- a/tests/RollbackTest/MultiUserRollbackTest/src/com/android/tests/rollback/host/MultiUserRollbackTest.java
+++ b/tests/RollbackTest/MultiUserRollbackTest/src/com/android/tests/rollback/host/MultiUserRollbackTest.java
@@ -40,15 +40,20 @@ public class MultiUserRollbackTest extends BaseHostJUnit4Test {
private static final long SWITCH_USER_COMPLETED_NUMBER_OF_POLLS = 60;
private static final long SWITCH_USER_COMPLETED_POLL_INTERVAL_IN_MILLIS = 1000;
+ private void cleanUp() throws Exception {
+ getDevice().executeShellCommand("pm rollback-app com.android.cts.install.lib.testapp.A");
+ getDevice().executeShellCommand("pm uninstall com.android.cts.install.lib.testapp.A");
+ }
@After
public void tearDown() throws Exception {
- getDevice().executeShellCommand("pm uninstall com.android.cts.install.lib.testapp.A");
+ cleanUp();
removeSecondaryUserIfNecessary();
}
@Before
public void setup() throws Exception {
+ cleanUp();
mOriginalUserId = getDevice().getCurrentUser();
createAndStartSecondaryUser();
// TODO(b/149733368): Remove the '-g' workaround when the bug is fixed.