From b03a949124ef8632846693eae6a3a94d95b7ae0a Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Mon, 21 Aug 2017 18:10:13 +0800 Subject: 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 --- automated/lib/android-test-lib | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'automated/lib') 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 -- cgit v1.2.3