aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/common/include-agl-lava-labs-prepare.sh
diff options
context:
space:
mode:
authorKhouloud Touil <ktouil@baylibre.com>2019-04-02 10:49:17 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2019-04-29 16:33:51 +0200
commit00a7f42b60833d481f6476fee453c1192a395a0b (patch)
tree1ad6df6399dbcaf6fb89224724ec2d8bf0ff5007 /jjb/common/include-agl-lava-labs-prepare.sh
parent3d2d6114b0dda535e5515d2e083d8e59f821b93a (diff)
Replace lava-tool with lavacli
In order to move totally to lavacli, this patch: - Apply changes to submit jobs using lavacli. As the blocking call (--block) no longer exists with lavacli, so had to replace that with a polling loop. - Replace lava-tool with lavacli in the polling part in the labs-prepare file, which checks the device status and availability. Different changes tested at Baylibre. Change-Id: I25b1ad4b47ae09a158e1e1cf42e30da5e6aa8b57 Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
Diffstat (limited to 'jjb/common/include-agl-lava-labs-prepare.sh')
-rw-r--r--jjb/common/include-agl-lava-labs-prepare.sh26
1 files changed, 11 insertions, 15 deletions
diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh
index f32e16f9..19801e13 100644
--- a/jjb/common/include-agl-lava-labs-prepare.sh
+++ b/jjb/common/include-agl-lava-labs-prepare.sh
@@ -75,7 +75,7 @@ for lab in "${!labs[@]}"; do
# lavacli: Find the LAVA lab that has the device available to run the job
echo -n "lavacli: Checking for $lava_device at $full_url... "
- lavacli_line=$(lavacli -i $lab devices list | grep $lava_device | grep Idle,Good | head -1)
+ lavacli_line=$(lavacli -i $lab devices list | grep $lava_device | grep Good | head -1)
lavacli_line=$(echo "$lavacli_line" | tr -d '[:space:]')
if [ -z "$lavacli_line" ]; then
@@ -105,12 +105,8 @@ for lab in "${!labs[@]}"; do
echo "not found."
continue
fi
- IFS='|'
- arr=($line)
- device_status=${arr[2]}
- IFS=${OFS}
- if [ x"$device_status" = x"reserved" ]; then
+ if [ x"$device_status" = x"Reserved,Good" ]; then
retries=10
else
retries=1
@@ -122,26 +118,26 @@ for lab in "${!labs[@]}"; do
do
# device is only available if "idle" or "running"
device_available=0
- if [ x"$device_status" = x"reserved" ]; then
+ if [ x"$device_status" = x"Reserved,Good" ]; 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:]')
+ lavacli_line=$(lavacli -i $lab devices list | grep $lava_device | grep Good | head -1)
+ lavacli_line=$(echo "$lavacli_line" | tr -d '[:space:]')
- if [ -z "$line" ]; then
+ if [ -z "$lavacli_line" ]; then
echo "not found."
continue
fi
- IFS='|'
- arr=($line)
- device_status=${arr[2]}
+ IFS=':'
+ arr=($lavacli_line)
+ device_status=${arr[1]}
IFS=${OFS}
fi
- if [ x"$device_status" = x"idle" ]; then
+ if [ x"$device_status" = x"Idle,Good" ]; then
device_available=1
break
- elif [ x"$device_status" = x"running" ]; then
+ elif [ x"$device_status" = x"Running,Good" ]; then
device_available=1;
break
fi