summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2017-04-12 11:33:19 +0530
committerVishal Bhoj <vishal.bhoj@linaro.org>2017-04-12 12:19:45 +0530
commitca17f6313983ca374249646985fcb34427372f36 (patch)
tree41d80334c5ea2b950c97ef4f1d1fe3dee6c157ea /automated
parenta6c4f8865c27b8eaf41e631e30bdb334142bf863 (diff)
downloadtest-definitions-pipe-ca17f6313983ca374249646985fcb34427372f36.tar.gz
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 <vishal.bhoj@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/lib/android-test-lib14
1 files changed, 9 insertions, 5 deletions
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() {