From ca17f6313983ca374249646985fcb34427372f36 Mon Sep 17 00:00:00 2001 From: Vishal Bhoj Date: Wed, 12 Apr 2017 11:33:19 +0530 Subject: Don't run adb root if adbd is already run as root if adbd is already running as root, it will not restart adbd server when we call adb root. This will cause lxc-device-wait-add to be blocked on usb event. Here are problematic jobs: https://staging.validation.linaro.org/scheduler/job/169678#L2308 https://staging.validation.linaro.org/scheduler/job/169679 Change-Id: Iefc65d6241898877b7b26bd8f5826c16e1247f7b Signed-off-by: Vishal Bhoj --- automated/lib/android-test-lib | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'automated') diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index 552dd31..283b244 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -36,11 +36,15 @@ initialize_adb() { } adb_root() { - adb root & - which lava-lxc-device-wait-add && lava-lxc-device-wait-add - which lava-lxc-device-add && lava-lxc-device-add - adb wait-for-device - adb devices + if [ "$(adb shell whoami)" = "root" ]; then + echo "DUT already has adbd running as root" + else + adb root & + which lava-lxc-device-wait-add && lava-lxc-device-wait-add + which lava-lxc-device-add && lava-lxc-device-add + adb wait-for-device + adb devices + fi } wait_boot_completed() { -- cgit v1.2.3