canonical-hw-cert team mailing list archive
-
canonical-hw-cert team
-
Mailing list archive
-
Message #36769
[Merge] ~pwlars/hwcert-jenkins-jobs:remove-double-braces-where-possible into hwcert-jenkins-jobs:master
Paul Larson has proposed merging ~pwlars/hwcert-jenkins-jobs:remove-double-braces-where-possible into hwcert-jenkins-jobs:master.
Requested reviews:
hwcert-jenkins (hwcert-jenkins)
For more details, see:
https://code.launchpad.net/~pwlars/hwcert-jenkins-jobs/+git/hwcert-jenkins-jobs/+merge/432981
I've already landed and deployed the changes to the testflinger agents so that they only call format() if there are double-braces in the testflinger job and warn the user of upcoming deprecation. The only remaining places where double-braces should exist in any of our jobs after this are where it is needed to avoid confusing jenkins-job-builder. Also, you'll notice that when running jobs with out these (but these will be stripped out by jenkins job builder), the recent deprecation warning I added during the testflinger job is now gone. See http://10.102.156.15:8080/job/cert-rpi3aplus-arm64-pi-kernel-18-pi-beta/40/console for an example run with this patch applied.
--
Your team hwcert-jenkins is requested to review the proposed merge of ~pwlars/hwcert-jenkins-jobs:remove-double-braces-where-possible into hwcert-jenkins-jobs:master.
diff --git a/jobs/advocacy-snaps/advocacy-template.yaml b/jobs/advocacy-snaps/advocacy-template.yaml
index 07fa783..b1ddffa 100644
--- a/jobs/advocacy-snaps/advocacy-template.yaml
+++ b/jobs/advocacy-snaps/advocacy-template.yaml
@@ -80,7 +80,7 @@
TRACK="${{TRACK:-latest}}"
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq --arg TRACK "$TRACK" '."channel-map" | .[] | select(.channel.risk=="{channel}") |select(.channel.track==$TRACK).revision')
fi
- REV_OLD_FILE=$(cat ${{WORKSPACE}}/revision.last 2> /dev/null || echo 0)
+ REV_OLD_FILE=$(cat $WORKSPACE/revision.last 2> /dev/null || echo 0)
REV_OLD=$(curl -sf $REV_URL)
REV_OLD=$(( $REV_OLD > $REV_OLD_FILE ? $REV_OLD : $REV_OLD_FILE ))
if [ "$REV" -gt "$REV_OLD" ]; then
diff --git a/jobs/advocacy-snaps/run-advocacy-snaps.sh b/jobs/advocacy-snaps/run-advocacy-snaps.sh
index a8343a2..930b449 100644
--- a/jobs/advocacy-snaps/run-advocacy-snaps.sh
+++ b/jobs/advocacy-snaps/run-advocacy-snaps.sh
@@ -17,16 +17,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 120 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -38,8 +38,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- wait_for_snap_complete() {{{{
+ }}
+ wait_for_snap_complete() {{
set +x
loopcnt=0
until [ \$loopcnt -gt 40 ]
@@ -61,8 +61,8 @@ cat > job.yaml <<EOF
exit 1
fi
set -x
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -78,7 +78,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Perform any extra platform-specific setup commands here
{extra_setup_cmds}
@@ -138,9 +138,9 @@ cat > job.yaml <<EOF
EXITCODE=\$?
# find needed reports and put them into artifacts which
# will be downloaded over testflinger artifacts later
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} junit.xml \;"
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.html' -exec mv {{{{}}}} submission.html \;"
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} submission.tar.xz \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{}} junit.xml \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.html' -exec mv {{}} submission.html \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{}} submission.tar.xz \;"
_run tar -xf submission.tar.xz submission.json
_run tar Jcvf submission.tar.xz submission.html checkbox.csv
mkdir -p artifacts
@@ -169,25 +169,25 @@ pip install pyyaml
pip install influxdb
pip install requests
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
cp artifacts/submission.json submission.json.previous.$DISTRO_IMAGE || /bin/true
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-export C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep certification.canonical.com)
+export C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep certification.canonical.com)
echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/job-summary artifacts/submission.json submission.json.previous.$DISTRO_IMAGE > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
if [ -f artifacts/submission.html ]; then
@@ -195,8 +195,8 @@ if [ -f artifacts/submission.html ]; then
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
hwcert-jenkins-tools/mailtool -t "{email}" -s "[TESTFLINGER] {name}" -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
@@ -206,4 +206,4 @@ fi
echo >> artifacts/summary
# Send the checkbox.csv results to influxdb
hwcert-jenkins-tools/advocacy/advo.py
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
diff --git a/jobs/chromium/chromium-template.yaml b/jobs/chromium/chromium-template.yaml
index f28f374..5cffd29 100644
--- a/jobs/chromium/chromium-template.yaml
+++ b/jobs/chromium/chromium-template.yaml
@@ -68,7 +68,7 @@
else
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq '."channel-map" | .[] | select(.channel.risk=="{channel}") | .revision')
fi
- REV_OLD_FILE=$(cat ${{WORKSPACE}}/revision.last 2> /dev/null || echo 0)
+ REV_OLD_FILE=$(cat $WORKSPACE/revision.last 2> /dev/null || echo 0)
REV_OLD=$(curl -sf $REV_URL)
REV_OLD=$(( $REV_OLD > $REV_OLD_FILE ? $REV_OLD : $REV_OLD_FILE ))
if [ "$REV" -gt "$REV_OLD" ]; then
diff --git a/jobs/chromium/run-chromium.sh b/jobs/chromium/run-chromium.sh
index 8f44bc1..ea7c8bb 100644
--- a/jobs/chromium/run-chromium.sh
+++ b/jobs/chromium/run-chromium.sh
@@ -16,20 +16,20 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
+ }}
_run sudo apt-get update
_run sudo apt-get -y install --no-install-recommends python3-selenium python3-gi gir1.2-snapd-1 fonts-dejavu-core
_run sudo snap install chromium --channel={track}/{channel}
mkdir ./artifacts
- _run snap list |grep chromium |awk '{{{{ print "Chromium Version: "\$2"-"\$3 }}}}' > artifacts/info
+ _run snap list |grep chromium |awk '{{ print "Chromium Version: "\$2"-"\$3 }}' > artifacts/info
echo "Architecture: {arch}" >> artifacts/info
_run snap connections chromium >> artifacts/info
cat artifacts/info
@@ -45,19 +45,19 @@ EOF
. build-env.sh
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
[[ -z $TEST_STATUS ]] && TEST_STATUS=1
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
+echo "Test exit status: $TEST_STATUS"
exit $TEST_STATUS
diff --git a/jobs/desktop-snaps/run-desktop-snaps.sh b/jobs/desktop-snaps/run-desktop-snaps.sh
index d0cbd2a..185b1de 100644
--- a/jobs/desktop-snaps/run-desktop-snaps.sh
+++ b/jobs/desktop-snaps/run-desktop-snaps.sh
@@ -17,16 +17,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 120 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -38,8 +38,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -55,7 +55,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
sudo apt-get -qq update
@@ -97,9 +97,9 @@ cat > job.yaml <<EOF
EXITCODE=\$?
# find needed reports and put them into artifacts which
# will be downloaded over testflinger artifacts later
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} junit.xml \;"
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.html' -exec mv {{{{}}}} submission.html \;"
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} submission.tar.xz \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{}} junit.xml \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.html' -exec mv {{}} submission.html \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{}} submission.tar.xz \;"
_run tar -xf submission.tar.xz submission.json
_run tar Jcvf submission.tar.xz submission.html
mkdir -p artifacts
@@ -119,25 +119,25 @@ EOF
. build-env.sh
git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone -q https://git.launchpad.net/hwcert-jenkins-tools)
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
cp artifacts/submission.json submission.json.previous.$DISTRO_IMAGE || /bin/true
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-export C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep certification.canonical.com)
+export C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep certification.canonical.com)
echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/job-summary artifacts/submission.json submission.json.previous.$DISTRO_IMAGE > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
if [ -f artifacts/submission.html ]; then
@@ -145,8 +145,8 @@ if [ -f artifacts/submission.html ]; then
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
hwcert-jenkins-tools/mailtool -t "{email}" -s "[TESTFLINGER] {name}" -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
@@ -154,4 +154,4 @@ if [ -f artifacts/submission.json ]; then
curl "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
echo >> artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
diff --git a/jobs/dgx/dgx-template.yaml b/jobs/dgx/dgx-template.yaml
index 2e0f2ea..805bf31 100644
--- a/jobs/dgx/dgx-template.yaml
+++ b/jobs/dgx/dgx-template.yaml
@@ -9,14 +9,14 @@
arch: amd64
flavor: desktop # desktop, server and more in the future
manifest: >-
- {{{{\"com.canonical.certification::has_bt_smart\": false,
+ {{\"com.canonical.certification::has_bt_smart\": false,
\"com.canonical.certification::has_card_reader\": false,
\"com.canonical.certification::has_ethernet_adapter\": true,
\"com.canonical.certification::has_thunderbolt\": false,
\"com.canonical.certification::has_thunderbolt3\": false,
\"com.canonical.certification::has_touchscreen\": false,
\"com.canonical.certification::has_tpm2_chip\": false,
- \"com.canonical.certification::has_usb_type_c\": false}}}}
+ \"com.canonical.certification::has_usb_type_c\": false}}
triggers:
- pollurl:
cron: 'H * * * *'
diff --git a/jobs/dgx/run-dgx.sh b/jobs/dgx/run-dgx.sh
index de49412..97a7977 100644
--- a/jobs/dgx/run-dgx.sh
+++ b/jobs/dgx/run-dgx.sh
@@ -17,16 +17,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -38,7 +38,7 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
+ }}
echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" > etc.sudoers.d.checkbox
_put etc.sudoers.d.checkbox /home/ubuntu
@@ -80,8 +80,8 @@ cat > job.yaml <<EOF
# find needed reports and put them into artifacts which
# will be downloaded over testflinger artifacts later
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} junit.xml \;"
- _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} submission.tar.xz \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.junit.xml' -exec mv {{}} junit.xml \;"
+ _run "find /home/ubuntu/.local/share/checkbox-ng/ -name 'submission_*.tar.xz' -exec mv {{}} submission.tar.xz \;"
_run tar -xf submission.tar.xz submission.json
mkdir -p artifacts
_get /home/ubuntu/junit.xml artifacts
@@ -103,24 +103,24 @@ git clone https://git.launchpad.net/hwcert-jenkins-tools
git -C hwcert-data pull -q || git clone -q git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-export C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep certification.canonical.com)
+export C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep certification.canonical.com)
echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo Jenkins build details: $BUILD_URL > artifacts/summary
hwcert-jenkins-tools/job-summary artifacts/submission.json submission.json.previous.$DISTRO_IMAGE > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
@@ -129,8 +129,8 @@ if [ -f artifacts/submission.html ]; then
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
hwcert-jenkins-tools/mailtool -t "{email}" -s "[TESTFLINGER] {name}" -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
@@ -138,5 +138,5 @@ if [ -f artifacts/submission.json ]; then
curl "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.deb-board-updater --config hwcert-data/debs.yaml -a {arch} -n {name} -k {kernel-to-check} -s {series} -t {srutype} -q {queue} artifacts/raw_summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $EXITCODE
diff --git a/jobs/image-testing/run-image-testing-server.sh b/jobs/image-testing/run-image-testing-server.sh
index a230be8..9785fb3 100644
--- a/jobs/image-testing/run-image-testing-server.sh
+++ b/jobs/image-testing/run-image-testing-server.sh
@@ -17,16 +17,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -39,8 +39,8 @@ cat > job.yaml <<EOF
sleep 30
done
{post_wait_for_ssh_cmds}
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -56,7 +56,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
sudo apt-get -qq update
@@ -91,7 +91,7 @@ cat > job.yaml <<EOF
mkdir -p artifacts
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
## Begin building a "complete" launcher file this should contain all
@@ -121,7 +121,7 @@ cat > job.yaml <<EOF
# Merge the launcher we downloaded with checkbox.conf
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c.read('submission_conf');c.read('device_conf');c.read('manifest_conf');c.write(open('checkbox-launcher','wt'))"
- export DESCRIPTION="Image test for {image-type} - \$MD5 \nJenkins URL: ${{BUILD_URL}}"
+ export DESCRIPTION="Image test for {image-type} - \$MD5 \nJenkins URL: $BUILD_URL"
# Add the description to the launcher
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c['launcher']['session_desc']='\$DESCRIPTION';c.write(open('checkbox-launcher','wt'))"
@@ -134,9 +134,9 @@ cat > job.yaml <<EOF
PYTHONUNBUFFERED=1 checkbox-cli remote \$DEVICE_IP checkbox-launcher
EXITCODE=\$?
- find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} artifacts/junit.xml \;
- find /home/ubuntu/ -name 'submission_*.html' -exec mv {{{{}}}} artifacts/submission.html \;
- find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} artifacts/submission.tar.xz \;
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.html' -exec mv {{}} artifacts/submission.html \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
tar -xf artifacts/submission.tar.xz submission.json
mv submission.json artifacts
@@ -157,19 +157,19 @@ fi
echo IMAGE_BUILD_ID: $BUILD_ID
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-if C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
echo "Found successful C3 submision link"
else
C3LINK="Failed to find C3 submission link"
@@ -179,7 +179,7 @@ echo "$C3LINK" > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
@@ -189,8 +189,8 @@ if [ -f artifacts/submission.html ]; then
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} image test results -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
@@ -198,5 +198,5 @@ if [ -f artifacts/submission.json ]; then
curl -s "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
flock /tmp/TRELLO-IMAGE-UPDATE.LOCK certification-dashboard-manager.image-board-updater -n {name} -i {image_file} -c {image_channel} -v $BUILD_ID artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $EXITCODE
diff --git a/jobs/image-testing/run-image-testing.sh b/jobs/image-testing/run-image-testing.sh
index 6661d04..d4fb680 100644
--- a/jobs/image-testing/run-image-testing.sh
+++ b/jobs/image-testing/run-image-testing.sh
@@ -17,16 +17,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -39,8 +39,8 @@ cat > job.yaml <<EOF
sleep 30
done
{post_wait_for_ssh_cmds}
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -56,7 +56,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
sudo apt-get -qq update
@@ -85,11 +85,11 @@ cat > job.yaml <<EOF
# Get the name of the snap without .snap just in case
# But we may need to keep CHECKBOX_SNAP for installation
CHECKBOX_NAME=\$(basename \$CHECKBOX_SNAP)
- CHECKBOX_NAME=\$(_run snap info \$CHECKBOX_NAME |grep name: | awk '{{{{ print \$2 }}}}')
+ CHECKBOX_NAME=\$(_run snap info \$CHECKBOX_NAME |grep name: | awk '{{ print \$2 }}')
# Install extra snaps with channels specified needed for testing
- for s in \${{{{!extra_snaps_channels[@]}}}}; do
- _run_retry sudo snap install \$s --channel=\${{{{extra_snaps_channels[\$s]}}}}
+ for s in \${{!extra_snaps_channels[@]}}; do
+ _run_retry sudo snap install \$s --channel=\${{extra_snaps_channels[\$s]}}
done
# Install extra snaps needed for testing
@@ -116,7 +116,7 @@ cat > job.yaml <<EOF
mkdir -p artifacts
wait_for_ssh
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
echo "Delaying any further automated snap refreshes during the test run"
@@ -126,7 +126,7 @@ cat > job.yaml <<EOF
_run \$CHECKBOX_NAME.{launcher} --help &> /dev/null
#Get checkbox (classic) revision
- CHECKBOX_REV=\$(_run snap list \$CHECKBOX_NAME |tail -n1 |awk '{{{{print \$3}}}}')
+ CHECKBOX_REV=\$(_run snap list \$CHECKBOX_NAME |tail -n1 |awk '{{print \$3}}')
## Begin building a "complete" launcher file this should contain all
## configuration and manifests. This is the file that will be use by the
@@ -157,7 +157,7 @@ cat > job.yaml <<EOF
# Merge the launcher we downloaded with checkbox.conf
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c.read('submission_conf');c.read('device_conf');c.read('manifest_conf');c.write(open('checkbox-launcher','wt'))"
- export DESCRIPTION="Image test for {image-type} - \$MD5 \nJenkins URL: ${{BUILD_URL}}"
+ export DESCRIPTION="Image test for {image-type} - \$MD5 \nJenkins URL: $BUILD_URL"
# Add the description to the launcher
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c['launcher']['session_desc']='\$DESCRIPTION';c.write(open('checkbox-launcher','wt'))"
@@ -178,9 +178,9 @@ cat > job.yaml <<EOF
PYTHONUNBUFFERED=1 checkbox-cli remote \$DEVICE_IP checkbox-launcher
EXITCODE=\$?
- find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} artifacts/junit.xml \;
- find /home/ubuntu/ -name 'submission_*.html' -exec mv {{{{}}}} artifacts/submission.html \;
- find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} artifacts/submission.tar.xz \;
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.html' -exec mv {{}} artifacts/submission.html \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
tar -xf artifacts/submission.tar.xz submission.json
mv submission.json artifacts
@@ -201,19 +201,19 @@ fi
echo IMAGE_BUILD_ID: $BUILD_ID
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-if C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
echo "Found successful C3 submision link"
else
C3LINK="Failed to find C3 submission link"
@@ -223,7 +223,7 @@ echo "$C3LINK" > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
@@ -233,8 +233,8 @@ if [ -f artifacts/submission.html ]; then
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
hwcert-jenkins-tools/mailtool -t {email} -s "[TF_IMAGE] {device}-{image-type} ($BUILD_ID) image test results" -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
@@ -242,5 +242,5 @@ if [ -f artifacts/submission.json ]; then
curl -s "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
flock /tmp/TRELLO-IMAGE-UPDATE.LOCK certification-dashboard-manager.image-board-updater -n {device}-{image-type} -i {image_file} -c {image_channel} -v $BUILD_ID artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $EXITCODE
diff --git a/jobs/mir/mir-core-template.yaml b/jobs/mir/mir-core-template.yaml
index bf5dd35..67acc26 100644
--- a/jobs/mir/mir-core-template.yaml
+++ b/jobs/mir/mir-core-template.yaml
@@ -64,7 +64,7 @@
TRACK="{track}"
TRACK="${{TRACK:-latest}}"
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq --arg TRACK "$TRACK" '."channel-map" | .[] | select(.channel.risk=="{channel}") |select(.channel.track==$TRACK).revision')
- REV_OLD_FILE=$(cat ${{WORKSPACE}}/revision.last 2> /dev/null || echo 0)
+ REV_OLD_FILE=$(cat $WORKSPACE/revision.last 2> /dev/null || echo 0)
REV_OLD=$(curl -sf $REV_URL)
REV_OLD=$(( $REV_OLD > $REV_OLD_FILE ? $REV_OLD : $REV_OLD_FILE ))
if [ "$REV" -gt "$REV_OLD" ]; then
diff --git a/jobs/mir/mir-template.yaml b/jobs/mir/mir-template.yaml
index c92b53c..d37eb79 100644
--- a/jobs/mir/mir-template.yaml
+++ b/jobs/mir/mir-template.yaml
@@ -70,7 +70,7 @@
TRACK="{track}"
TRACK="${{TRACK:-latest}}"
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq --arg TRACK "$TRACK" '."channel-map" | .[] | select(.channel.risk=="{channel}") |select(.channel.track==$TRACK).revision')
- REV_OLD_FILE=$(cat ${{WORKSPACE}}/revision.last 2> /dev/null || echo 0)
+ REV_OLD_FILE=$(cat $WORKSPACE/revision.last 2> /dev/null || echo 0)
REV_OLD=$(curl -sf $REV_URL)
REV_OLD=$(( $REV_OLD > $REV_OLD_FILE ? $REV_OLD : $REV_OLD_FILE ))
if [ "$REV" -gt "$REV_OLD" ]; then
diff --git a/jobs/mir/run-core-mir.sh b/jobs/mir/run-core-mir.sh
index 66b5c6f..ec36a83 100644
--- a/jobs/mir/run-core-mir.sh
+++ b/jobs/mir/run-core-mir.sh
@@ -19,16 +19,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -40,8 +40,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- wait_for_snap_complete() {{{{
+ }}
+ wait_for_snap_complete() {{
# wait for snapd to realize it's Doing stuff
sleep 5
loopcnt=0
@@ -54,8 +54,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -73,7 +73,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Some devices need a bit of time at the beginning before starting
sleep {starting_sleep}
@@ -129,7 +129,7 @@ cat > job.yaml <<EOF
mkdir -p artifacts
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
_run sudo journalctl -u snap.{snap}.daemon.service > artifacts/{snap}.log
@@ -150,20 +150,20 @@ EOF
. build-env.sh
git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone -q https://git.launchpad.net/hwcert-jenkins-tools)
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo Jenkins build details: $BUILD_URL > artifacts/summary
echo >> artifacts/summary
cat artifacts/snaplist.txt >> artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $TEST_STATUS
diff --git a/jobs/mir/run-mir.sh b/jobs/mir/run-mir.sh
index 461522e..35f06d9 100644
--- a/jobs/mir/run-mir.sh
+++ b/jobs/mir/run-mir.sh
@@ -18,16 +18,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 120 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -39,7 +39,7 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
+ }}
if [ "{no_apt_cron}" == "True" ]; then
echo "no_apt_cron option is on. Block the apt cron check."
_run sudo rm /etc/cron.daily/apt-compat
@@ -155,7 +155,7 @@ cat > job.yaml <<EOF
mkdir -p artifacts
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
_run snap run --shell mir-test-tools.{suite}-test -c 'cp\\ /tmp/*.log\\ \\\$SNAP_USER_DATA'
@@ -174,24 +174,24 @@ EOF
. build-env.sh
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
[ -n $TEST_STATUS ] && TEST_STATUS=1
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-export C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep certification.canonical.com)
+export C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep certification.canonical.com)
echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo Jenkins build details: $BUILD_URL > artifacts/summary
+echo "Test exit status: $TEST_STATUS"
grep -q "OUTCOME: PASS" artifacts/mir.log || exit 1
diff --git a/jobs/snap-testing/generic-snappy-testflinger-candidate-snaps.yaml b/jobs/snap-testing/generic-snappy-testflinger-candidate-snaps.yaml
index 78e552c..4d741da 100644
--- a/jobs/snap-testing/generic-snappy-testflinger-candidate-snaps.yaml
+++ b/jobs/snap-testing/generic-snappy-testflinger-candidate-snaps.yaml
@@ -130,7 +130,7 @@
TRACK="${{TRACK:-latest}}"
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq --arg TRACK "$TRACK" '."channel-map" | .[] | select(.channel.risk=="{channel}") |select(.channel.track==$TRACK).revision')
fi
- REV_OLD_FILE=$(cat ${{WORKSPACE}}/revision.last 2> /dev/null || echo 0)
+ REV_OLD_FILE=$(cat $WORKSPACE/revision.last 2> /dev/null || echo 0)
REV_OLD=$(curl -sf $REV_URL)
REV_OLD=$(( $REV_OLD > $REV_OLD_FILE ? $REV_OLD : $REV_OLD_FILE ))
if [ "$REV" -gt "$REV_OLD" ]; then
diff --git a/jobs/snap-testing/run-cdts-list-bootstrapped.sh b/jobs/snap-testing/run-cdts-list-bootstrapped.sh
index 35a5f8a..c70e127 100644
--- a/jobs/snap-testing/run-cdts-list-bootstrapped.sh
+++ b/jobs/snap-testing/run-cdts-list-bootstrapped.sh
@@ -21,16 +21,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -42,8 +42,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- wait_for_snap_complete() {{{{
+ }}
+ wait_for_snap_complete() {{
set +x
loopcnt=0
until [ \$loopcnt -gt 40 ]
@@ -66,8 +66,8 @@ cat > job.yaml <<EOF
fi
set -x
sleep 5
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -83,7 +83,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
sudo apt-get -qq update
@@ -149,7 +149,7 @@ cat > job.yaml <<EOF
fi
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
echo "Delaying any further automated snap refreshes during the test run"
@@ -185,23 +185,23 @@ git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone
git -C hwcert-data pull -q || git clone -q git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
-flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v ${{VERSION}} -r ${{REV}} -t __track__{track} -c {channel} --cardonly /dev/null
+flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v $VERSION -r $REV -t __track__{track} -c {channel} --cardonly /dev/null
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} | jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID | jq -r .test_status)
rm -rf artifacts*
# Get artifacts with a retry after a delay if first attempt fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo Jenkins build details: $BUILD_URL > artifacts/summary
echo >> artifacts/summary
if [ -f artifacts/new-list-bootstrapped.txt ]; then
if [ -f artifacts/diff-output.txt ]; then
@@ -220,9 +220,9 @@ fi
echo >> artifacts/summary
cat artifacts/snaplist.txt >> artifacts/summary
-hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} (${{REV}}) {track}/{channel}" artifacts/summary
+hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} ($REV) {track}/{channel}" artifacts/summary
-flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v ${{VERSION}} -r ${{REV}} -t __track__{track} -c {channel} artifacts/raw_summary
+flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v $VERSION -r $REV -t __track__{track} -c {channel} artifacts/raw_summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $TEST_STATUS
diff --git a/jobs/snap-testing/run-checkbox-snappy.sh b/jobs/snap-testing/run-checkbox-snappy.sh
index 2c0f776..2b9f731 100644
--- a/jobs/snap-testing/run-checkbox-snappy.sh
+++ b/jobs/snap-testing/run-checkbox-snappy.sh
@@ -21,16 +21,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -43,8 +43,8 @@ cat > job.yaml <<EOF
sleep 30
done
{post_wait_for_ssh_cmds}
- }}}}
- wait_for_snap_complete() {{{{
+ }}
+ wait_for_snap_complete() {{
set +x
loopcnt=0
until [ \$loopcnt -gt 40 ]
@@ -66,8 +66,8 @@ cat > job.yaml <<EOF
exit 1
fi
set -x
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -83,7 +83,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
sudo apt-get -qq update
@@ -101,7 +101,7 @@ cat > job.yaml <<EOF
_run_retry "snap known serial |grep serial"
fi
- DEVICE=\$(_run find /snap -name gadget.yaml -print -quit 2\> /dev/null | awk -F/ '{{{{ print \$3 }}}}')
+ DEVICE=\$(_run find /snap -name gadget.yaml -print -quit 2\> /dev/null | awk -F/ '{{ print \$3 }}')
if echo "{checkbox_snap}" | grep -qi http; then
CHECKBOX_SNAP=\$(basename {checkbox_snap})
@@ -114,7 +114,7 @@ cat > job.yaml <<EOF
# Get the name of the snap without .snap just in case
# But we may need to keep CHECKBOX_SNAP for installation
CHECKBOX_NAME=\$(basename \$CHECKBOX_SNAP)
- CHECKBOX_NAME=\$(_run_retry snap info \$CHECKBOX_NAME |grep name: | awk '{{{{ print \$2 }}}}')
+ CHECKBOX_NAME=\$(_run_retry snap info \$CHECKBOX_NAME |grep name: | awk '{{ print \$2 }}')
# Cleanup the old checkbox before starting
_run sudo snap remove \$CHECKBOX_NAME
if [ "{name}" != "tillamook-edgedirect" ]; then
@@ -135,8 +135,8 @@ cat > job.yaml <<EOF
wait_for_snap_complete
# Install extra snaps with channels specified needed for testing
- for s in \${{{{!extra_snaps_channels[@]}}}}; do
- _run_retry sudo snap install \$s --channel=\${{{{extra_snaps_channels[\$s]}}}}
+ for s in \${{!extra_snaps_channels[@]}}; do
+ _run_retry sudo snap install \$s --channel=\${{extra_snaps_channels[\$s]}}
done
# Install extra snaps needed for testing
@@ -159,7 +159,7 @@ cat > job.yaml <<EOF
_run sudo snap restart docker
fi
- SNAPLIST=\$(_run_retry snap list |awk '{{{{ print \$1 }}}}' |tail -n +2)
+ SNAPLIST=\$(_run_retry snap list |awk '{{ print \$1 }}' |tail -n +2)
if [[ "\$SNAPLIST" =~ .*"core22".* ]]; then
CORESNAP="core22"
elif [[ "\$SNAPLIST" =~ .*"core20".* ]]; then
@@ -179,7 +179,7 @@ cat > job.yaml <<EOF
[ "\$s" = "opennms-minion-pc-gadget" ] && continue
[[ "{skip_refresh_snaps}" =~ .*"\$s".* ]] && continue
# Lookup the track in snap_track_map if it exists, otherwise default is latest
- _run_retry sudo snap refresh \$s --channel=\${{{{snap_track_map[\$s]:-latest}}}}/stable
+ _run_retry sudo snap refresh \$s --channel=\${{snap_track_map[\$s]:-latest}}/stable
sleep 2
done
fi
@@ -245,14 +245,14 @@ cat > job.yaml <<EOF
# Caracalla specific interfaces
if [ "\$DEVICE" = "caracalla" ]; then
- for i in {{{{a..c}}}}; do
+ for i in {{a..c}}; do
_run sudo snap connect checkbox-plano:gpio caracalla:sku-bit-\$i
done
_run sudo snap connect checkbox-plano:gpio caracalla:cloud-led
#GPA sku only:
if [ "{name}" = "caracalla-gpa" ]; then
- for i in {{{{0..7}}}}; do
+ for i in {{0..7}}; do
_run sudo snap connect checkbox-plano:gpio caracalla:gpa-sku-gpio\$i
done
fi
@@ -270,7 +270,7 @@ cat > job.yaml <<EOF
mkdir -p artifacts
echo "Snaps currently installed:" | tee artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list >> artifacts/snaplist.txt
echo "Delaying any further automated snap refreshes during the test run"
@@ -280,7 +280,7 @@ cat > job.yaml <<EOF
_run \$CHECKBOX_NAME.checkbox-cli --help &> /dev/null
#Get \$CHECKBOX_NAME revision
- CHECKBOX_REV=\$(_run snap list \$CHECKBOX_NAME |tail -n1 |awk '{{{{print \$3}}}}')
+ CHECKBOX_REV=\$(_run snap list \$CHECKBOX_NAME |tail -n1 |awk '{{print \$3}}')
## Begin building a "complete" launcher file this should contain all
## configuration and manifests. This is the file that will be use by the
@@ -315,7 +315,7 @@ cat > job.yaml <<EOF
# Merge the launcher we downloaded with checkbox.conf
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c.read('submission_conf');c.read('device_conf');c.read('manifest_conf');c.write(open('checkbox-launcher','wt'))"
# Add the description to the launcher
- export DESCRIPTION="Testing updated snap: {snap}\nSnap version: ${{VERSION}}\nSnap revision: ${{REV}}\nSnap channel: {channel}\nJenkins URL: ${{BUILD_URL}}"
+ export DESCRIPTION="Testing updated snap: {snap}\nSnap version: $VERSION\nSnap revision: $REV\nSnap channel: {channel}\nJenkins URL: $BUILD_URL"
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c['launcher']['session_desc']='\$DESCRIPTION';c.write(open('checkbox-launcher','wt'))"
cp checkbox-launcher artifacts
@@ -327,9 +327,9 @@ cat > job.yaml <<EOF
PYTHONUNBUFFERED=1 checkbox-cli remote \$DEVICE_IP checkbox-launcher
EXITCODE=\$?
- find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} artifacts/junit.xml \;
- find /home/ubuntu/ -name 'submission_*.html' -exec mv {{{{}}}} artifacts/submission.html \;
- find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} artifacts/submission.tar.xz \;
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.html' -exec mv {{}} artifacts/submission.html \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
tar -xf artifacts/submission.tar.xz submission.json
mv submission.json artifacts
@@ -342,47 +342,47 @@ git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone
git -C hwcert-data pull -q || git clone -q git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v ${{VERSION}} -r ${{REV}} -t __track__{track} -c {channel} --cardonly /dev/null
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-if C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
echo "Found successful C3 submision link"
else
C3LINK="Failed to find C3 submission link"
fi
export C3LINK
-echo $C3LINK > c3link
+echo "$C3LINK" > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
cat artifacts/snaplist.txt >> artifacts/summary
if [ -f artifacts/submission.html ]; then
- hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} (${{REV}}) {track}/{channel}" -a artifacts/submission.html artifacts/summary
+ hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} ($REV) {track}/{channel}" -a artifacts/submission.html artifacts/summary
else
# If there was no submission html, we probably didn't complete
# Send some output from testflinger to provide some useful feedback
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
- testflinger results ${{JOB_ID}} | jq -r .test_output > test-output.txt
- hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} (${{REV}}) {track}/{channel}" -a provision-output.txt -a test-output.txt artifacts/summary
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .test_output > test-output.txt
+ hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER] {name} {snap} ($REV) {track}/{channel}" -a provision-output.txt -a test-output.txt artifacts/summary
fi
if [ -f artifacts/submission.json ]; then
cat artifacts/submission.json |jq -r '. | {{results: .results}}' > results.json
curl -s "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
-flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v ${{VERSION}} -r ${{REV}} -t __track__{track} -c {channel} artifacts/raw_summary
+flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v $VERSION -r $REV -t __track__{track} -c {channel} artifacts/raw_summary
if [ "{influx_reporting}" == "True" ]; then
pip3 install influxdb
@@ -391,5 +391,5 @@ if [ "{influx_reporting}" == "True" ]; then
fi
fi
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $EXITCODE
diff --git a/jobs/spread/run-spread.sh b/jobs/spread/run-spread.sh
index 0c1b379..566cb5a 100644
--- a/jobs/spread/run-spread.sh
+++ b/jobs/spread/run-spread.sh
@@ -22,16 +22,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=30 -o ServerAliveCountMax=3"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 10 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -43,8 +43,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- wait_for_snap_complete() {{{{
+ }}
+ wait_for_snap_complete() {{
loopcnt=0
until [ -z "\$(ssh \$SSH_OPTS {user}@\$DEVICE_IP 'sudo snap changes | grep Doing' )" ] && [ "\$(ssh \$SSH_OPTS {user}@\$DEVICE_IP echo true)" = "true" ]
do
@@ -55,8 +55,8 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
- _run_retry() {{{{
+ }}
+ _run_retry() {{
# Retry running a command if any failure occurs
loopcnt=0
_run "\$@"
@@ -72,7 +72,7 @@ cat > job.yaml <<EOF
_run "\$@"
RC="\$?"
done
- }}}}
+ }}
# Install dependencies in the host environment
@@ -85,7 +85,7 @@ cat > job.yaml <<EOF
cd snapd && curl -s -O https://storage.googleapis.com/snapd-spread-tests/spread/spread-amd64.tar.gz && tar xzvf spread-amd64.tar.gz
- DEVICE=\$(_run find /snap -name gadget.yaml -print -quit 2\> /dev/null | awk -F/ '{{{{ print \$3 }}}}')
+ DEVICE=\$(_run find /snap -name gadget.yaml -print -quit 2\> /dev/null | awk -F/ '{{ print \$3 }}')
# Wait for a valid serial assertion before starting
@@ -106,14 +106,14 @@ cat > job.yaml <<EOF
mkdir -p ../artifacts
echo "Snaps currently installed:" | tee ../artifacts/snaplist.txt
- _run snap list |tail -n +2 |awk '{{{{ print \$1" Version: "\$2"-"\$3 }}}}'
+ _run snap list |tail -n +2 |awk '{{ print \$1" Version: "\$2"-"\$3 }}'
_run snap list --unicode=never >> ../artifacts/snaplist.txt
tests/lib/external/prepare-ssh.sh \$DEVICE_IP 22 {user}
#Disable some tests
for test in {skip_tests}; do
rm -rf tests/main/\$test
done
- export SPREAD_SKIP_REMOVE_SNAPS=\$(_run snap list |tail -n +2 |awk '{{{{ printf "%s ",\$1 }}}}')
+ export SPREAD_SKIP_REMOVE_SNAPS=\$(_run snap list |tail -n +2 |awk '{{ printf "%s ",\$1 }}')
export SPREAD_EXTERNAL_ADDRESS=\$DEVICE_IP:22 && ./spread -v external:ubuntu-core-16-64:tests/main/ | tee ../artifacts/spread.output
EOF
@@ -124,27 +124,27 @@ git -C hwcert-jenkins-tools pull || (rm -rf hwcert-jenkins-tools && git clone ht
git -C hwcert-data pull || git clone git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
pip install junit-xml
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
hwcert-jenkins-tools/convert-spread-junit -j artifacts/spread.json artifacts/spread.output > artifacts/spread.xml
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
echo >> artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/spread.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
cat artifacts/snaplist.txt >> artifacts/summary
-hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER-SPREAD] {name} {snap} (${{REV}}) {track}/{channel}" -a artifacts/spread.output artifacts/summary
+hwcert-jenkins-tools/mailtool -t {email} -s "[TESTFLINGER-SPREAD] {name} {snap} ($REV) {track}/{channel}" -a artifacts/spread.output artifacts/summary
if [ -f artifacts/spread.json ]; then
curl -s "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @artifacts/spread.json
fi
-flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v ${{VERSION}} -r ${{REV}} -t __track__{track} -c {channel} artifacts/raw_summary
+flock /tmp/TRELLO-UPDATE.LOCK certification-dashboard-manager.snap-board-updater --config hwcert-data/snaps.yaml -a {arch} -b {store} -n {name} -s {snap} -v $VERSION -r $REV -t __track__{track} -c {channel} artifacts/raw_summary
exit $EXITCODE
diff --git a/jobs/spread/spread-test-template.yaml b/jobs/spread/spread-test-template.yaml
index 9684a82..bf6b7fd 100644
--- a/jobs/spread/spread-test-template.yaml
+++ b/jobs/spread/spread-test-template.yaml
@@ -78,14 +78,14 @@
TRACK="{track}"
TRACK="${{TRACK:-latest}}"
REV=$(curl -s -H "Snap-Device-Series: 16" -H "Snap-Device-Store: {store}" "{url}" | jq --arg TRACK "$TRACK" '."channel-map" | .[] | select(.channel.risk=="{channel}") |select(.channel.track==$TRACK).revision')
- if [ ! -f ${{WORKSPACE}}/revision.last ]; then
+ if [ ! -f $WORKSPACE/revision.last ]; then
echo "No last revision is known, triggering job"
- echo "$REV" > ${{WORKSPACE}}/revision.last
+ echo "$REV" > $WORKSPACE/revision.last
exit 0
fi
- REV_OLD=$(cat ${{WORKSPACE}}/revision.last)
+ REV_OLD=$(cat $WORKSPACE/revision.last)
if [ "$REV" -gt "$REV_OLD" ]; then
- echo "$REV" > ${{WORKSPACE}}/revision.last
+ echo "$REV" > $WORKSPACE/revision.last
exit 0
else
echo "No newer revision found (last=$REV_OLD), exiting"
diff --git a/jobs/sru/run-sru.sh b/jobs/sru/run-sru.sh
index fed0583..2d489c6 100644
--- a/jobs/sru/run-sru.sh
+++ b/jobs/sru/run-sru.sh
@@ -125,7 +125,7 @@ cat > job.yaml <<EOF
# Merge the launcher we downloaded with checkbox.conf
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('launcher-head');c.read('launcher-test-selection');c.read('device_conf');c.read('manifest_conf');c.write(open('checkbox-launcher','wt'))"
- export DESCRIPTION="SRU: {srutype} {series} {kernel-to-check}\nJenkins URL: ${{BUILD_URL}}"
+ export DESCRIPTION="SRU: {srutype} {series} {kernel-to-check}\nJenkins URL: $BUILD_URL"
# Add the description to the launcher
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c['launcher']['session_desc']='\$DESCRIPTION';c.write(open('checkbox-launcher','wt'))"
@@ -275,19 +275,19 @@ if [[ "{srutype}" =~ "raspi" ]] || [[ "{series}" == "impish" ]] || [[ "{series}"
fi
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-if C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
echo "Found successful C3 submision link"
else
C3LINK="Failed to find C3 submission link"
@@ -297,7 +297,7 @@ echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
@@ -306,7 +306,7 @@ if [ "{results_email}" == "True" ]; then
if [ -f artifacts/submission.html ]; then
hwcert-jenkins-tools/mailtool -t {email} -s "[{results_email_tag}] {system-id} {kernel-to-check} {series}" -a artifacts/submission.html artifacts/summary
else
- testflinger results ${{JOB_ID}} | jq -r .provision_output > provision-output.txt
+ testflinger results $JOB_ID | jq -r .provision_output > provision-output.txt
hwcert-jenkins-tools/mailtool -t {email} -s "[{results_email_tag}] {system-id} {kernel-to-check} {series}" -a provision-output.txt artifacts/summary
fi
fi
@@ -325,5 +325,5 @@ if [ "{trello_reporting}" == "True" ]; then
fi
fi
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $EXITCODE
diff --git a/jobs/upgrade-testing/run-upgrade-testing.sh b/jobs/upgrade-testing/run-upgrade-testing.sh
index 6f9d05e..8ac6e11 100644
--- a/jobs/upgrade-testing/run-upgrade-testing.sh
+++ b/jobs/upgrade-testing/run-upgrade-testing.sh
@@ -18,16 +18,16 @@ cat > job.yaml <<EOF
# convenience functions
#
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
- wait_for_ssh() {{{{
+ }}
+ wait_for_ssh() {{
loopcnt=0
until timeout 120 ssh \$SSH_OPTS {user}@\$DEVICE_IP /bin/true
do
@@ -39,7 +39,7 @@ cat > job.yaml <<EOF
fi
sleep 30
done
- }}}}
+ }}
if [ "{no_apt_cron}" == "True" ]; then
echo "no_apt_cron option is on. Block the apt cron check."
@@ -117,7 +117,7 @@ cat > job.yaml <<EOF
EOF
# Merge the base of the launcher with device_conf and manifest
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c.read('device_conf');c.read('manifest_conf');c.write(open('checkbox-launcher','wt'))"
- export DESCRIPTION="UPGRADE: {release-upgrade-target} \nJenkins URL: ${{BUILD_URL}}"
+ export DESCRIPTION="UPGRADE: {release-upgrade-target} \nJenkins URL: $BUILD_URL"
# Add the description to the launcher
python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('checkbox-launcher');c['launcher']['session_desc']='\$DESCRIPTION';c.write(open('checkbox-launcher','wt'))"
@@ -152,8 +152,8 @@ cat > job.yaml <<EOF
# find needed reports and put them into artifacts which
# will be downloaded over testflinger artifacts later
- find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} artifacts/junit.xml \;
- find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} artifacts/submission.tar.xz \;
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
tar -xf artifacts/submission.tar.xz submission.json
mv submission.json artifacts
ls artifacts
@@ -173,25 +173,25 @@ DISTRO_IMAGE=`grep distro job.yaml | awk -F : {{'print $2'}} | sed 's/^ *//g'`
echo "Testing image: $DISTRO_IMAGE"
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
cp artifacts/submission.json submission.json.previous.$DISTRO_IMAGE || /bin/true
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-export C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep certification.canonical.com)
-echo $C3LINK > c3link
+export C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep certification.canonical.com)
+echo "$C3LINK" > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/job-summary artifacts/submission.json submission.json.previous.$DISTRO_IMAGE > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
@@ -199,4 +199,4 @@ if [ -f artifacts/submission.json ]; then
cat artifacts/submission.json |jq -r '. | {{results: .results}}' > results.json
curl "https://testflinger-revcache.canonical.com/v1/results/$JOB_NAME" -X POST --header "Content-Type: application/json" --data @results.json
fi
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
diff --git a/jobs/zapper/run-zapper.sh b/jobs/zapper/run-zapper.sh
index 89b81c4..6a550bf 100644
--- a/jobs/zapper/run-zapper.sh
+++ b/jobs/zapper/run-zapper.sh
@@ -15,15 +15,15 @@ cat > job.yaml <<EOF
#!/bin/bash
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
- _put() {{{{
+ _put() {{
scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
- }}}}
- _get() {{{{
+ }}
+ _get() {{
scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
- }}}}
- _run() {{{{
+ }}
+ _run() {{
ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
- }}}}
+ }}
## Launcher file
cat <<EOF > launcher
@@ -54,9 +54,9 @@ cat > job.yaml <<EOF
# will be downloaded over testflinger-cli artifacts later
mkdir -p artifacts
- find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{{{}}}} artifacts/junit.xml \;
- find /home/ubuntu/ -name 'submission_*.html' -exec mv {{{{}}}} artifacts/submission.html \;
- find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{{{}}}} artifacts/submission.tar.xz \;
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.html' -exec mv {{}} artifacts/submission.html \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
tar -xf artifacts/submission.tar.xz submission.json
mv submission.json artifacts
echo "Files in artifacts:"
@@ -74,19 +74,19 @@ git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone
git -C hwcert-data pull -q || git clone -q git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
JOB_ID=$(testflinger submit -q job.yaml)
-echo "JOB_ID: ${{JOB_ID}}"
-echo "${{JOB_ID}}" > JOB_ID
-testflinger poll ${{JOB_ID}}
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
-TEST_STATUS=$(testflinger results ${{JOB_ID}} |jq -r .test_status)
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
rm -rf artifacts*
#retry getting the artifacts after a delay if it fails
-testflinger artifacts ${{JOB_ID}} || (sleep 30 && testflinger artifacts ${{JOB_ID}})
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
tar -xzf artifacts.tgz
set +x
-if C3LINK=$(testflinger results ${{JOB_ID}} |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
echo "Found successful C3 submission link"
else
C3LINK="Failed to find C3 submission link"
@@ -96,10 +96,10 @@ echo $C3LINK > c3link
set -x
mkdir -p artifacts
-echo Jenkins build details: ${{BUILD_URL}} > artifacts/summary
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
cat artifacts/raw_summary >> artifacts/summary
echo >> artifacts/summary
-echo "Test exit status: ${{TEST_STATUS}}"
+echo "Test exit status: $TEST_STATUS"
exit $TEST_STATUS
Follow ups