Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddfa78c7 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Do cleanup before/after running the test" into rvc-dev am: dac57a3e...

Merge "Do cleanup before/after running the test" into rvc-dev am: dac57a3e am: ceb0486b am: 797c787b

Change-Id: Ib8e7705ca594eea1ba902e432200dba89a875c0e
parents 1785d8ce 797c787b
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -15,9 +15,6 @@
-->
-->
<configuration description="Runs rollback tests for multiple users">
<configuration description="Runs rollback tests for multiple users">
    <option name="test-suite-tag" value="MultiUserRollbackTest" />
    <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" >
    <test class="com.android.tradefed.testtype.HostTest" >
        <option name="class" value="com.android.tests.rollback.host.MultiUserRollbackTest" />
        <option name="class" value="com.android.tests.rollback.host.MultiUserRollbackTest" />
    </test>
    </test>
+6 −1
Original line number Original line Diff line number Diff line
@@ -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_NUMBER_OF_POLLS = 60;
    private static final long SWITCH_USER_COMPLETED_POLL_INTERVAL_IN_MILLIS = 1000;
    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
    @After
    public void tearDown() throws Exception {
    public void tearDown() throws Exception {
        getDevice().executeShellCommand("pm uninstall com.android.cts.install.lib.testapp.A");
        cleanUp();
        removeSecondaryUserIfNecessary();
        removeSecondaryUserIfNecessary();
    }
    }


    @Before
    @Before
    public void setup() throws Exception {
    public void setup() throws Exception {
        cleanUp();
        mOriginalUserId = getDevice().getCurrentUser();
        mOriginalUserId = getDevice().getCurrentUser();
        createAndStartSecondaryUser();
        createAndStartSecondaryUser();
        // TODO(b/149733368): Remove the '-g' workaround when the bug is fixed.
        // TODO(b/149733368): Remove the '-g' workaround when the bug is fixed.