From 3cdf4030b4d1646151b59a967d9e06f65e932e79 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 25 Jan 2018 20:16:13 +0000 Subject: add support for lava-test-raise Change-Id: Ie349cd095055adafcc9f9c2595caefeb08ff5a4e --- scripts/make-adb-connection.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/make-adb-connection.sh b/scripts/make-adb-connection.sh index aa57fc3..3cace21 100755 --- a/scripts/make-adb-connection.sh +++ b/scripts/make-adb-connection.sh @@ -3,26 +3,32 @@ set -e set -x -LAVA=`which lava-test-case || true` +LAVA='echo # ' +if [ -n `which lava-test-case || true` ]; then + LAVA='lava-test-case' +fi + +LAVA_RAISE='echo # ' +if [ -n `which lava-test-raise || true` ]; then + LAVA_RAISE='lava-test-raise' +fi # Only intended for devices using ADB over USB which adb -echo + # start adb and stop the daemon start message from appearing in $result adb get-serialno || true # start daemon if not yet running. result=`adb get-serialno 2>&1 | tail -n1` if [ "$result" = "unknown" ]; then echo "ERROR: adb get-serialno returned" $result - if [ -n "$LAVA" ]; then - lava-test-case adb-serialno --result fail - fi + ${LAVA_RAISE} "Failed to get serial number with adb" exit 1 -else - if [ -n "$LAVA" ]; then - lava-test-case adb-serialno --result pass - echo $result > adb-connection.txt - fi - echo "adb get-serialno returned" $result - echo $result > adb-connection.txt +elif [ "$result" = "error: no devices/emulators found" ]; then + ${LAVA_RAISE} $result + exit 2 fi + +${LAVA} adb-serialno --result pass +echo $result > adb-connection.txt + -- cgit v1.2.3