aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jjb/common/include-agl-lava-jobs-submit.sh96
-rw-r--r--jjb/common/include-agl-lava-labs-prepare.sh19
-rw-r--r--jjb/common/include-agl-run-test-short.sh2
3 files changed, 57 insertions, 60 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
diff --git a/jjb/common/include-agl-lava-labs-prepare.sh b/jjb/common/include-agl-lava-labs-prepare.sh
index cde6539d..b7acd0a6 100644
--- a/jjb/common/include-agl-lava-labs-prepare.sh
+++ b/jjb/common/include-agl-lava-labs-prepare.sh
@@ -31,6 +31,21 @@ cat <<EOF > ~/.local/share/python_keyring/keyringrc.cfg
default-keyring=keyring.backends.file.PlaintextKeyring
EOF
+declare -A agl_lava_releng_aliases
+agl_lava_releng_aliases=(
+ [raspberrypi3]="raspberrypi3-uboot;raspberrypi3"
+ [qemux86-64]="qemu;qemux86-64"
+ [m3ulcb-nogfx]="r8a7796-m3ulcb;m3ulcb"
+)
+
+OFS=${IFS}
+IFS=';'
+arr=(${agl_lava_releng_aliases[$MACHINE]})
+IFS=${OFS}
+lava_device=${arr[0]}
+releng_device=${arr[1]}
+# And agl_device=${MACHINE}
+
for lab in "${!labs[@]}"; do
val=${labs[$lab]}
OFS=${IFS}
@@ -67,8 +82,8 @@ for lab in "${!labs[@]}"; do
rm -f $token_file
# Find the LAVA Lab that has the device available to run the job
- echo -n "Checking for $__MACHINE at $full_url... "
- line=$(lava-tool devices-list $full_url |grep $__MACHINE | tr -d '[:space:]')
+ echo -n "Checking for $lava_device at $full_url... "
+ line=$(lava-tool devices-list $full_url |grep $lava_device | tr -d '[:space:]')
if [ -z "$line" ]; then
echo "not found."
continue
diff --git a/jjb/common/include-agl-run-test-short.sh b/jjb/common/include-agl-run-test-short.sh
index 7db7ec5d..ba0cdeb3 100644
--- a/jjb/common/include-agl-run-test-short.sh
+++ b/jjb/common/include-agl-run-test-short.sh
@@ -21,7 +21,7 @@ if [ ! -z $RELENG ] && \
echo "## Check version of python-jinja2: "
pip show jinja2
CREATE_ARGS=""
- CREATE_ARGS+="--machine ${__MACHINE} "
+ CREATE_ARGS+="--machine ${releng_device} "
CREATE_ARGS+="--url ci "
[[ ! -z $GERRIT_CHANGE_NUMBER ]] && CREATE_ARGS+="--changeid $GERRIT_CHANGE_NUMBER "
[[ ! -z $GERRIT_PATCHSET_NUMBER ]] && CREATE_ARGS+="--patchset $GERRIT_PATCHSET_NUMBER "