diff options
Diffstat (limited to 'jjb/common')
-rw-r--r-- | jjb/common/include-agl-lava-labs-prepare.sh | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh index 8a40704a..35d3541c 100644 --- a/jjb/common/include-agl-lava-labs-prepare.sh +++ b/jjb/common/include-agl-lava-labs-prepare.sh @@ -96,6 +96,22 @@ for lab in "${!labs[@]}"; do do # device is only available if "idle" or "running" device_available=0 + if [ x"$device_status" = x"reserved" ]; then + sleep 60s + # Look if the status of the board has changed from reserved in the lab + echo -n "Checking for $lava_device at $full_url... " + line=$(lava-tool devices-list $full_url | grep $lava_device) + line=$(echo "$line" | tr -d '[:space:]') + + if [ -z "$line" ]; then + echo "not found." + continue + fi + IFS='|' + arr=($line) + device_status=${arr[2]} + IFS=${OFS} + fi if [ x"$device_status" = x"idle" ]; then device_available=1 break @@ -103,20 +119,6 @@ for lab in "${!labs[@]}"; do device_available=1; break fi - sleep 60s - # Find the LAVA Lab that has the device available to run the job - echo -n "Checking for $lava_device at $full_url... " - line=$(lava-tool devices-list $full_url | grep $lava_device) - line=$(echo "$line" | tr -d '[:space:]') - - if [ -z "$line" ]; then - echo "not found." - continue - fi - IFS='|' - arr=($line) - device_status=${arr[2]} - IFS=${OFS} done if [ $device_available = 0 ]; then |