aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/common/include-agl-lava-jobs-submit.sh
diff options
context:
space:
mode:
authorLoys Ollivier <lollivier@baylibre.com>2017-11-15 10:24:09 +0100
committerLoys Ollivier <lollivier@baylibre.com>2017-11-15 10:24:09 +0100
commit9929c8aaa1e6278efc26698f8fc1a6c311ff46b3 (patch)
tree755122c4efda18b788f12ca956ccf4a327c3023c /jjb/common/include-agl-lava-jobs-submit.sh
parentc912a72cbef86b2fbca84d13571ad0c7b56bad0b (diff)
jjb/common: lava-jobs: create device name aliases
The previous version would fail to find some boards if the device names were different between lava, AGL, releng. This version creates a device alias table. And uses this table with the correct name for each component (AGL, lava, releng). Change-Id: Ief064c5ff9edb2d824e80549148ee0ab40ebcddf Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
Diffstat (limited to 'jjb/common/include-agl-lava-jobs-submit.sh')
-rw-r--r--jjb/common/include-agl-lava-jobs-submit.sh96
1 files changed, 39 insertions, 57 deletions
diff --git a/jjb/common/include-agl-lava-jobs-submit.sh b/jjb/common/include-agl-lava-jobs-submit.sh
index be2830ac..b63ed2e7 100644
--- a/jjb/common/include-agl-lava-jobs-submit.sh
+++ b/jjb/common/include-agl-lava-jobs-submit.sh
@@ -12,71 +12,53 @@ if [ ! -e $JOB_FILE ]; then
fi
JOB_BASE=$(basename $JOB_FILE .yaml)
-# find device_type from job file
-line=$(grep ^device_type: $JOB_FILE | tr -d '[:space:]')
-__device_type=${line/device_type:/}
-echo "Found device_type $__device_type in LAVA job $JOB_FILE"
+# Need to hack the LAVA device-type name in the job file
+JOB_FILE_NEW="${JOB_BASE}_${LAVA_LAB}.yaml"
+cat $JOB_FILE | sed "s/device_type: $releng_device/device_type: $lava_device/" > $JOB_FILE_NEW
-declare -A dt_aliases
-dt_aliases=(
- [raspberrypi3-uboot]="bcm2837-rpi-3-b-32b"
- [bcm2837-rpi-3-b-32b]="raspberrypi3-uboot"
-)
-device_types=$__device_type
-device_types+=" "
-device_types+=${dt_aliases[$__device_type]}
-
-for device_type in $device_types; do
- # Need to hack the real device-type name in the job file
- JOB_FILE_NEW="${JOB_BASE}_${LAVA_LAB}.yaml"
- cat $JOB_FILE | sed "s/device_type: $__device_type/device_type: $device_type/" > $JOB_FILE_NEW
-
- #
- # LAVA job submit, get job ID from lava-tool output
- #
- JOB_STATUS="${JOB_BASE}_${LAVA_LAB}.status"
- lava-tool submit-job $full_url $JOB_FILE_NEW |tee $JOB_STATUS
- # Printing the job URL in the log
- grep "submitted as job:" $JOB_STATUS
- job_id=$(grep "submitted as job:" $JOB_STATUS | sed 's/.*\/\([0-9]*$\)/\1/')
+#
+# LAVA job submit, get job ID from lava-tool output
+#
+JOB_STATUS="${JOB_BASE}_${LAVA_LAB}.status"
+lava-tool submit-job $full_url $JOB_FILE_NEW |tee $JOB_STATUS
+# Printing the job URL in the log
+grep "submitted as job:" $JOB_STATUS
+job_id=$(grep "submitted as job:" $JOB_STATUS | sed 's/.*\/\([0-9]*$\)/\1/')
- #
- # LAVA wait job events, wait for job to finish
- #
- lava-tool wait-job-events --job-id $job_id $full_url
+#
+# LAVA wait job events, wait for job to finish
+#
+lava-tool wait-job-events --job-id $job_id $full_url
- #
- # LAVA job details, get job status from lava-tool output
- #
- lava-tool job-details $full_url $job_id | tee $JOB_STATUS
+#
+# LAVA job details, get job status from lava-tool output
+#
+lava-tool job-details $full_url $job_id | tee $JOB_STATUS
- IFS=':'
- line=$(grep "^status:" $JOB_STATUS | tr -d '[:space:]')
- arr=($line)
- status=${arr[1]}
- IFS=${OFS}
+IFS=':'
+line=$(grep "^status:" $JOB_STATUS | tr -d '[:space:]')
+arr=($line)
+status=${arr[1]}
+IFS=${OFS}
- echo "LAVA job $job_id completed with status: $status"
+echo "LAVA job $job_id completed with status: $status"
- echo "####"
- echo "#### Start: Output from LAVA job $job_id ####"
- echo "####"
+echo "####"
+echo "#### Start: Output from LAVA job $job_id ####"
+echo "####"
- JOB_OUTPUT="${JOB_BASE}_output.yaml"
- JOB_LOG="${JOB_BASE}_output.log"
- curl -s -o $JOB_OUTPUT $full_url/scheduler/job/$job_id/log_file/plain
- cat $JOB_OUTPUT | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g' | tee $JOB_LOG
+JOB_OUTPUT="${JOB_BASE}_output.yaml"
+JOB_LOG="${JOB_BASE}_output.log"
+curl -s -o $JOB_OUTPUT $full_url/scheduler/job/$job_id/log_file/plain
+cat $JOB_OUTPUT | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g' | tee $JOB_LOG
- echo "####"
- echo "#### End: Output from LAVA job $job_id ####"
- echo "####"
+echo "####"
+echo "#### End: Output from LAVA job $job_id ####"
+echo "####"
- # after one successful submit, we're done
- if [ x"$status" = x"Complete" ]; then
- exit 0
- else
- continue
- fi
-done
+# after one successful submit, we're done
+if [ x"$status" = x"Complete" ]; then
+ exit 0
+fi
exit 1