Skip to content

Commit

Permalink
fix: escape all $...
Browse files Browse the repository at this point in the history
  • Loading branch information
boukeas committed May 2, 2024
1 parent 3ce92db commit eb989a0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/actions/create-checkbox-canary-test-job/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ runs:
${{ inputs.data_source }}
test_data:
test_cmds: |
#!/bin/bash
# the machine running this script is the test controller
# it runs on any device that consumes the jobs on given queue name, for instance "202111-29636"
# the controller has a 1:1 relationship with the DUT (device under test)
# to run anything on the DUT, the controller ssh's into the DUT and runs the commands there
# and then in the end runs checkbox to run the actual testing session
# the checkbox run is a typical remote session where the machine running this script is the
# Checkbox Controller and the DUT is the Checkbox Agent
set -x
set -e
Expand All @@ -36,7 +46,7 @@ runs:
# get the tools necessary to prepare the target device for testing
git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone https://github.com/canonical/hwcert-jenkins-tools.git)
export PATH=$PATH:hwcert-jenkins-tools/scriptlets
export PATH=\$PATH:hwcert-jenkins-tools/scriptlets
# install checkbox runtime
_run_retry sudo snap install ${{ inputs.checkbox_runtime }} --no-wait --channel=latest/edge
Expand All @@ -47,8 +57,9 @@ runs:
_run_retry sudo snap install --devmode --channel=${{ inputs.checkbox_track }}/edge checkbox
echo "Installing checkbox in agent container"
CHECKBOX_VERSION=\$(_run checkbox.checkbox-cli --version)
git clone --filter=tree:0 https://github.com/canonical/checkbox.git > /dev/null
hwcert-jenkins-tools/version-published/checkout_to_version.py ~/checkbox "$CHECKBOX_VERSION"
hwcert-jenkins-tools/version-published/checkout_to_version.py ~/checkbox "\$CHECKBOX_VERSION"
(cd checkbox/checkbox-ng; sudo python3 setup.py install > /dev/null)
sudo rm -rf checkbox
Expand All @@ -69,7 +80,7 @@ runs:
LAUNCER_EOF
# run the canary test plan
PYTHONUNBUFFERED=1 checkbox-cli control $DEVICE_IP canary.launcher
EXITCODE=$?
PYTHONUNBUFFERED=1 checkbox-cli control \$DEVICE_IP canary.launcher
EXITCODE=\$?
JOB_EOF
cat job.yaml

0 comments on commit eb989a0

Please sign in to comment.