diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2019-11-11 09:10:00 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-11-11 09:10:00 -0800 |
commit | 879655bccc66f82e740cf702a4b8245642df7a73 (patch) | |
tree | afc550373ac35c0b6e20a1df5ecb5f2ec1e2a72b | |
parent | 819d8043bf30b178baeb9c86659f515ffdd92709 (diff) | |
parent | 5d4d3c178fd12f7bd5cd8817d722c125f9d3d340 (diff) | |
download | base-879655bccc66f82e740cf702a4b8245642df7a73.tar.gz |
Merge "Detect NetworkStack path in rollback test"
am: 5d4d3c178f
Change-Id: Ibfdc04ee71c85b3923bb3996b2150fe3637d1553
-rw-r--r-- | tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java index 4315514cb7a5..98e066f541cc 100644 --- a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +++ b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java @@ -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; @@ -97,7 +98,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); @@ -143,7 +144,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); @@ -167,4 +168,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"); + } } |