jjb/common: lava-labs-prepare: catching errors 09/11909/2
authorKevin Hilman <khilman@baylibre.com>
Mon, 13 Nov 2017 20:00:33 +0000 (20:00 +0000)
committerKevin Hilman <khilman@baylibre.com>
Wed, 15 Nov 2017 21:42:39 +0000 (21:42 +0000)
When no device of the requested device-type is available, abort early
with a useful error message, otherwise job continues and fails in
confusing ways.

Change-Id: I8fdb4160a1ca88d8ba5eb768d70975e9466f696a
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
jjb/common/include-agl-lava-labs-prepare.sh

index b7acd0a..07e2b5f 100644 (file)
@@ -46,6 +46,7 @@ lava_device=${arr[0]}
 releng_device=${arr[1]}
 # And agl_device=${MACHINE}
 
+device_available=0
 for lab in "${!labs[@]}"; do
     val=${labs[$lab]}
     OFS=${IFS}
@@ -110,3 +111,9 @@ for lab in "${!labs[@]}"; do
         break
     fi
 done
+
+if [ "$device_available" -eq 0 ]; then
+    echo ""
+    echo "ERROR: device not found in any available lab."
+    exit 1
+fi