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

Commit b9f15217 authored by shafik's avatar shafik Committed by Bill Lin
Browse files

Uninstall testapps before running SecondaryUserRollbackTest

Add target_preparer for uninstalling TestApp.A and TestApp.B before
running SecondaryUserRollbackTest.
Also, fix the tearDown command after each case to uninstall the right
apps.

Test: atest SecondaryUserRollbackTest ; atest SecondaryUserRollbackTest
Bug: 136538996
Change-Id: I35edde58eb8b520f167bace7848956d091155158
Merged-In: I3d5decae03bf9d2f9d78a534399214da05a6d372
parent 1d5db777
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,10 @@
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="RollbackTest.apk" />
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command" value="pm uninstall com.android.cts.install.lib.testapp.A" />
        <option name="run-command" value="pm uninstall com.android.cts.install.lib.testapp.B" />
    </target_preparer>
    <test class="com.android.tradefed.testtype.HostTest" >
        <option name="class" value="com.android.tests.rollback.host.SecondaryUserRollbackTest" />
    </test>
+2 −2
Original line number Diff line number Diff line
@@ -43,8 +43,8 @@ public class SecondaryUserRollbackTest extends BaseHostJUnit4Test {
    @After
    public void tearDown() throws Exception {
        getDevice().switchUser(mOriginalUser);
        getDevice().executeShellCommand("pm uninstall com.android.tests.rollback.testapp.A");
        getDevice().executeShellCommand("pm uninstall com.android.tests.rollback.testapp.B");
        getDevice().executeShellCommand("pm uninstall com.android.cts.install.lib.testapp.A");
        getDevice().executeShellCommand("pm uninstall com.android.cts.install.lib.testapp.B");
        removeSecondaryUserIfNecessary();
    }