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

Commit 5d4d3c17 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Gerrit Code Review
Browse files

Merge "Detect NetworkStack path in rollback test"

parents 552bd08f 1ebd5c44
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.tests.rollback.host;
import static org.junit.Assert.assertTrue;

import com.android.ddmlib.Log.LogLevel;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.log.LogUtil.CLog;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
@@ -95,7 +96,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
                + "watchdog_request_timeout_millis 300000");
        // Simulate re-installation of new NetworkStack with rollbacks enabled
        getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
                + "/system/priv-app/NetworkStack/NetworkStack.apk");
                + getNetworkStackPath());

        // Sleep to allow writes to disk before reboot
        Thread.sleep(5000);
@@ -141,7 +142,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
                + "watchdog_request_timeout_millis 300000");
        // Simulate re-installation of new NetworkStack with rollbacks enabled
        getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
                + "/system/priv-app/NetworkStack/NetworkStack.apk");
                + getNetworkStackPath());

        // Sleep to allow writes to disk before reboot
        Thread.sleep(5000);
@@ -165,4 +166,9 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
        // Verify rollback was not executed after health check deadline
        runPhase("assertNoNetworkStackRollbackCommitted");
    }

    private String getNetworkStackPath() throws DeviceNotAvailableException {
        // Find the NetworkStack path (can be NetworkStack.apk or NetworkStackNext.apk)
        return getDevice().executeShellCommand("ls /system/priv-app/NetworkStack*/*.apk");
    }
}