summaryrefslogtreecommitdiff
path: root/tests/BackgroundDexOptServiceIntegrationTests
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2018-08-31 15:47:01 -0700
committerAndreas Gampe <agampe@google.com>2018-08-31 18:05:18 -0700
commitfa8b57d4f50c1673947d0d9cf2c490e96d6e877a (patch)
tree08d11b0c57785704fdb0775e8b4578fa2a9d9ba9 /tests/BackgroundDexOptServiceIntegrationTests
parentf5121c964b5cc7ca4c71313b7a25abdd81377e36 (diff)
Framework: Allow root to send bg-dexopt
To allow testing, and work on rooted userdebug devices, allow the root user to issue package bg-dexopt commands. Bug: 111798412 Test: atest BackgroundDexOptServiceIntegrationTests Change-Id: I5f52b8322ba386c797a9176a1b216cc547c66456
Diffstat (limited to 'tests/BackgroundDexOptServiceIntegrationTests')
-rw-r--r--tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java b/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java
index e509d2d87bf7..fd20f4a1fa77 100644
--- a/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java
+++ b/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java
@@ -154,6 +154,8 @@ public final class BackgroundDexOptServiceIntegrationTests {
stdout.append(new String(buf, 0, bytesRead));
}
fis.close();
+ Log.i(TAG, "stdout");
+ Log.i(TAG, stdout.toString());
return stdout.toString();
}
@@ -202,7 +204,10 @@ public final class BackgroundDexOptServiceIntegrationTests {
// TODO(aeubanks): figure out how to get scheduled bg-dexopt to run
private static void runBackgroundDexOpt() throws IOException {
- runShellCommand("cmd package bg-dexopt-job " + PACKAGE_NAME);
+ String result = runShellCommand("cmd package bg-dexopt-job " + PACKAGE_NAME);
+ if (!result.trim().equals("Success")) {
+ throw new IllegalStateException("Expected command success, received >" + result + "<");
+ }
}
// Set the time ahead of the last use time of the test app in days.