diff options
author | Andres Celis <celisa@google.com> | 2017-10-21 00:49:12 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-21 00:49:12 +0000 |
commit | 0fbe826968d41d8d33bcb24de187a097978dea04 (patch) | |
tree | 2097d357d14b2fcad3e73e0daf2fc2b68d5fba0d | |
parent | 4ca76617fa9fecad82ed2d3912c063bef46a2308 (diff) | |
parent | f7f107f8c69a0d2a7dc1677c9d23d1c4b6c9f7a1 (diff) | |
download | cts-0fbe826968d41d8d33bcb24de187a097978dea04.tar.gz |
Merge "Fix for b/68051472" into nyc-dev am: 7d4643347f am: 1fe4b4022c am: 89d9036a9d am: 2d7a3dca17 am: 4188de9079 am: 8e308b2fe0
am: f7f107f8c6
Change-Id: I8886589577cccdde39a4b13fcad96144d19d9b83
-rw-r--r-- | hostsidetests/security/src/android/security/cts/SecurityTestCase.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hostsidetests/security/src/android/security/cts/SecurityTestCase.java b/hostsidetests/security/src/android/security/cts/SecurityTestCase.java index ff41e40e979..e137f57b727 100644 --- a/hostsidetests/security/src/android/security/cts/SecurityTestCase.java +++ b/hostsidetests/security/src/android/security/cts/SecurityTestCase.java @@ -35,8 +35,9 @@ public class SecurityTestCase extends DeviceTestCase { public void setUp() throws Exception { super.setUp(); + String uptime = getDevice().executeShellCommand("cat /proc/uptime"); kernelStartTime = System.currentTimeMillis()/1000 - - Integer.parseInt(getDevice().executeShellCommand("cut -f1 -d. /proc/uptime").trim()); + Integer.parseInt(uptime.substring(0, uptime.indexOf('.'))); //TODO:(badash@): Watch for other things to track. // Specifically time when app framework starts } @@ -82,9 +83,10 @@ public class SecurityTestCase extends DeviceTestCase { @Override public void tearDown() throws Exception { getDevice().waitForDeviceOnline(60 * 1000); + String uptime = getDevice().executeShellCommand("cat /proc/uptime"); assertTrue("Phone has had a hard reset", (System.currentTimeMillis()/1000 - - Integer.parseInt(getDevice().executeShellCommand("cut -f1 -d. /proc/uptime").trim()) + Integer.parseInt(uptime.substring(0, uptime.indexOf('.'))) - kernelStartTime < 2)); //TODO(badash@): add ability to catch runtime restart getDevice().disableAdbRoot(); |