aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2018-01-25 20:16:13 +0000
committerNeil Williams <neil.williams@linaro.org>2018-01-25 20:16:13 +0000
commit3cdf4030b4d1646151b59a967d9e06f65e932e79 (patch)
tree8eb582d62ced68bedcc741aabe3950de30952523
parent23cef967e045267d61cf15489e90617b377b0b67 (diff)
add support for lava-test-raise
Change-Id: Ie349cd095055adafcc9f9c2595caefeb08ff5a4e
-rwxr-xr-xscripts/make-adb-connection.sh30
1 files 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
+