summaryrefslogtreecommitdiffstats
path: root/lava-slave/scripts
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2019-09-27 10:43:15 +0200
committerCorentin LABBE <clabbe@baylibre.com>2019-09-27 14:16:04 +0200
commit04e7644a48857c2bf236b687d1d30855131769fa (patch)
tree0d3e275dafe651ed963cab4f1ec90ea40a1d8153 /lava-slave/scripts
parent818704d9795bafbd3420c0848529dfcecaccb088 (diff)
lava-slave: handle better board without worker set
Diffstat (limited to 'lava-slave/scripts')
-rwxr-xr-xlava-slave/scripts/setup.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index 4bf2f67..c39fdc4 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -105,10 +105,14 @@ do
if [ $? -eq 0 ];then
echo "$devicename already present"
#verify if present on another worker
- #TODO
- lavacli $LAVACLIOPTS devices show $devicename |grep ^worker |grep -q $worker
- if [ $? -ne 0 ];then
- echo "ERROR: $devicename already present on another worker"
+ lavacli $LAVACLIOPTS devices show $devicename |grep ^worker > /tmp/current-worker
+ if [ $? -ne 0 ]; then
+ CURR_WORKER=""
+ else
+ CURR_WORKER=$(cat /tmp/current-worker | sed '^.* ,,')
+ fi
+ if [ ! -z "$CURR_WORKER" -a "$CURR_WORKER" != "$worker" ];then
+ echo "ERROR: $devicename already present on another worker $CURR_WORKER"
exit 1
fi
DEVICE_HEALTH=$(grep "$devicename[[:space:]]" /tmp/devices.list | sed 's/.*,//')