diff options
-rw-r--r-- | jjb/common/include-agl-lava-labs-prepare.sh | 27 | ||||
-rw-r--r-- | packer/provision/agl_dependencies.sh | 8 |
2 files changed, 34 insertions, 1 deletions
diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh index ea025469..893c859f 100644 --- a/jjb/common/include-agl-lava-labs-prepare.sh +++ b/jjb/common/include-agl-lava-labs-prepare.sh @@ -69,6 +69,33 @@ for lab in "${!labs[@]}"; do fi rm -f $token_file + # lavacli auth using token + lavacli identities add --token ${token} --uri $full_url --username $user $lab + + # 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 | head -1) + lavacli_line=$(echo "$lavacli_line" | tr -d '[:space:]') + + if [ -z "$lavacli_line" ]; then + echo "not found." + continue + fi + IFS=':' + arr=($lavacli_line) + device_status=${arr[1]} + IFS=${OFS} + + if [ x"$device_status" = x"Idle,Good" ]; then + echo "lavacli: found a device available: $lavacli_line" + lavacli_dev=$(echo ${arr[0]} | sed 's/\*\([^(]*\).*/\1/') + lavacli_tags=$(lavacli -i $lab devices tags list $lavacli_dev | grep \*) + lavacli_tags=$(echo $lavacli_tags | sed 's/\* \(\)/\1/') + echo "Tags for $lavacli_dev: $lavacli_tags" + else + echo "lavacli: did not find any device available: $lavacli_line" + fi + # 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) diff --git a/packer/provision/agl_dependencies.sh b/packer/provision/agl_dependencies.sh index ed9dce66..2d6bdbf9 100644 --- a/packer/provision/agl_dependencies.sh +++ b/packer/provision/agl_dependencies.sh @@ -25,10 +25,16 @@ DEBIAN_FRONTEND=noninteractive apt-get update && \ libtool libglib2.0-dev libarchive-dev python-git git python python-minimal repo \ tree rsync python-yaml python-requests curl tar docker.io pandoc python3 \ ruby-all-dev ruby-ffi ruby-ffi-* jekyll ruby-redcarpet mkdocs \ - python-pip python-simplejson g++-multilib make zip unzip iperf3 + python-pip python-simplejson g++-multilib make zip unzip iperf3 \ + debian-keyring debian-archive-keyring DEBIAN_FRONTEND=noninteractive apt-get install -y -t jessie-backports lava-tool=0.19-1~bpo8+1 +# Adding stretch-backports for lavacli +echo "deb http://deb.debian.org/debian/ stretch-backports main" >> /etc/apt/sources.list + +DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -t stretch-backports lavacli + # we have a build blocker wrt useradd - I assume it is caused by /bin/sh being dash # systemd: Performing useradd with echo "dash dash/sh boolean false" | debconf-set-selections |