Merge "Detect NetworkStack path in rollback test"

This commit is contained in:
Remi NGUYEN VAN
2019-11-11 13:59:41 +00:00
committed by Gerrit Code Review

View File

@@ -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");
}
}