diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2017-12-05 17:46:23 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@linaro.org> | 2017-12-05 17:46:23 +0530 |
commit | 0729429901be04ba1d62377b97771c10744ce351 (patch) | |
tree | 9dd1d4705bbcf061b17f7dbf0126eb7e909eaed7 | |
parent | 794c9eeeb0e51ded2a864ece89c74942df027d33 (diff) |
android: stop the lava job if device is not present
Change-Id: Ia2e69c4e480c8e461792022e55568c387a350fab
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rwxr-xr-x | automated/lib/android-test-lib | 2 | ||||
-rwxr-xr-x | automated/lib/sh-test-lib | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index 633dd45..a904411 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -33,7 +33,7 @@ initialize_adb() { set -x adb_debug_info adb start-server - timeout 600 adb wait-for-device || error_msg "Device NOT found!" + timeout 600 adb wait-for-device || error_fatal "Device NOT found!" adb devices if [ -z "${ANDROID_SERIAL}" ]; then diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib index ed0d96e..a948e7a 100755 --- a/automated/lib/sh-test-lib +++ b/automated/lib/sh-test-lib @@ -3,6 +3,17 @@ LANG=C export LANG +error_fatal() { + msg="$1" + [ -z "${msg}" ] && msg="Unknown error" + if which lava-test-raise;then + lava-test-raise msg + else + printf "FATAL ERROR: %s\n" "${msg}" >&2 + fi + exit 1 +} + error_msg() { msg="$1" [ -z "${msg}" ] && msg="Unknown error" |