jjb/common/lava-labs-prepare: LAVA fail gracefully if device not found 27/12227/2
authorlollivier <lollivier@baylibre.com>
Thu, 30 Nov 2017 09:56:54 +0000 (10:56 +0100)
committerlollivier <lollivier@baylibre.com>
Thu, 30 Nov 2017 10:00:48 +0000 (11:00 +0100)
When LAVA labs are offline, or otherwise unavailable,
"lava-tool devices-list" fails causing the whole job to fail.

Detect this error earlier when trying to add the authentication and skip
the lab if offline.
If the device was not found in any lab, exit with success.

JIRA: SPEC-1142

Change-Id: Ia2cdeea3da8ade7feb5962e0898f40e59ca9cfdb
Signed-off-by: lollivier <lollivier@baylibre.com>
jjb/common/include-agl-lava-labs-prepare.sh

index 3c0c73a..aab5eb3 100644 (file)
@@ -81,6 +81,7 @@ for lab in "${!labs[@]}"; do
     lava-tool auth-add --token $token_file $full_url
     if [ $? != 0 ]; then
         echo "ERROR: Lab ${lab}: lava-tool auth-add failed."
+        continue
     fi
     rm -f $token_file
 
@@ -117,5 +118,5 @@ done
 if [ "$device_available" -eq 0 ]; then
     echo ""
     echo "ERROR: device not found in any available lab."
-    exit 1
+    exit 0
 fi