Merge "Detect NetworkStack path in rollback test"
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.tests.rollback.host;
|
|||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import com.android.ddmlib.Log.LogLevel;
|
import com.android.ddmlib.Log.LogLevel;
|
||||||
|
import com.android.tradefed.device.DeviceNotAvailableException;
|
||||||
import com.android.tradefed.log.LogUtil.CLog;
|
import com.android.tradefed.log.LogUtil.CLog;
|
||||||
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
|
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
|
||||||
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
|
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
|
||||||
@@ -95,7 +96,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
|
|||||||
+ "watchdog_request_timeout_millis 300000");
|
+ "watchdog_request_timeout_millis 300000");
|
||||||
// Simulate re-installation of new NetworkStack with rollbacks enabled
|
// Simulate re-installation of new NetworkStack with rollbacks enabled
|
||||||
getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
|
getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
|
||||||
+ "/system/priv-app/NetworkStack/NetworkStack.apk");
|
+ getNetworkStackPath());
|
||||||
|
|
||||||
// Sleep to allow writes to disk before reboot
|
// Sleep to allow writes to disk before reboot
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
@@ -141,7 +142,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
|
|||||||
+ "watchdog_request_timeout_millis 300000");
|
+ "watchdog_request_timeout_millis 300000");
|
||||||
// Simulate re-installation of new NetworkStack with rollbacks enabled
|
// Simulate re-installation of new NetworkStack with rollbacks enabled
|
||||||
getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
|
getDevice().executeShellCommand("pm install -r --staged --enable-rollback "
|
||||||
+ "/system/priv-app/NetworkStack/NetworkStack.apk");
|
+ getNetworkStackPath());
|
||||||
|
|
||||||
// Sleep to allow writes to disk before reboot
|
// Sleep to allow writes to disk before reboot
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
@@ -165,4 +166,9 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
|
|||||||
// Verify rollback was not executed after health check deadline
|
// Verify rollback was not executed after health check deadline
|
||||||
runPhase("assertNoNetworkStackRollbackCommitted");
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user