diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-08-21 18:10:13 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2017-08-21 18:10:13 +0800 |
commit | b03a949124ef8632846693eae6a3a94d95b7ae0a (patch) | |
tree | 52ce80f26710ae54016ef70585feaba8990d411f /automated/lib | |
parent | a1db05342871210314c905bce5380dac1a0f6a88 (diff) |
android: fix adb root
'adb root' and then 'sleep 10' is a work around for some versions of
adb. In LAVA LXC, with that version adb, 'adb root' doesn't return, but
it actually restarted as root. Without 'sleep 10', 'adb wait-for-device'
and 'adb devices' may still look good, but the following adb commands
will show 'no device found'. Refer to the below job.
https://lkft.validation.linaro.org/scheduler/job/18917#L3372
BTW, we had the 'sleep 10' in the beginning, but it was removed for
some reasons.
Change-Id: I9b40911568993dbcf3795c3d610ccd7cde7277d3
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/lib')
-rwxr-xr-x | automated/lib/android-test-lib | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index 1212077..c253b1a 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -41,7 +41,12 @@ adb_root() { if [ "$(adb shell whoami)" = "root" ]; then echo "DUT already has adbd running as root" else + # 'adb root' and then 'sleep 10' is a work around for some versions of adb. In + # LAVA LXC, with that version adb, 'adb root' doesn't return, but it actually + # restarted as root. Without 'sleep 10', 'adb wait-for-device' and 'adb devices' + # may still look good, but the following adb commands will show 'no device found'. adb root & + sleep 10 adb wait-for-device adb devices fi |