diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-07-19 16:55:47 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-07-19 16:55:47 +0200 |
commit | 2909dc3ec5fe877ffa25933ac936f4a26b9a2c2b (patch) | |
tree | e037f6bba1f9d2c5a7a4d8478c2845f3e3c91313 | |
parent | 2b1956220674c34911ce718e065bba8370c7a4ef (diff) |
units: Fix all jobs commands shellcheck errors
43 files changed, 662 insertions, 637 deletions
diff --git a/units/6lowpan/jobs.pxu b/units/6lowpan/jobs.pxu index 10fe86a..99772bf 100644 --- a/units/6lowpan/jobs.pxu +++ b/units/6lowpan/jobs.pxu @@ -4,7 +4,7 @@ id: 6lowpan/kconfig estimated_duration: 1.2 command: for config in CONFIG_6LOWPAN CONFIG_IEEE802154 CONFIG_IEEE802154_6LOWPAN CONFIG_MAC802154; do - zcat /proc/config.gz | egrep "$config=(y|m)" || exit 1 + grep -E "$config=(y|m)" /boot/config-"$(uname -r)" || exit 1 done _summary: kernel config options for 6LoWPAN _description: diff --git a/units/audio/jobs.pxu b/units/audio/jobs.pxu index 4d552d5..925f1ef 100644 --- a/units/audio/jobs.pxu +++ b/units/audio/jobs.pxu @@ -19,11 +19,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -51,11 +51,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: HDMI audio interface verification @@ -80,11 +80,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: DisplayPort audio interface verification @@ -110,11 +110,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Thunderbolt audio interface verification @@ -140,11 +140,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Thunderbolt audio interface verification @@ -171,11 +171,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: DisplayPort audio via USB Type-C port interface verification @@ -202,11 +202,11 @@ requires: package.name == 'pulseaudio-utils' flags: also-after-suspend-manual command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: HDMI audio via USB Type-C port interface verification @@ -227,11 +227,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -253,11 +253,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -280,11 +280,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -306,11 +306,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=usb --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -343,7 +343,7 @@ plugin: shell category_id: com.canonical.plainbox::audio id: audio/alsa_info_collect estimated_duration: 2.0 -command: alsa_info --no-dialog --no-upload --output ${PLAINBOX_SESSION_SHARE}/alsa_info.log +command: alsa_info --no-dialog --no-upload --output "${PLAINBOX_SESSION_SHARE}"/alsa_info.log _description: Collect audio-related system information. This data can be used to simulate this computer's audio subsystem and perform more detailed tests @@ -354,7 +354,7 @@ category_id: com.canonical.plainbox::audio id: audio/alsa_info_attachment depends: audio/alsa_info_collect estimated_duration: 1.0 -command: [ -e ${PLAINBOX_SESSION_SHARE}/alsa_info.log ] && cat ${PLAINBOX_SESSION_SHARE}/alsa_info.log +command: [ -e "${PLAINBOX_SESSION_SHARE}"/alsa_info.log ] && cat "${PLAINBOX_SESSION_SHARE}"/alsa_info.log _description: Attaches the audio hardware data collection log to the results. @@ -416,11 +416,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -486,11 +486,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 10 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -514,11 +514,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 10 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -553,11 +553,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -615,8 +615,8 @@ requires: package.name == 'alsa-base' _description: Record mixer settings after suspending 30 times. command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_after_suspend_30_cycles - diff $PLAINBOX_SESSION_SHARE/audio_settings_before_suspend $PLAINBOX_SESSION_SHARE/audio_settings_after_suspend_30_cycles + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend_30_cycles + diff "$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend "$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend_30_cycles id: audio/detect-playback-devices _summary: Check that at least one audio playback device exits @@ -627,9 +627,9 @@ imports: from com.canonical.plainbox import manifest requires: manifest.has_audio_playback == 'True' command: - COUNT=$(alsa_pcm_info.py | grep Playback | wc -l) + COUNT=$(alsa_pcm_info.py | grep -c Playback) echo "Count: $COUNT" - if [ $COUNT -eq 0 ]; then + if [ "$COUNT" -eq 0 ]; then exit 1 fi estimated_duration: 1s @@ -643,9 +643,9 @@ imports: from com.canonical.plainbox import manifest requires: manifest.has_audio_capture == 'True' command: - COUNT=$(alsa_pcm_info.py | grep Capture | wc -l) + COUNT=$(alsa_pcm_info.py | grep -c Capture) echo "Count: $COUNT" - if [ $COUNT -eq 0 ]; then + if [ "$COUNT" -eq 0 ]; then exit 1 fi esimated_duration: 1s diff --git a/units/benchmarks/jobs.pxu b/units/benchmarks/jobs.pxu index 0216ed8..fbb9131 100644 --- a/units/benchmarks/jobs.pxu +++ b/units/benchmarks/jobs.pxu @@ -36,7 +36,7 @@ plugin: shell category_id: com.canonical.plainbox::benchmarks id: benchmarks/graphics/render-bench requires: package.name == 'render-bench' -command: /usr/bin/time -f "%e Seconds" render_bench 2>&1 >/dev/null +command: /usr/bin/time -f "%e Seconds" render_bench > /dev/null 2>&1 estimated_duration: 52.000 _description: Run Render-Bench XRender/Imlib2 benchmark diff --git a/units/bluetooth/jobs.pxu b/units/bluetooth/jobs.pxu index 7f4272a..358df5e 100644 --- a/units/bluetooth/jobs.pxu +++ b/units/bluetooth/jobs.pxu @@ -43,7 +43,7 @@ command: rfkill unblock bluetooth sleep 3 fi - output=$(hcitool dev | tail -n+2 | awk '{print $2}' | tee $PLAINBOX_SESSION_SHARE/bluetooth_address) + output=$(hcitool dev | tail -n+2 | awk '{print $2}' | tee "$PLAINBOX_SESSION_SHARE"/bluetooth_address) echo "$output" if [ -z "$output" ]; then echo "BT hardware not available" @@ -98,14 +98,14 @@ id: bluetooth/audio-a2dp depends: bluetooth/detect-output estimated_duration: 120.0 command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings - idx=`pactl list cards short | awk '/bluez/{print $1}'` - bt_sink=`pactl list sinks short | awk '/bluez/{print $2}'` - pactl set-card-profile $idx a2dp - pactl set-default-sink $bt_sink + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings + idx=$(pactl list cards short | awk '/bluez/{print $1}') + bt_sink=$(pactl list sinks short | awk '/bluez/{print $2}') + pactl set-card-profile "$idx" a2dp + pactl set-default-sink "$bt_sink" gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -183,7 +183,7 @@ command: rfkill unblock bluetooth sleep 3 fi - bluetooth_transfer_stress.sh $BTDEVADDR + bluetooth_transfer_stress.sh "$BTDEVADDR" _description: This is an automated Bluetooth file transfer test. It sends a large file to the device specified by the BTDEVADDR environment variable, then @@ -237,7 +237,7 @@ id: bluetooth4/beacon_notification_{{ path }} _summary: Test system can get beacon notifications on the {{ path.split('/')[-1] }} adapter environ: ADV_SVC_UUID SVC_UUID MSRMT_UUID command: - gatt-notify-test.py {{ path.split('/')[-1] }} $ADV_SVC_UUID $SVC_UUID $MSRMT_UUID + gatt-notify-test.py {{ path.split('/')[-1] }} "$ADV_SVC_UUID" "$SVC_UUID $MSRMT_UUID" plugin: shell user: root category_id: com.canonical.plainbox::bluetooth diff --git a/units/bluetooth/resource.pxu b/units/bluetooth/resource.pxu index 24783e2..4fef56d 100644 --- a/units/bluetooth/resource.pxu +++ b/units/bluetooth/resource.pxu @@ -7,7 +7,7 @@ _description: collects a list of the provided rfcomm tests. requires: device.category == 'BLUETOOTH' command: - rfcomm-tester -l | while read i + rfcomm-tester -l | while read -r i do echo "bluez-internal-rfcomm-test: $i" echo @@ -24,7 +24,7 @@ _description: collects a list of the provided hci tests. requires: device.category == 'BLUETOOTH' command: - hci-tester -l | while read i + hci-tester -l | while read -r i do echo "bluez-internal-hci-test: $i" echo @@ -41,7 +41,7 @@ _description: collects a list of the provided mgmt tests. requires: device.category == 'BLUETOOTH' command: - mgmt-tester -l | while read i + mgmt-tester -l | while read -r i do echo "bluez-internal-mgmt-test: $i" echo @@ -58,7 +58,7 @@ _description: collects a list of the provided user channel tests. requires: device.category == 'BLUETOOTH' command: - userchan-tester -l | while read i + userchan-tester -l | while read -r i do echo "bluez-internal-uc-test: $i" echo @@ -75,7 +75,7 @@ _description: collects a list of the provided bnep tests. requires: device.category == 'BLUETOOTH' command: - bnep-tester -l | while read i + bnep-tester -l | while read -r i do echo "bluez-internal-bnep-test: $i" echo diff --git a/units/cpu/jobs.pxu b/units/cpu/jobs.pxu index 2953d16..c442bee 100644 --- a/units/cpu/jobs.pxu +++ b/units/cpu/jobs.pxu @@ -12,7 +12,7 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH=$SNAP/usr/lib/fwts:$LD_LIBRARY_PATH fi - checkbox-support-fwts_test -t cpufreq -l ${PLAINBOX_SESSION_SHARE}/scaling_test.log + checkbox-support-fwts_test -t cpufreq -l "${PLAINBOX_SESSION_SHARE}"/scaling_test.log _summary: Test the CPU scaling capabilities _description: @@ -24,7 +24,7 @@ category_id: com.canonical.plainbox::cpu id: cpu/scaling_test-log-attach estimated_duration: 1.0 depends: cpu/scaling_test -command: [[ -e ${PLAINBOX_SESSION_SHARE}/scaling_test.log ]] && cat ${PLAINBOX_SESSION_SHARE}/scaling_test.log +command: [[ -e "${PLAINBOX_SESSION_SHARE}"/scaling_test.log ]] && cat "${PLAINBOX_SESSION_SHARE}"/scaling_test.log _summary: Attach CPU scaling capabilities log _description: @@ -42,7 +42,7 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH=$SNAP/usr/lib/fwts:$LD_LIBRARY_PATH fi - checkbox-support-fwts_test -t maxfreq -l $PLAINBOX_SESSION_SHARE/maxfreq_test.log + checkbox-support-fwts_test -t maxfreq -l "$PLAINBOX_SESSION_SHARE"/maxfreq_test.log _summary: Test that the CPU can run at its max frequency _description: @@ -54,7 +54,7 @@ category_id: com.canonical.plainbox::cpu id: cpu/maxfreq_test-log-attach estimated_duration: 1.0 depends: cpu/maxfreq_test -command: [ -e $PLAINBOX_SESSION_SHARE/maxfreq_test.log ] && cat $PLAINBOX_SESSION_SHARE/maxfreq_test.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/maxfreq_test.log ] && cat "$PLAINBOX_SESSION_SHARE"/maxfreq_test.log _summary: Attach CPU max frequency log _description: @@ -151,7 +151,7 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH=$SNAP/usr/lib/fwts:$LD_LIBRARY_PATH fi - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_cstates_results.log -t cstates + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_cstates_results.log -t cstates plugin: attachment category_id: com.canonical.plainbox::cpu @@ -159,7 +159,7 @@ estimated_duration: 0.5 id: cpu/cstates_results.log after: cpu/cstates command: - [ -e ${PLAINBOX_SESSION_SHARE}/fwts_cstates_results.log ] && cat ${PLAINBOX_SESSION_SHARE}/fwts_cstates_results.log + [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_cstates_results.log ] && cat "${PLAINBOX_SESSION_SHARE}"/fwts_cstates_results.log _summary: Attach C-States test log _description: @@ -170,7 +170,7 @@ category_id: com.canonical.plainbox::cpu id: cpu/cpuinfo_before_suspend estimated_duration: 1.2 _summary: Verify that all the CPUs are online before suspending -command: cpuinfo_resource.py > $PLAINBOX_SESSION_SHARE/cpuinfo_before_suspend +command: cpuinfo_resource.py > "$PLAINBOX_SESSION_SHARE"/cpuinfo_before_suspend _siblings: [ { "id": "after-suspend-cpu/cpuinfo_after_suspend", "_summary": "Verify that all the CPUs are online after suspending", diff --git a/units/disk/jobs.pxu b/units/disk/jobs.pxu index 1df012f..8b4f943 100644 --- a/units/disk/jobs.pxu +++ b/units/disk/jobs.pxu @@ -108,7 +108,7 @@ command: if [ -n "$STRESS_NG_DISK_TIME" ] then echo "Found STRESS_NG_DISK_TIME env var, stress_ng disk running time is now: $STRESS_NG_DISK_TIME seconds" - stress_ng_test.py disk --device {name} --base-time $STRESS_NG_DISK_TIME + stress_ng_test.py disk --device {name} --base-time "$STRESS_NG_DISK_TIME" else echo "STRESS_NG_DISK_TIME env var is not found, stress_ng disk running time is default value" stress_ng_test.py disk --device {name} --base-time 240 @@ -129,18 +129,6 @@ _summary: Check of CPU load imposed by {product_slug} _description: Check to ensure CPU load of {product_slug} is not too high command: disk_cpu_load.sh {name} -plugin: shell -category_id: com.canonical.plainbox::disk -id: disk/spindown -estimated_duration: 875.0 -requires: - device.category == 'DISK' - package.name == 'smartmontools' -user: root -command: spindown.sh -_description: - Some new hard drives include a feature that parks the drive heads after a short period of inactivity. This is a power-saving feature, but it can have a bad interaction with the operating system that results in the drive constantly parked then activated. This produces excess wear on the drive, potentially leading to early failures. - plugin: user-interact category_id: com.canonical.plainbox::disk id: disk/hdd-parking diff --git a/units/dock/jobs.pxu b/units/dock/jobs.pxu index 19b5983..9570b38 100644 --- a/units/dock/jobs.pxu +++ b/units/dock/jobs.pxu @@ -245,11 +245,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock HDMI audio interface verification @@ -273,11 +273,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock DisplayPort audio interface verification @@ -300,11 +300,11 @@ _summary: HDMI audio test plugin: user-interact-verify estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock USB Type-C HDMI audio interface verification @@ -328,11 +328,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock USB Type-C Displayport audio interface verification @@ -358,11 +358,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock Thunderbolt3 audio interface verification @@ -387,11 +387,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: This test will check that headphones connector works correctly. @@ -416,11 +416,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: This test will check that recording sound using an external microphone works correctly @@ -439,7 +439,7 @@ category_id: dock-audio estimated_duration: 2.0 _summary: Collect audio-related system information depends: dock/cold-plug -command: alsa_info --no-dialog --no-upload --output ${PLAINBOX_SESSION_SHARE}/alsa_info.log +command: alsa_info --no-dialog --no-upload --output "${PLAINBOX_SESSION_SHARE}"/alsa_info.log _description: Collect audio-related system information. This data can be used to simulate this computer's audio subsystem and perform more detailed tests @@ -451,7 +451,7 @@ category_id: dock-audio depends: dock/audio-alsa-info-collect estimated_duration: 1.0 _summary: Attach audio hardware data log to results -command: [ -e ${PLAINBOX_SESSION_SHARE}/alsa_info.log ] && cat ${PLAINBOX_SESSION_SHARE}/alsa_info.log +command: [ -e "${PLAINBOX_SESSION_SHARE}"/alsa_info.log ] && cat "${PLAINBOX_SESSION_SHARE}"/alsa_info.log _description: Attaches the audio hardware data collection log to the results. @@ -484,11 +484,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Check that external line-in connection works correctly @@ -957,7 +957,7 @@ plugin: shell depends: dock/cold-plug estimated_duration: 1.0 command: - if [ "`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "state" | awk '{print $2}'`" = "discharging" ] ; then exit 1 ; fi + if [ "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "state" | awk '{print $2}')" = "discharging" ] ; then exit 1 ; fi _description: This test will make sure the laptop is being charged while connected to the dock. @@ -1101,11 +1101,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock USB Type-C Displayport audio interface verification @@ -1129,11 +1129,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock Thunderbolt3 audio interface verification @@ -1157,11 +1157,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock DisplayPort audio interface verification @@ -1185,11 +1185,11 @@ plugin: user-interact-verify flags: also-after-suspend-manual estimated_duration: 30.0 command: - audio_settings.py store --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --verbose --device=hdmi --volume=50 gst_pipeline_test.py -t 2 --device hdmi 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --verbose --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --verbose --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _purpose: Dock HDMI audio interface verification @@ -1209,7 +1209,7 @@ depends: ethernet/detect estimated_duration: 1.2 _summary: Network status before suspend _description: Record the current network before suspending. -command: set -o pipefail; gateway_ping_test | tee $PLAINBOX_SESSION_SHARE/network_before_suspend.txt +command: set -o pipefail; gateway_ping_test | tee "$PLAINBOX_SESSION_SHARE"/network_before_suspend.txt plugin: shell id: dock/audio-before-suspend @@ -1220,7 +1220,7 @@ requires: device.category == 'AUDIO' package.name == 'alsa-base' _description: Record mixer settings before suspending. -command: audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_before_suspend +command: audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend @@ -1539,11 +1539,12 @@ requires: user: root environ: WPA_BG_SSID WPA_BG_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $WPA_BG_SSID" EXIT - if create_connection.py wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$WPA_BG_SSID" --security=wpa --key="$WPA_BG_PSK"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1563,11 +1564,12 @@ requires: user: root environ: OPEN_BG_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $OPEN_BG_SSID" EXIT - if create_connection.py wifi $OPEN_BG_SSID; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$OPEN_BG_SSID"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1587,11 +1589,12 @@ requires: user: root environ: WPA_N_SSID WPA_N_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $WPA_N_SSID" EXIT - if create_connection.py wifi $WPA_N_SSID --security=wpa --key=$WPA_N_PSK; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$WPA_N_SSID" --security=wpa --key="$WPA_N_PSK"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1611,11 +1614,12 @@ requires: user: root environ: OPEN_N_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $OPEN_N_SSID" EXIT - if create_connection.py wifi $OPEN_N_SSID; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$OPEN_N_SSID"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1636,11 +1640,12 @@ requires: user: root environ: WPA_AC_SSID WPA_AC_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $WPA_AC_SSID" EXIT - if create_connection.py wifi $WPA_AC_SSID --security=wpa --key=$WPA_AC_PSK; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$WPA_AC_SSID" --security=wpa --key="$WPA_AC_PSK"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1661,11 +1666,12 @@ requires: user: root environ: OPEN_AC_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $OPEN_AC_SSID" EXIT - if create_connection.py wifi $OPEN_AC_SSID; then - INTERFACE=`nmcli dev status | awk '/802-11-wireless/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + if create_connection.py wifi "$OPEN_AC_SSID"; then + INTERFACE=$(nmcli dev status | awk '/802-11-wireless/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" else exit 1 fi @@ -1684,8 +1690,8 @@ requires: depends: dock/suspend-undock-resume dock/audio-before-suspend _description: Verify that mixer settings after suspend are the same as before suspend. command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_after_suspend - diff $PLAINBOX_SESSION_SHARE/audio_settings_before_suspend $PLAINBOX_SESSION_SHARE/audio_settings_after_suspend + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend + diff "$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend "$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend plugin: shell id: dock/record-playback-after-suspend-undock-resume diff --git a/units/ethernet/jobs.pxu b/units/ethernet/jobs.pxu index 95ae719..6ef3043 100644 --- a/units/ethernet/jobs.pxu +++ b/units/ethernet/jobs.pxu @@ -281,7 +281,7 @@ _steps: 2. Begin test. plugin: user-interact command: - if [ $(cat /sys/class/net/{{ interface }}/carrier) -ne 0 ]; then + if [ "$(cat /sys/class/net/{{ interface }}/carrier)" -ne 0 ]; then # carrier indicating cable present exit 1 fi @@ -310,13 +310,13 @@ plugin: user-interact command: LOOP=0 CABLE_DETECT=0 - while [ $LOOP -lt 10 ] && [ $CABLE_DETECT -eq 0 ] + while [ $LOOP -lt 10 ] && [ "$CABLE_DETECT" -eq 0 ] do sleep 1 CABLE_DETECT=$(cat /sys/class/net/{interface}/carrier) LOOP=$((LOOP=LOOP+1)) done - if [ $CABLE_DETECT -eq 0 ]; then + if [ "$CABLE_DETECT" -eq 0 ]; then echo "Didn't detect a cable insertion" exit 1 fi @@ -364,13 +364,13 @@ plugin: user-interact command: LOOP=0 CABLE_DETECT=1 - while [ $LOOP -lt 10 ] && [ $CABLE_DETECT -ne 0 ] + while [ $LOOP -lt 10 ] && [ "$CABLE_DETECT" -ne 0 ] do sleep 1 CABLE_DETECT=$(cat /sys/class/net/{interface}/carrier) LOOP=$((LOOP=LOOP+1)) done - if [ $CABLE_DETECT -ne 0 ]; then + if [ "$CABLE_DETECT" -ne 0 ]; then echo "Didn't detect a cable removal" exit 1 fi diff --git a/units/fingerprint/jobs.pxu b/units/fingerprint/jobs.pxu index f603f72..3dc4ecb 100644 --- a/units/fingerprint/jobs.pxu +++ b/units/fingerprint/jobs.pxu @@ -2,7 +2,7 @@ plugin: shell category_id: com.canonical.plainbox::fingerprint id: fingerprint/detect user: root -command: fprintd-list ${SUDO_UID:-$NORMAL_USER} +command: fprintd-list "${SUDO_UID:-$NORMAL_USER}" estimated_duration: 1.0 _summary: Check if at least one fingerprint reader is detected imports: from com.canonical.plainbox import manifest @@ -16,9 +16,9 @@ user: root command: set -e echo 'Removing existing signatures...' - fprintd-delete ${SUDO_UID:-$NORMAL_USER} > /dev/null + fprintd-delete "${SUDO_UID:-$NORMAL_USER}" > /dev/null sleep 3 - fprintd-enroll ${SUDO_UID:-$NORMAL_USER} + fprintd-enroll "${SUDO_UID:-$NORMAL_USER}" estimated_duration: 20.0 _summary: Enroll a fingerprint _purpose: @@ -40,7 +40,7 @@ depends: fingerprint/enroll user: root command: sleep 2 - fprintd-verify ${SUDO_UID:-$NORMAL_USER} | tee /dev/stderr | grep -o verify-no-match + fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-no-match estimated_duration: 20.0 _summary: Fingerprint negative match _purpose: @@ -64,9 +64,10 @@ command: sleep 2 for i in {1..3} do - fprintd-verify ${SUDO_UID:-$NORMAL_USER} | tee /dev/stderr | grep -o verify-match && break || sleep 3 + # shellcheck disable=SC2015 + fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-match && break || sleep 3 [[ $i -eq 3 ]] && exit 1 - echo "Attempts left: $((3-$i))" + echo "Attempts left: $((3-i))" done estimated_duration: 20.0 _summary: Fingerprint positive match @@ -119,7 +120,7 @@ category_id: com.canonical.plainbox::fingerprint id: fingerprint/delete after: fingerprint/unlock user: root -command: fprintd-delete ${SUDO_UID:-$NORMAL_USER} +command: fprintd-delete "${SUDO_UID:-$NORMAL_USER}" estimated_duration: 1.0 _summary: Remove existing fingerprint signatures imports: from com.canonical.plainbox import manifest diff --git a/units/firmware/jobs.pxu b/units/firmware/jobs.pxu index 0353fbf..05c5f04 100644 --- a/units/firmware/jobs.pxu +++ b/units/firmware/jobs.pxu @@ -6,7 +6,7 @@ id: firmware/fwts_{name} estimated_duration: 1.2 requires: executable.name == 'fwts' user: root -command: checkbox-support-fwts_test -t {name} -l $PLAINBOX_SESSION_SHARE/fwts_{name}.log +command: checkbox-support-fwts_test -t {name} -l "$PLAINBOX_SESSION_SHARE"/fwts_{name}.log _description: Run {name} test from Firmware Test Suite. _summary: Run {name} test from Firmware Test Suite. @@ -18,7 +18,7 @@ id: firmware/fwts_{name}.log estimated_duration: 1.2 requires: executable.name == 'fwts' user: root -command: [[ -e $PLAINBOX_SESSION_SHARE/fwts_{name}.log ]] && xz -c $PLAINBOX_SESSION_SHARE/fwts_{name}.log +command: [[ -e "$PLAINBOX_SESSION_SHARE"/fwts_{name}.log ]] && xz -c "$PLAINBOX_SESSION_SHARE"/fwts_{name}.log _description: Attach log for FWTS {name} test. _summary: Attach log for FWTS {name} test. @@ -33,7 +33,7 @@ _description: _summary: Run FWTS QA-concerned desktop-specific diagnosis tests. environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test --qa -l $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results.log + checkbox-support-fwts_test --qa -l "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results.log plugin:shell category_id: com.canonical.plainbox::firmware @@ -46,14 +46,14 @@ _description: _summary: Run FWTS HWE-concerned desktop-specific diagnosis tests. environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test --hwe -l $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results_hwe.log + checkbox-support-fwts_test --hwe -l "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results_hwe.log plugin: attachment category_id: com.canonical.plainbox::firmware estimated_duration: 0.5 id: firmware/fwts_desktop_diagnosis_results.log.gz command: - [ -f $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results.log ] && gzip -c $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results.log + [ -f "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results.log ] && gzip -c "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results.log _description: Attaches the FWTS desktop diagnosis results log to the submission _summary: Attach FWTS desktop diagnosis log to submission @@ -62,7 +62,7 @@ category_id: com.canonical.plainbox::firmware estimated_duration: 0.5 id: firmware/fwts_desktop_diagnosis_results_hwe.log.gz command: - [ -f $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results_hwe.log ] && gzip -c $PLAINBOX_SESSION_SHARE/fwts_desktop_diagnosis_results_hwe.log + [ -f "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results_hwe.log ] && gzip -c "$PLAINBOX_SESSION_SHARE"/fwts_desktop_diagnosis_results_hwe.log _description: Attaches the FWTS desktop diagnosis results log to the submission (to HWE) _summary: Attach FWTS desktop diagnosis log to submission (to HWE) @@ -77,13 +77,13 @@ _description: _summary: Run FWTS Server Cert selected tests. environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test --server -q -f critical -l $PLAINBOX_SESSION_SHARE/fwts_server_results.log + checkbox-support-fwts_test --server -q -f critical -l "$PLAINBOX_SESSION_SHARE"/fwts_server_results.log plugin: attachment category_id: com.canonical.plainbox::firmware estimated_duration: 0.5 id: firmware/fwts_server_results.log.gz command: - [ -f $PLAINBOX_SESSION_SHARE/fwts_server_results.log ] && gzip -c $PLAINBOX_SESSION_SHARE/fwts_server_results.log + [ -f "$PLAINBOX_SESSION_SHARE"/fwts_server_results.log ] && gzip -c "$PLAINBOX_SESSION_SHARE"/fwts_server_results.log _description: Attaches the FWTS Server Cert results log to the submission _summary: Attach FWTS Server Cert test log to submission diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu index 30da64e..b83964d 100644 --- a/units/graphics/jobs.pxu +++ b/units/graphics/jobs.pxu @@ -5,6 +5,7 @@ plugin: shell category_id: com.canonical.plainbox::graphics id: graphics/{index}_driver_version_{product_slug} command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} graphics_driver.py estimated_duration: 0.5 @@ -88,7 +89,7 @@ id: graphics/{index}_screen_resolution_{product_slug} requires: device.category == 'VIDEO' executable.name == 'qmlscene' -command: qmlscene -qt5 --transparent --fullscreen $PLAINBOX_PROVIDER_DATA/resolution_test.qml +command: qmlscene -qt5 --transparent --fullscreen "$PLAINBOX_PROVIDER_DATA"/resolution_test.qml estimated_duration: 10.0 _summary: Test default resolution for {vendor} {product} _description: @@ -108,6 +109,7 @@ id: graphics/{index}_minimum_resolution_{product_slug} requires: device.category == 'VIDEO' command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} resolution_test.py --horizontal 800 --vertical 600 estimated_duration: 0.331 @@ -127,6 +129,7 @@ requires: device.category == 'VIDEO' package.name == 'zenity' command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} maxi="$(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{{print $1}}')" now="$(python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); geo = screen.get_monitor_geometry(screen.get_primary_monitor()); print(geo.width, "x", geo.height, sep="")')" @@ -191,6 +194,7 @@ requires: package.name == 'xorg' package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} gst_pipeline_test.py -t 2 'videotestsrc ! videoconvert ! autovideosink' || gst_pipeline_test.py -t 2 'videotestsrc ! ffmpegcolorspace ! autovideosink' _summary: Test that video can be displayed with {vendor} {product} @@ -219,8 +223,9 @@ id: graphics/{index}_cycle_resolution_{product_slug} requires: package.name == 'xorg' depends: graphics/VESA_drivers_not_in_use command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} - xrandr_cycle.py --screenshot-dir $PLAINBOX_SESSION_SHARE + xrandr_cycle.py --screenshot-dir "$PLAINBOX_SESSION_SHARE" estimated_duration: 250.000 _summary: Test resolution cycling for {vendor} {product} _description: @@ -239,6 +244,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_rotation_{product_slug} depends: graphics/xorg-version command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} rotation_test.py estimated_duration: 20.000 @@ -258,7 +264,7 @@ plugin: shell category_id: com.canonical.plainbox::graphics id: graphics/{index}_gl_support_{product_slug} requires: package.name == 'nux-tools' -command: ! /usr/lib/nux/unity_support_test -p 2>&1 | ansi_parser.py | grep -e ":\(\s\+\)no$" -ie "error" +command: /usr/lib/nux/unity_support_test -p 2>&1 estimated_duration: 0.131 _description: Check that {vendor} {product} hardware is able to run a desktop session (OpenGL) _summary: Test OpenGL support for {vendor} {product} @@ -271,9 +277,9 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_valid_opengl_renderer_{product_slug} requires: executable.name == 'glxinfo' command: - renderer=`DRI_PRIME=1 glxinfo | grep "OpenGL re"` - echo $renderer - if grep -qi 'Intel' <<<$renderer; then + renderer=$(DRI_PRIME=1 glxinfo | grep "OpenGL re") + echo "$renderer" + if grep -qi 'Intel' <<<"$renderer"; then echo 'ERROR: renderer is Intel when DRI_PRIME=1' exit 1 fi @@ -286,6 +292,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_glxgears_{product_slug} requires: executable.name == 'glxgears' command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} glxgears true @@ -307,6 +314,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_glxgears_fullscreen_{product_slug} requires: executable.name == 'glxgears' command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} glxgears -fullscreen true @@ -373,7 +381,7 @@ plugin: shell category_id: com.canonical.plainbox::graphics id: graphics/{index}_screenshot_{product_slug} requires: package.name == 'fswebcam' -command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f $PLAINBOX_SESSION_SHARE/screenshot_{index}.jpg -q 2>&1 | ansi_parser.py +command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f "$PLAINBOX_SESSION_SHARE"/screenshot_{index}.jpg -q 2>&1 | ansi_parser.py _summary: Test grabbing a screenshot for {vendor} {product} _description: PURPOSE: @@ -389,7 +397,7 @@ plugin: attachment category_id: com.canonical.plainbox::graphics id: graphics/{index}_screenshot_{product_slug}.jpg depends: graphics/{index}_screenshot_{product_slug} -command: cat $PLAINBOX_SESSION_SHARE/screenshot_{index}.jpg +command: cat "$PLAINBOX_SESSION_SHARE"/screenshot_{index}.jpg _description: Attaches the screenshot captured in graphics/screenshot for the {vendor} {product} graphics card. _summary: Attach results of screenshot test for {vendor} {product} @@ -400,11 +408,11 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_screenshot_fullscreen_video_{product_slug} requires: package.name == 'fswebcam' command: - [ -f $PLAINBOX_PROVIDER_DATA/video/Ogg_Theora_Video.ogv ] || {{ echo "Video file not found"; exit 1; }} + [ -f "$PLAINBOX_PROVIDER_DATA"/video/Ogg_Theora_Video.ogv ] || {{ echo "Video file not found"; exit 1; }} gsettings set org.gnome.totem repeat true - totem --fullscreen $PLAINBOX_PROVIDER_DATA/video/Ogg_Theora_Video.ogv 2>/dev/null & + totem --fullscreen "$PLAINBOX_PROVIDER_DATA"/video/Ogg_Theora_Video.ogv 2>/dev/null & set -o pipefail - sleep 15 && camera_test.py still --device=/dev/external_webcam -f $PLAINBOX_SESSION_SHARE/screenshot_fullscreen_video_{index}.jpg -q 2>&1 | ansi_parser.py + sleep 15 && camera_test.py still --device=/dev/external_webcam -f "$PLAINBOX_SESSION_SHARE"/screenshot_fullscreen_video_{index}.jpg -q 2>&1 | ansi_parser.py sleep 5 && pkill totem gsettings set org.gnome.totem repeat false _summary: Test FSV screenshot for {vendor} {product} @@ -466,7 +474,7 @@ plugin: attachment category_id: com.canonical.plainbox::graphics id: graphics/{index}_screenshot_fullscreen_video_{product_slug}.jpg depends: graphics/{index}_screenshot_fullscreen_video_{product_slug} -command: cat $PLAINBOX_SESSION_SHARE/screenshot_fullscreen_video_{index}.jpg +command: cat "$PLAINBOX_SESSION_SHARE"/screenshot_fullscreen_video_{index}.jpg _summary: Attach results of FSV screenshot test for {vendor} {product} _description: Attaches the screenshot captured in graphics/screenshot_fullscreen_video for the {vendor} {product} graphics card @@ -476,7 +484,7 @@ id: graphics/screen-capture-internal _summary: Obtains a simple screen capture estimated_duration: 1.0 requires: package.name == 'gnome-screenshot' -command: gnome-screenshot --file ${PLAINBOX_SESSION_SHARE}/screen-capture.png +command: gnome-screenshot --file "${PLAINBOX_SESSION_SHARE}"/screen-capture.png _description: Obtains a simple screen capture using gnome-screenshot if present plugin: attachment @@ -485,7 +493,7 @@ id: screen-capture-internal.png _summary: Attaches a simple screen capture estimated_duration: 1.0 depends: graphics/screen-capture-internal -command: [ -f ${PLAINBOX_SESSION_SHARE}/screen-capture.png ] && cat ${PLAINBOX_SESSION_SHARE}/screen-capture.png +command: [ -f "${PLAINBOX_SESSION_SHARE}"/screen-capture.png ] && cat "${PLAINBOX_SESSION_SHARE}"/screen-capture.png _description: Attaches the simple screen capture file unit: template @@ -496,7 +504,7 @@ id: graphics/{index}_screen-capture-internal_{product_slug} _summary: Obtains a simple screen capture of {vendor} {product} estimated_duration: 1.0 requires: package.name == 'gnome-screenshot' -command: gnome-screenshot --file $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png +command: gnome-screenshot --file "$PLAINBOX_SESSION_SHARE"/screen-capture-{index}.png _description: Obtains a simple screen capture of {vendor} {product} using gnome-screenshot if present unit: template @@ -507,7 +515,7 @@ id: graphics/{index}_screen-capture-internal_{product_slug}.png depends: graphics/{index}_screen-capture-internal_{product_slug} _summary: Attaches a simple screen capture of {vendor} {product} estimated_duration: 1.0 -command: [ -f $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png ] && cat $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png +command: [ -f "$PLAINBOX_SESSION_SHARE"/screen-capture-{index}.png ] && cat "$PLAINBOX_SESSION_SHARE"/screen-capture-{index}.png _description: Attaches the simple screen capture file of {vendor} {product} unit: template @@ -523,7 +531,7 @@ plugin: shell user: root command: {switch_to_cmd} - pm_test.py --silent --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox reboot --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE + pm_test.py --silent --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox reboot --log-level=debug --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn preserve-locale also-after-suspend plugin: shell diff --git a/units/graphics/legacy.pxu b/units/graphics/legacy.pxu index 5f20f7b..a58e55a 100644 --- a/units/graphics/legacy.pxu +++ b/units/graphics/legacy.pxu @@ -48,7 +48,7 @@ id: graphics/screen-resolution requires: device.category == 'VIDEO' executable.name == 'qmlscene' -command: qmlscene -qt5 --transparent --fullscreen $PLAINBOX_PROVIDER_DATA/resolution_test.qml +command: qmlscene -qt5 --transparent --fullscreen "$PLAINBOX_PROVIDER_DATA"/resolution_test.qml estimated_duration: 10.0 _summary: Test default resolution _description: @@ -126,7 +126,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/cycle_resolution requires: package.name == 'xorg' depends: graphics/VESA_drivers_not_in_use -command: xrandr_cycle.py --screenshot-dir $PLAINBOX_SESSION_SHARE +command: xrandr_cycle.py --screenshot-dir "$PLAINBOX_SESSION_SHARE" estimated_duration: 250.000 _summary: Test resolution cycling _description: @@ -157,7 +157,7 @@ plugin: shell category_id: com.canonical.plainbox::graphics id: graphics/gl_support requires: package.name == 'nux-tools' -command: ! /usr/lib/nux/unity_support_test -p 2>&1 | ansi_parser.py | grep -e ":\(\s\+\)no$" -ie "error" +command: /usr/lib/nux/unity_support_test -p 2>&1 estimated_duration: 0.131 _description: Check that hardware is able to run a desktop session (OpenGL) _summary: Test OpenGL support @@ -218,7 +218,7 @@ plugin: shell category_id: com.canonical.plainbox::graphics id: graphics/screenshot requires: package.name == 'fswebcam' -command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f ${PLAINBOX_SESSION_SHARE}/screenshot.jpg -q 2>&1 | ansi_parser.py +command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f "${PLAINBOX_SESSION_SHARE}"/screenshot.jpg -q 2>&1 | ansi_parser.py _summary: Test grabbing a screenshot _description: PURPOSE: @@ -232,7 +232,7 @@ plugin: attachment category_id: com.canonical.plainbox::graphics id: screenshot.jpg depends: graphics/screenshot -command: cat ${PLAINBOX_SESSION_SHARE}/screenshot.jpg +command: cat "${PLAINBOX_SESSION_SHARE}"/screenshot.jpg _description: Attaches the screenshot captured in graphics/screenshot. _summary: Attach results of screenshot test @@ -241,11 +241,11 @@ category_id: com.canonical.plainbox::graphics id: graphics/screenshot_fullscreen_video requires: package.name == 'fswebcam' command: - [ -f ${PLAINBOX_PROVIDER_DATA}/video/Ogg_Theora_Video.ogv ] || { echo "Video file not found"; exit 1; } + [ -f "${PLAINBOX_PROVIDER_DATA}"/video/Ogg_Theora_Video.ogv ] || { echo "Video file not found"; exit 1; } gsettings set org.gnome.totem repeat true - totem --fullscreen ${PLAINBOX_PROVIDER_DATA}/video/Ogg_Theora_Video.ogv 2>/dev/null & + totem --fullscreen "${PLAINBOX_PROVIDER_DATA}"/video/Ogg_Theora_Video.ogv 2>/dev/null & set -o pipefail - sleep 15 && camera_test.py still --device=/dev/external_webcam -f ${PLAINBOX_SESSION_SHARE}/screenshot_fullscreen_video.jpg -q 2>&1 | ansi_parser.py + sleep 15 && camera_test.py still --device=/dev/external_webcam -f "${PLAINBOX_SESSION_SHARE}"/screenshot_fullscreen_video.jpg -q 2>&1 | ansi_parser.py sleep 5 && totem --quit 2>/dev/null gsettings set org.gnome.totem repeat false _summary: Test FSV screenshot @@ -262,6 +262,6 @@ plugin: attachment category_id: com.canonical.plainbox::graphics id: screenshot_fullscreen_video.jpg depends: graphics/screenshot_fullscreen_video -command: cat ${PLAINBOX_SESSION_SHARE}/screenshot_fullscreen_video.jpg +command: cat "${PLAINBOX_SESSION_SHARE}"/screenshot_fullscreen_video.jpg _description: Attaches the screenshot captured in graphics/screenshot_fullscreen_video. _summary: Attach results of FSV screenshot test diff --git a/units/hibernate/jobs.pxu b/units/hibernate/jobs.pxu index dc88366..e945143 100644 --- a/units/hibernate/jobs.pxu +++ b/units/hibernate/jobs.pxu @@ -9,7 +9,7 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 else echo "Calling sleep_test.py" sleep_test.py -s disk -w 120 @@ -34,7 +34,7 @@ requires: rtc.state == 'supported' environ: PLAINBOX_SESSION_SHARE user: root -command: checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 +command: checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 estimated_duration: 300.00 _description: This is the automated version of suspend/hibernate_advanced. @@ -54,7 +54,7 @@ estimated_duration: 300.00 command: if type -P fwts >/dev/null; then echo "Calling fwts" - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/{index}_hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/{index}_hibernate-single -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 else echo "Calling sleep_test.py" sleep_test.py -s disk -w 120 @@ -72,7 +72,7 @@ _verification: plugin: shell category_id: com.canonical.plainbox::hibernate id: power-management/hibernate-single-log-check -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate-single.log ] && sleep_test_log_check.py -v s4 $PLAINBOX_SESSION_SHARE/hibernate-single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate-single.log ] && sleep_test_log_check.py -v s4 "$PLAINBOX_SESSION_SHARE"/hibernate-single.log _description: Automated check of the hibernate log for errors discovered by fwts @@ -80,7 +80,7 @@ plugin: attachment category_id: com.canonical.plainbox::hibernate id: power-management/hibernate-single-log-attach depends: power-management/hibernate_advanced -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate-single.log ] && cat $PLAINBOX_SESSION_SHARE/hibernate-single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate-single.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate-single.log estimated_duration: 0.5 _description: attaches log from single hibernate/resume test to results @@ -92,6 +92,6 @@ category_id: com.canonical.plainbox::hibernate id: power-management/{index}_hibernate-single-log-attach_{product_slug} depends: power-management/{index}_hibernate_advanced_{vendor_slug}_{product_slug} estimated_duration: 0.5 -command: [ -e $PLAINBOX_SESSION_SHARE/{index}_hibernate-single.log ] && cat $PLAINBOX_SESSION_SHARE/{index}_hibernate-single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{index}_hibernate-single.log ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_hibernate-single.log _description: attaches log from single hibernate/resume test to results diff --git a/units/i2c/jobs.pxu b/units/i2c/jobs.pxu index a928917..bf692b4 100644 --- a/units/i2c/jobs.pxu +++ b/units/i2c/jobs.pxu @@ -18,7 +18,7 @@ command: if [ -z ${I2C_BUS_NUMBER+x} ]; then i2c_driver_test.py bus else - i2c_driver_test.py bus -b $I2C_BUS_NUMBER + i2c_driver_test.py bus -b "$I2C_BUS_NUMBER" fi user: root plugin: shell diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index 1e48eee..5fe06dc 100644 --- a/units/info/jobs.pxu +++ b/units/info/jobs.pxu @@ -19,7 +19,7 @@ category_id: com.canonical.plainbox::info user: root command: if [ -e /var/log/dmesg ]; then - cat /var/log/dmesg | ansi_parser.py + ansi_parser.py < /var/log/dmesg else dmesg | ansi_parser.py fi @@ -30,7 +30,9 @@ _summary: Attach a copy of dmesg id: dmi_attachment plugin: attachment category_id: com.canonical.plainbox::info -command: [ -d /sys/class/dmi/id/ ] && (grep -r . /sys/class/dmi/id/ 2>/dev/null || true) || false +command: + # shellcheck disable=SC2015 + [ -d /sys/class/dmi/id/ ] && (grep -r . /sys/class/dmi/id/ 2>/dev/null || true) || false estimated_duration: 0.044 _description: Attaches info on DMI _summary: Attach a copy of /sys/class/dmi/id/* @@ -62,7 +64,9 @@ id: efi_attachment plugin: attachment category_id: com.canonical.plainbox::info user: root -command: [ -d /sys/firmware/efi ] && grep -m 1 -o --color=never 'EFI v.*' /var/log/kern.log* || true +command: + # shellcheck disable=SC2015 + [ -d /sys/firmware/efi ] && grep -m 1 -o --color=never 'EFI v.*' /var/log/kern.log* || true estimated_duration: 0.5 _summary: Attaches firmware version info _description: Attaches the firmware version @@ -72,7 +76,7 @@ plugin: attachment category_id: com.canonical.plainbox::info command: if [[ -v SNAP ]]; then - lspci -i $SNAP/usr/share/misc/pci.ids -vvnn + lspci -i "$SNAP"/usr/share/misc/pci.ids -vvnn else lspci -vvnn | iconv -t 'utf-8' -c fi @@ -103,7 +107,7 @@ category_id: com.canonical.plainbox::info user: root command: if [[ -v SNAP ]]; then - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids else lsusb -vv | iconv -t 'utf-8' -c fi @@ -123,7 +127,7 @@ _description: Attaches info on system memory as seen in /proc/meminfo. id: modprobe_attachment plugin: attachment category_id: com.canonical.plainbox::info -command: find /etc/modprobe.* -name \*.conf | xargs cat +command: find /etc/modprobe.* -name \*.conf -exec cat {} + estimated_duration: 0.015 _description: Attaches the contents of the various modprobe conf files. _summary: Attach the contents of /etc/modprobe.* @@ -136,7 +140,7 @@ command: for mod in $(lsmod | cut -f 1 -d " ") do printf "%-16s%s\n" "name:" "$mod" - modinfo $mod + modinfo "$mod" echo done estimated_duration: 1.5 @@ -153,7 +157,7 @@ _summary: Attach the contents of /etc/modules id: sysctl_attachment plugin: attachment category_id: com.canonical.plainbox::info -command: find /etc/sysctl.* -name \*.conf | xargs cat +command: find /etc/sysctl.* -name \*.conf -exec cat {} + estimated_duration: 0.014 _description: Attaches the contents of various sysctl config files. _summary: Attach sysctl configuration files. @@ -163,9 +167,9 @@ plugin: attachment category_id: com.canonical.plainbox::info _description: Attaches a report of sysfs attributes. command: - for i in `udevadm info --export-db | sed -n 's/^P: //p'`; do + for i in $(udevadm info --export-db | sed -n 's/^P: //p'); do echo "P: $i" - udevadm info --attribute-walk --path=/sys$i 2>/dev/null | sed -n 's/ ATTR{\(.*\)}=="\(.*\)"/A: \1=\2/p' + udevadm info --attribute-walk --path=/sys"$i" 2>/dev/null | sed -n 's/ ATTR{\(.*\)}=="\(.*\)"/A: \1=\2/p' echo done estimated_duration: 6.344 @@ -237,7 +241,8 @@ requires: package.name == 'bootchart' or package.name == 'pybootchartgui' user: root command: process_wait.py -u root bootchart collector ureadahead; \ - [ `ls /var/log/bootchart/*.tgz 2>/dev/null | wc -l` -lt 2 ] && reboot && sleep 100 + # shellcheck disable=SC2012 + [ "$(ls /var/log/bootchart/*.tgz 2>/dev/null | wc -l)" -lt 2 ] && reboot && sleep 100 unit: template template-resource: device @@ -260,7 +265,8 @@ depends: info/bootchart requires: package.name == 'pybootchartgui' _description: Attaches the bootchart png file for bootchart runs command: - file=`ls /var/log/bootchart/*.png 2>/dev/null | tail -1`; \ + # shellcheck disable=SC2012 + file=$(ls /var/log/bootchart/*.png 2>/dev/null | tail -1); \ [ -e "$file" ] && cat "$file" plugin: attachment @@ -269,7 +275,8 @@ id: bootchart.tgz depends: info/bootchart _description: Attaches the bootchart log for bootchart test runs. command: - file=`ls /var/log/bootchart/*.tgz 2>/dev/null | tail -1`; \ + # shellcheck disable=SC2012 + file=$(ls /var/log/bootchart/*.tgz 2>/dev/null | tail -1); \ [ -e "$file" ] && cat "$file" plugin: attachment @@ -415,7 +422,7 @@ _summary: _description: Attaches the debug log from the virtualization/kvm_check_vm test to the results submission. -command: [ -f $PLAINBOX_SESSION_SHARE/virt_debug ] && cat $PLAINBOX_SESSION_SHARE/virt_debug +command: [ -f "$PLAINBOX_SESSION_SHARE"/virt_debug ] && cat "$PLAINBOX_SESSION_SHARE"/virt_debug id: kernel_cmdline_attachment plugin: attachment @@ -449,7 +456,7 @@ requires: package.name == 'hwloc' or executable.name == 'lstopo' _description: Attaches the system topology as presented by the lstopo command _summary: Attach the output of lstopo command: - lstopo $PLAINBOX_SESSION_SHARE/lstopo_visual.png; \ + lstopo "$PLAINBOX_SESSION_SHARE"/lstopo_visual.png; \ [ -e "$PLAINBOX_SESSION_SHARE/lstopo_visual.png" ] && \ cat "$PLAINBOX_SESSION_SHARE/lstopo_visual.png" @@ -465,9 +472,9 @@ plugin: attachment category_id: com.canonical.plainbox::info command: # some top-level snaps don't bother with parts - cat $SNAP/parts_meta_info || true + cat "$SNAP"/parts_meta_info || true # should always have parts info from content snap - cat $CHECKBOX_RUNTIME/parts_meta_info + cat "$CHECKBOX_RUNTIME"/parts_meta_info environ: SNAP estimated_duration: 0.02 _summary: Attaches an information about all parts that constituted this snap diff --git a/units/keys/jobs.pxu b/units/keys/jobs.pxu index 6eec1d4..8cef3e7 100644 --- a/units/keys/jobs.pxu +++ b/units/keys/jobs.pxu @@ -229,11 +229,11 @@ requires: package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' flags: also-after-suspend-manual command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: diff --git a/units/memory/jobs.pxu b/units/memory/jobs.pxu index a44975e..06b2570 100644 --- a/units/memory/jobs.pxu +++ b/units/memory/jobs.pxu @@ -31,7 +31,7 @@ category_id: com.canonical.plainbox::memory id: memory/meminfo_before_suspend estimated_duration: 1.2 _summary: Store memory info before suspending -command: meminfo_resource.py > $PLAINBOX_SESSION_SHARE/meminfo_before_suspend +command: meminfo_resource.py > "$PLAINBOX_SESSION_SHARE"/meminfo_before_suspend _siblings: [ { "id": "after-suspend-memory/meminfo_after_suspend", "_summary": "Compare memory info to the state prior to suspend", diff --git a/units/miscellanea/jobs.pxu b/units/miscellanea/jobs.pxu index e5d6965..3fd3fef 100644 --- a/units/miscellanea/jobs.pxu +++ b/units/miscellanea/jobs.pxu @@ -75,14 +75,14 @@ _description: Run Firmware Test Suite (fwts) automated tests. environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_results.log + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_results.log plugin: attachment category_id: com.canonical.plainbox::miscellanea id: miscellanea/fwts_results.log requires: executable.name == 'fwts' command: - [[ -e ${PLAINBOX_SESSION_SHARE}/fwts_results.log ]] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_results.log + [[ -e "${PLAINBOX_SESSION_SHARE}"/fwts_results.log ]] && xz -c "${PLAINBOX_SESSION_SHARE}"/fwts_results.log _description: Attaches the miscellanes/fwts_test results log to the submission. plugin: attachment @@ -91,7 +91,7 @@ estimated_duration: 0.5 id: miscellanea/fwts_results_hwe.log.gz requires: executable.name == 'fwts' command: - [ -f $PLAINBOX_SESSION_SHARE/fwts_results_hwe.log ] && gzip -c $PLAINBOX_SESSION_SHARE/fwts_results_hwe.log + [ -f "$PLAINBOX_SESSION_SHARE"/fwts_results_hwe.log ] && gzip -c "$PLAINBOX_SESSION_SHARE"/fwts_results_hwe.log _description: Attaches the FWTS results log to the submission (to HWE) _summary: Attach FWTS log to submission (to HWE) @@ -264,14 +264,14 @@ plugin: shell category_id: com.canonical.plainbox::miscellanea id: miscellanea/apport-directory requires: package.name == 'apport' -command: if [ -d /var/crash ]; then if [ $(find /var/crash -type f | grep -v .lock | wc -l) -eq 0 ]; then echo "/var/crash is empty"; else echo `ls /var/crash`; false; fi; else echo "/var/crash does not exist"; fi +command: if [ -d /var/crash ]; then if [ "$(find /var/crash -type f | grep -c -v .lock)" -eq 0 ]; then echo "/var/crash is empty"; else ls /var/crash; false; fi; else echo "/var/crash does not exist"; fi _description: Test that the /var/crash directory doesn't contain anything. Lists the files contained within if it does, or echoes the status of the directory (doesn't exist/is empty) plugin: shell category_id: com.canonical.plainbox::miscellanea id: miscellanea/sources-list -command: sources_test.sh $SOURCES_LIST "$REPOSITORIES" +command: sources_test.sh "$SOURCES_LIST" "$REPOSITORIES" _description: Checks that a specified sources list file contains the requested repositories unit: template @@ -334,14 +334,14 @@ _summary: Run FWTS OOPs check environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_oops_results.log -t oops + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_oops_results.log -t oops plugin: attachment category_id: com.canonical.plainbox::miscellanea estimated_duration: 0.5 id: miscellanea/oops_results.log command: - [ -e ${PLAINBOX_SESSION_SHARE}/fwts_oops_results.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_oops_results.log + [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_oops_results.log ] && xz -c "${PLAINBOX_SESSION_SHARE}"/fwts_oops_results.log _description: Attaches the FWTS oops results log to the submission plugin:shell @@ -358,14 +358,14 @@ _summary: Run FWTS OLOG check on ppc64el environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_olog_results.log -t olog + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_olog_results.log -t olog plugin: attachment category_id: com.canonical.plainbox::miscellanea estimated_duration: 0.5 id: miscellanea/olog_results.log command: - [ -e ${PLAINBOX_SESSION_SHARE}/fwts_olog_results.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_olog_results.log + [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_olog_results.log ] && xz -c "${PLAINBOX_SESSION_SHARE}"/fwts_olog_results.log _description: Attaches the FWTS olog results log to the submission plugin:shell @@ -380,14 +380,14 @@ _summary: Run FWTS Kernel Log check environ: PLAINBOX_SESSION_SHARE command: - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_klog_results.log -t oops + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_klog_results.log -t oops plugin: attachment category_id: com.canonical.plainbox::miscellanea estimated_duration: 0.5 id: miscellanea/klog_results.log command: - [ -e ${PLAINBOX_SESSION_SHARE}/fwts_klog_results.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_klog_results.log + [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_klog_results.log ] && xz -c "${PLAINBOX_SESSION_SHARE}"/fwts_klog_results.log _description: Attaches the FWTS klog results log to the submission plugin: shell @@ -429,7 +429,7 @@ estimated_duration: 20.0 id: miscellanea/sosreport user: root requires: executable.name == 'sosreport' -command: sosreport --batch -n lxd --tmp-dir $PLAINBOX_SESSION_SHARE +command: sosreport --batch -n lxd --tmp-dir "$PLAINBOX_SESSION_SHARE" _summary: Generate baseline sosreport _description: Generates a baseline sosreport of logs and system data @@ -440,7 +440,8 @@ id: miscellanea/sosreport_attachment depends: miscellanea/sosreport user: root command: - SOSFILE=`ls -t $PLAINBOX_SESSION_SHARE/sosreport*xz | head -1`; [ -e ${SOSFILE} ] && cat $SOSFILE + # shellcheck disable=SC2012 + SOSFILE=$(ls -t "$PLAINBOX_SESSION_SHARE"/sosreport*xz | head -1); [ -e "${SOSFILE}" ] && cat "$SOSFILE" _summary: Attach the baseline sosreport file plugin: shell diff --git a/units/mobilebroadband/jobs.pxu b/units/mobilebroadband/jobs.pxu index c7a2ab5..b5ae39c 100644 --- a/units/mobilebroadband/jobs.pxu +++ b/units/mobilebroadband/jobs.pxu @@ -10,20 +10,21 @@ user: root environ: GSM_CONN_NAME GSM_APN GSM_USERNAME GSM_PASSWORD command: if [ -n "${GSM_APN}" ]; then + # shellcheck disable=SC2064 trap "nmcli con delete id $GSM_CONN_NAME" EXIT create_connection.py mobilebroadband gsm \ - `[ -n "${GSM_APN}" ] && echo "--apn=$GSM_APN"` \ - `[ -n "${GSM_CONN_NAME}" ] && echo "--name=$GSM_CONN_NAME"` \ - `[ -n "${GSM_USERNAME}" ] && echo "--username=$GSM_USERNAME"` \ - `[ -n "${GSM_PASSWORD}" ] && echo "--password=$GSM_PASSWORD"` || exit 1 + "$([ -n "${GSM_APN}" ] && echo "--apn=$GSM_APN")" \ + "$([ -n "${GSM_CONN_NAME}" ] && echo "--name=$GSM_CONN_NAME")" \ + "$([ -n "${GSM_USERNAME}" ] && echo "--username=$GSM_USERNAME")" \ + "$([ -n "${GSM_PASSWORD}" ] && echo "--password=$GSM_PASSWORD")" || exit 1 fi - INTERFACE=`(nmcli -f GENERAL -t dev list 2>/dev/null || nmcli -f GENERAL -t dev show) | tr '\n' ' ' | grep -oP 'TYPE:\Kgsm.*' | sed 's/GENERAL.TYPE:.*//' | grep -oP 'GENERAL.IP-IFACE:\K\S*'` + INTERFACE=$( (nmcli -f GENERAL -t dev list 2>/dev/null || nmcli -f GENERAL -t dev show) | tr '\n' ' ' | grep -oP 'TYPE:\Kgsm.*' | sed 's/GENERAL.TYPE:.*//' | grep -oP 'GENERAL.IP-IFACE:\K\S*') echo "connected GSM interface seems to be $INTERFACE" - [ -z $INTERFACE ] && exit 1 - curl http://start.ubuntu.com/connectivity-check.html --interface $INTERFACE + [ -z "$INTERFACE" ] && exit 1 + curl http://start.ubuntu.com/connectivity-check.html --interface "$INTERFACE" EXIT_CODE=$? - if [ -n "${GSM_APN}" ] && [ "`nmcli dev status | awk '/gsm/ {print $3}'`" == "connected" ]; then - nmcli con down id `[ ${GSM_CONN_NAME} ] && echo "$GSM_CONN_NAME" || echo "MobileBB"` + if [ -n "${GSM_APN}" ] && [ "$(nmcli dev status | awk '/gsm/ {print $3}')" == "connected" ]; then + nmcli con down id "$([ "${GSM_CONN_NAME}" ] && echo "$GSM_CONN_NAME" || echo "MobileBB")" fi exit $EXIT_CODE _description: Creates a mobile broadband connection for a GSM based modem and checks the connection to ensure it's working. @@ -40,19 +41,20 @@ user: root environ: CDMA_CONN_NAME CDMA_USERNAME CDMA_PASSWORD command: if [ -n "${CDMA_USERNAME}" ]; then + # shellcheck disable=SC2064 trap "nmcli con delete id $CDMA_CONN_NAME" EXIT create_connection.py mobilebroadband cdma \ - `[ -n "${CDMA_CONN_NAME}" ] && echo "--name=$CDMA_CONN_NAME"` \ - `[ -n "${CDMA_USERNAME}" ] && echo "--username=$CDMA_USERNAME"` \ - `[ -n "${CDMA_PASSWORD}" ] && echo "--password=$CDMA_PASSWORD"` || exit 1 + "$([ -n "${CDMA_CONN_NAME}" ] && echo "--name=$CDMA_CONN_NAME")" \ + "$([ -n "${CDMA_USERNAME}" ] && echo "--username=$CDMA_USERNAME")" \ + "$([ -n "${CDMA_PASSWORD}" ] && echo "--password=$CDMA_PASSWORD")" || exit 1 fi - INTERFACE=`(nmcli -f GENERAL -t dev list 2>/dev/null || nmcli -f GENERAL -t dev show) | tr '\n' ' ' | grep -oP 'TYPE:\Kcdma.*' | sed 's/GENERAL.TYPE:.*//' | grep -oP 'GENERAL.IP-IFACE:\K\S*'` + INTERFACE=$( (nmcli -f GENERAL -t dev list 2>/dev/null || nmcli -f GENERAL -t dev show) | tr '\n' ' ' | grep -oP 'TYPE:\Kcdma.*' | sed 's/GENERAL.TYPE:.*//' | grep -oP 'GENERAL.IP-IFACE:\K\S*') echo "connected CDMA interface seems to be $INTERFACE" - [ -z $INTERFACE ] && exit 1 - curl http://start.ubuntu.com/connectivity-check.html --interface $INTERFACE + [ -z "$INTERFACE" ] && exit 1 + curl http://start.ubuntu.com/connectivity-check.html --interface "$INTERFACE" EXIT_CODE=$? - if [ -n "${CDMA_USERNAME}" ] && [ "`nmcli dev status | awk '/cdma/ {print $3}'`" == "connected" ]; then - nmcli con down id `[ ${CDMA_CONN_NAME} ] && echo "$CDMA_CONN_NAME" || echo "MobileBB"` + if [ -n "${CDMA_USERNAME}" ] && [ "$(nmcli dev status | awk '/cdma/ {print $3}')" == "connected" ]; then + nmcli con down id "$([ "${CDMA_CONN_NAME}" ] && echo "$CDMA_CONN_NAME" || echo "MobileBB")" fi exit $EXIT_CODE _description: Creates a mobile broadband connection for a CDMA based modem and checks the connection to ensure it's working. diff --git a/units/monitor/jobs.pxu b/units/monitor/jobs.pxu index 647dc09..0ec67d3 100644 --- a/units/monitor/jobs.pxu +++ b/units/monitor/jobs.pxu @@ -406,7 +406,7 @@ _description: Use chamleon board to simulate connection/disconnection of an HDMI monitor. environ: HDMI_PORT CHAMELEON_IP command: - chameleon_hdmi_hotplug.py $HDMI_PORT $CHAMELEON_IP + chameleon_hdmi_hotplug.py "$HDMI_PORT" "$CHAMELEON_IP" id: monitor/edid-stress-automated estimated_duration: 30m @@ -415,4 +415,4 @@ category_id: com.canonical.plainbox::monitor _summary: Stress DUT by switching through large EDID set environ: HDMI_PORT CHAMELEON_IP command: - chameleon_edid_stress.py $HDMI_PORT $CHAMELEON_IP + chameleon_edid_stress.py "$HDMI_PORT" "$CHAMELEON_IP" diff --git a/units/networking/ipv6.pxu b/units/networking/ipv6.pxu index 1cdcbdf..69c3ba1 100644 --- a/units/networking/ipv6.pxu +++ b/units/networking/ipv6.pxu @@ -22,5 +22,5 @@ _summary: Test that {interface} has an IPv6 link local address plugin: shell category_id: com.canonical.plainbox::networking command: - [ $(ip -6 -o addr show dev {interface} scope link | wc -l) -eq 1 ] + [ "$(ip -6 -o addr show dev {interface} scope link | wc -l)" -eq 1 ] flags: also-after-suspend diff --git a/units/networking/jobs.pxu b/units/networking/jobs.pxu index b5a6805..bd886fe 100644 --- a/units/networking/jobs.pxu +++ b/units/networking/jobs.pxu @@ -45,14 +45,14 @@ _description: plugin: shell category_id: com.canonical.plainbox::networking id: networking/ping -command: gateway_ping_test $CHECKBOX_SERVER +command: gateway_ping_test "$CHECKBOX_SERVER" _description: Automated test case to verify availability of some system on the network using ICMP ECHO packets. plugin: shell category_id: com.canonical.plainbox::networking id: networking/http -command: wget -SO /dev/null http://$TRANSFER_SERVER +command: wget -SO /dev/null http://"$TRANSFER_SERVER" _description: Automated test case to make sure that it's possible to download files through HTTP @@ -68,14 +68,14 @@ plugin: shell category_id: com.canonical.plainbox::networking id: networking/ssh requires: package.name == 'openssh-client' -command: if [ $CHECKBOX_SERVER ]; then ssh -q -o 'StrictHostKeyChecking=no' -o "UserKnownHostsFile=/tmp/ssh_test_$$" -l ubuntu $CHECKBOX_SERVER "uname -a" && rm /tmp/ssh_test_$$; fi +command: if [ "$CHECKBOX_SERVER" ]; then ssh -q -o 'StrictHostKeyChecking=no' -o "UserKnownHostsFile=/tmp/ssh_test_$$" -l ubuntu "$CHECKBOX_SERVER" "uname -a" && rm /tmp/ssh_test_$$; fi _description: Verify that an installation of checkbox-server on the network can be reached over SSH. plugin: shell category_id: com.canonical.plainbox::networking id: networking/printer requires: package.name == 'cups-client' -command: network_printer_test.sh -s $CHECKBOX_SERVER +command: network_printer_test.sh -s "$CHECKBOX_SERVER" _description: Try to enable a remote printer on the network and print a test page. plugin: shell diff --git a/units/pig/jobs.pxu b/units/pig/jobs.pxu index 2bbcaa6..b3702ab 100644 --- a/units/pig/jobs.pxu +++ b/units/pig/jobs.pxu @@ -5,4 +5,4 @@ estimated_duration: 60 _summary: Check if the system automatically changes the resolution based on EDID requires: pig.hdmi_bridge == 'installed' environ: PIG_HOST -command: edid_cycle.py $PIG_HOST +command: edid_cycle.py "$PIG_HOST" diff --git a/units/pig/resource.pxu b/units/pig/resource.pxu index eb62e22..81b9d19 100644 --- a/units/pig/resource.pxu +++ b/units/pig/resource.pxu @@ -2,4 +2,4 @@ id: pig plugin: resource _summary: Get Pig's capabilities environ: PIG_HOST -command: ssh -q -o 'StrictHostKeyChecking=no' $PIG_HOST /snap/bin/pigbox capabilities +command: ssh -q -o 'StrictHostKeyChecking=no' "$PIG_HOST" /snap/bin/pigbox capabilities diff --git a/units/power-management/jobs.pxu b/units/power-management/jobs.pxu index 76fd6db..58aae2a 100644 --- a/units/power-management/jobs.pxu +++ b/units/power-management/jobs.pxu @@ -20,7 +20,7 @@ estimated_duration: 25.0 user: root _description: Test ACPI Wakealarm (fwts wakealarm) requires: executable.name == 'fwts' -command: checkbox-support-fwts_test -f aborted -t wakealarm -l $PLAINBOX_SESSION_SHARE/fwts-wakealarm.log +command: checkbox-support-fwts_test -f aborted -t wakealarm -l "$PLAINBOX_SESSION_SHARE"/fwts-wakealarm.log plugin: attachment category_id: com.canonical.plainbox::power-management @@ -28,7 +28,7 @@ id: power-management/fwts_wakealarm-log-attach depends: power-management/fwts_wakealarm estimated_duration: 2.0 _description: Attach log from fwts wakealarm test -command: [ -e ${PLAINBOX_SESSION_SHARE}/fwts-wakealarm.log ] && cat ${PLAINBOX_SESSION_SHARE}/fwts-wakealarm.log +command: [ -e "${PLAINBOX_SESSION_SHARE}"/fwts-wakealarm.log ] && cat "${PLAINBOX_SESSION_SHARE}"/fwts-wakealarm.log plugin: shell category_id: com.canonical.plainbox::power-management @@ -38,7 +38,7 @@ depends: power-management/fwts_wakealarm user: root environ: PLAINBOX_SESSION_SHARE PM_TEST_DRY_RUN requires: executable.name == 'fwts' -command: pm_test.py --silent --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox poweroff --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE +command: pm_test.py --silent --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox poweroff --log-level=debug --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn _description: This test will check the system's ability to power-off and boot. @@ -49,7 +49,7 @@ id: power-management/poweroff-log-attach estimated_duration: 1.0 command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*poweroff.1.log + cat "$PLAINBOX_SESSION_SHARE"/*poweroff.1.log _description: This will attach any logs from the power-management/poweroff test to the results. @@ -60,7 +60,7 @@ estimated_duration: 120.0 user: root environ: PLAINBOX_SESSION_SHARE PM_TEST_DRY_RUN requires: executable.name == 'fwts' -command: pm_test.py --silent --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox reboot --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE +command: pm_test.py --silent --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox reboot --log-level=debug --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn _description: This test will check the system's ability to reboot cleanly. @@ -71,7 +71,7 @@ id: power-management/reboot-log-attach estimated_duration: 1.0 command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*reboot.1.log + cat "$PLAINBOX_SESSION_SHARE"/*reboot.1.log _description: This will attach any logs from the power-management/reboot test to the results. @@ -94,8 +94,10 @@ id: power-management/lid_close estimated_duration: 60.0 requires: device.product == 'Lid Switch' command: - for i in `seq 20`; do - state=`cat /proc/acpi/button/lid/*/state | awk '{print $2}'` + # shellcheck disable=SC2034 + for i in {1..20}; do + state=$(cat /proc/acpi/button/lid/*/state | awk '{print $2}') + # shellcheck disable=SC2015 [ "$state" = "closed" ] && exit 0 || sleep 0.5 done exit 1 @@ -113,9 +115,11 @@ category_id: com.canonical.plainbox::power-management id: power-management/lid_open estimated_duration: 60.0 requires: device.product == 'Lid Switch' -command: - for i in `seq 20`; do - state=`cat /proc/acpi/button/lid/*/state | awk '{print $2}'` +command:. + # shellcheck disable=SC2034 + for i in {1..20}; do + state=$(cat /proc/acpi/button/lid/*/state | awk '{print $2}') + # shellcheck disable=SC2015 [ "$state" = "open" ] && exit 0 || sleep 0.5 done exit 1 @@ -151,7 +155,7 @@ estimated_duration: 1.0 requires: cpuinfo.platform in ('i386', 'x86_64', 'ppc64el', 'pSeries') _description: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check) command: - zgrep 'CONFIG_NO_HZ=y' /boot/config-`uname -r` >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 ) + zgrep 'CONFIG_NO_HZ=y' /boot/config-"$(uname -r)" >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 ) plugin: manual category_id: com.canonical.plainbox::power-management @@ -184,7 +188,7 @@ requires: depends: power-management/unplug_ac _description: Checks the battery drain while watching a movie. Reports time and capacity until empty. Requires MOVIE_VAR to be set. command: - battery_test.py -t 90 --movie $MOVIE_VAR + battery_test.py -t 90 --movie "$MOVIE_VAR" plugin: shell category_id: com.canonical.plainbox::power-management @@ -337,7 +341,7 @@ estimated_duration: 1.0 requires: cpuinfo.platform in ('i386', 'x86_64', 'ppc64el', 'pSeries') _description: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check) command: - zgrep 'CONFIG_NO_HZ=y' /snap/{kernel}/current/config-`uname -r` >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 ) + zgrep 'CONFIG_NO_HZ=y' /snap/{kernel}/current/config-"$(uname -r)" >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 ) plugin: user-interact-verify category_id: com.canonical.plainbox::power-management diff --git a/units/stress/boot.pxu b/units/stress/boot.pxu index f4085aa..d05a816 100644 --- a/units/stress/boot.pxu +++ b/units/stress/boot.pxu @@ -29,7 +29,7 @@ plugin: resource environ: STRESS_BOOT_ITERATIONS command: ITERATIONS=${STRESS_BOOT_ITERATIONS:-2} - for i in $(seq 2 $ITERATIONS); do + for i in $(seq 2 "$ITERATIONS"); do echo "reboot_id: $i" echo "reboot_id_previous: $((i-1))" echo @@ -46,9 +46,9 @@ _description: This creates baseline data sets which be considered the master unit: job plugin: shell command: - lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_original || true - nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_original || true - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_original || true + lspci -i "$SNAP"/usr/share/misc/pci.ids > "$PLAINBOX_SESSION_SHARE"/lspci_original || true + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > "$PLAINBOX_SESSION_SHARE"/wifi_original || true + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids -s | sort > "$PLAINBOX_SESSION_SHARE"/lsusb_original || true environ: LD_LIBRARY_PATH user: root estimated_duration: 1s @@ -63,7 +63,7 @@ _description: This is a template that will be used to generate a stress test unit: job plugin: shell environ: STRESS_BOOT_WAKEUP_DELAY -command: rtcwake --mode off -s ${STRESS_BOOT_WAKEUP_DELAY:-120} +command: rtcwake --mode off -s "${STRESS_BOOT_WAKEUP_DELAY:-120}" user: root flags: preserve-locale noreturn autorestart estimated_duration: 180.0 @@ -81,8 +81,8 @@ template-unit: job plugin: shell environ: STRESS_BOOT_WAKEUP_DELAY STRESS_BOOT_WAIT_DELAY command: - sleep ${{STRESS_BOOT_WAIT_DELAY:-120}} - rtcwake --mode off -s ${{STRESS_BOOT_WAKEUP_DELAY:-120}} + sleep "${{STRESS_BOOT_WAIT_DELAY:-120}}" + rtcwake --mode off -s "${{STRESS_BOOT_WAKEUP_DELAY:-120}}" user: root flags: preserve-locale noreturn autorestart estimated_duration: 180.0 @@ -99,21 +99,18 @@ unit: job plugin: shell environ: LD_LIBRARY_PATH command: - lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test - nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test - diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test - if [ $? -ne 0 ] ; then + lspci -i "$SNAP"/usr/share/misc/pci.ids > "$PLAINBOX_SESSION_SHARE"/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > "$PLAINBOX_SESSION_SHARE"/wifi_test + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids -s | sort > "$PLAINBOX_SESSION_SHARE"/lsusb_test + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lspci_original "$PLAINBOX_SESSION_SHARE"/lspci_test; then echo "lspci mismatch during cycle 1" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/wifi_original "$PLAINBOX_SESSION_SHARE"/wifi_test; then echo "wifi mismatch during cycle 1" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lsusb_original "$PLAINBOX_SESSION_SHARE"/lsusb_test; then echo "lsusb mismatch during cycle 1" exit 1 fi @@ -134,21 +131,18 @@ template-unit: job plugin: shell environ: LD_LIBRARY_PATH command: - lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test - nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test - diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test - if [ $? -ne 0 ] ; then + lspci -i "$SNAP"/usr/share/misc/pci.ids > "$PLAINBOX_SESSION_SHARE"/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > "$PLAINBOX_SESSION_SHARE"/wifi_test + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids -s | sort > "$PLAINBOX_SESSION_SHARE"/lsusb_test + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lspci_original "$PLAINBOX_SESSION_SHARE"/lspci_test; then echo "lspci mismatch during cycle {reboot_id}" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/wifi_original "$PLAINBOX_SESSION_SHARE"/wifi_test; then echo "wifi mismatch during cycle {reboot_id}" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lsusb_original "$PLAINBOX_SESSION_SHARE"/lsusb_test; then echo "lsusb mismatch during cycle {reboot_id}" exit 1 fi @@ -185,7 +179,7 @@ template-unit: job plugin: shell environ: STRESS_BOOT_WAIT_DELAY command: - sleep ${{STRESS_BOOT_WAIT_DELAY:-120}} + sleep "${{STRESS_BOOT_WAIT_DELAY:-120}}" reboot user: root flags: preserve-locale noreturn autorestart @@ -203,21 +197,18 @@ unit: job plugin: shell environ: LD_LIBRARY_PATH command: - lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test - nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test - diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test - if [ $? -ne 0 ] ; then + lspci -i "$SNAP"/usr/share/misc/pci.ids > "$PLAINBOX_SESSION_SHARE"/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > "$PLAINBOX_SESSION_SHARE"/wifi_test + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids -s | sort > "$PLAINBOX_SESSION_SHARE"/lsusb_test + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lspci_original "$PLAINBOX_SESSION_SHARE"/lspci_test; then echo "lspci mismatch during cycle 1" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/wifi_original "$PLAINBOX_SESSION_SHARE"/wifi_test; then echo "wifi mismatch during cycle 1" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lsusb_original "$PLAINBOX_SESSION_SHARE"/lsusb_test; then echo "lsusb mismatch during cycle 1" exit 1 fi @@ -238,21 +229,18 @@ template-unit: job plugin: shell environ: LD_LIBRARY_PATH command: - lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test - nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test - diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test - if [ $? -ne 0 ] ; then + lspci -i "$SNAP"/usr/share/misc/pci.ids > "$PLAINBOX_SESSION_SHARE"/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > "$PLAINBOX_SESSION_SHARE"/wifi_test + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids -s | sort > "$PLAINBOX_SESSION_SHARE"/lsusb_test + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lspci_original "$PLAINBOX_SESSION_SHARE"/lspci_test; then echo "lspci mismatch during cycle {reboot_id}" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/wifi_original "$PLAINBOX_SESSION_SHARE"/wifi_test; then echo "wifi mismatch during cycle {reboot_id}" exit 1 fi - diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test - if [ $? -ne 0 ] ; then + if ! diff -u "$PLAINBOX_SESSION_SHARE"/lsusb_original "$PLAINBOX_SESSION_SHARE"/lsusb_test; then echo "lsusb mismatch during cycle {reboot_id}" exit 1 fi diff --git a/units/stress/jobs.pxu b/units/stress/jobs.pxu index 93ea3f6..5a342da 100644 --- a/units/stress/jobs.pxu +++ b/units/stress/jobs.pxu @@ -5,7 +5,7 @@ estimated_duration: 7200.0 requires: package.name == 'stress' user: root -command: num_vm=$(awk '/MemTotal/ {x=$2/262144; print ((x == int(x)) ? x : int(x) +1)}' /proc/meminfo); vm_bytes=$(($(awk '/MemTotal/ {print int($2/1024)}' /proc/meminfo)/$num_vm/4))M; stress --cpu `cpuinfo_resource.py | awk '/count:/ {print $2}'` --vm $num_vm --vm-bytes $vm_bytes --timeout 7200s +command: num_vm=$(awk '/MemTotal/ {x=$2/262144; print ((x == int(x)) ? x : int(x) +1)}' /proc/meminfo); vm_bytes=$(($(awk '/MemTotal/ {print int($2/1024)}' /proc/meminfo)/num_vm/4))M; stress --cpu "$(cpuinfo_resource.py | awk '/count:/ {print $2}')" --vm "$num_vm" --vm-bytes $vm_bytes --timeout 7200s _description: Simulate high system load using the 'stress' tool to exercise the CPU for several hours. The test is considered passed if the system does not freeze or @@ -22,7 +22,7 @@ command: if [ -n "$STRESS_NG_CPU_TIME" ] then echo "Found STRESS_NG_CPU_TIME env var, stress_ng cpu running time is now: $STRESS_NG_CPU_TIME seconds" - stress_ng_test.py cpu --base-time $STRESS_NG_CPU_TIME + stress_ng_test.py cpu --base-time "$STRESS_NG_CPU_TIME" else echo STRESS_NG_CPU_TIME env var is not found, stress_ng cpu running time is default value stress_ng_test.py cpu --base-time 7200 @@ -48,10 +48,10 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate_30_cycles -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 --s4-multiple=30 + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles -f none -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 --s4-multiple=30 else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -s disk -i 30 -w 120 | tee $PLAINBOX_SESSION_SHARE/hibernate_30_cycles.log + set -o pipefail; sleep_test.py -s disk -i 30 -w 120 | tee "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles.log fi _description: PURPOSE: @@ -61,7 +61,7 @@ plugin: shell category_id: com.canonical.plainbox::stress id: power-management/hibernate-30-cycles-log-check estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_30_cycles.log ] && sleep_test_log_check.py -v s4 $PLAINBOX_SESSION_SHARE/hibernate_30_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles.log ] && sleep_test_log_check.py -v s4 "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles.log _description: Automated check of the 30 cycle hibernate log for errors detected by fwts. @@ -69,7 +69,7 @@ plugin: attachment category_id: com.canonical.plainbox::stress id: power-management/hibernate-30-cycle-log-attach estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_30_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/hibernate_30_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate_30_cycles.log _description: Attaches the log from the 30 cycle Hibernate/Resume test if it exists @@ -86,8 +86,8 @@ flags: noreturn user: root environ: PM_TEST_DRY_RUN command: - rm -f $PLAINBOX_SESSION_SHARE/__result - pm_test.py reboot --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox --fwts --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE --suspends-before-reboot=30 -r 3 --silent --check-hardware-list + rm -f "$PLAINBOX_SESSION_SHARE"/__result + pm_test.py reboot --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox --fwts --log-level=debug --log-dir="$PLAINBOX_SESSION_SHARE" --suspends-before-reboot=30 -r 3 --silent --check-hardware-list _summary: 30 suspend/resume cycles and 1 reboot, 3 times (automated stress test) _description: This is an automated stress test that will run a sequence of '30 suspend/resume cycles and one reboot' 3 times. @@ -111,10 +111,10 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - set -o pipefail; checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/suspend_30_cycles -f none -s s3 --s3-device-check --s3-device-check-delay=60 --s3-sleep-delay=60 --s3-multiple=30 | tee $PLAINBOX_SESSION_SHARE/suspend_30_cycles_times.log + set -o pipefail; checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles -f none -s s3 --s3-device-check --s3-device-check-delay=60 --s3-sleep-delay=60 --s3-multiple=30 | tee "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles_times.log else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -p -s mem -i 30 | tee $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log + set -o pipefail; sleep_test.py -p -s mem -i 30 | tee "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles.log fi _description: PURPOSE: @@ -125,7 +125,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycles-log-check depends: power-management/suspend_30_cycles estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log ] && sleep_test_log_check.py -v s3 $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles.log _description: Automated check of the 30 cycle suspend log for errors detected by fwts. @@ -134,7 +134,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycles-log-check-with-reboots depends: power-management/suspend_30_cycles_with_reboots estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_test_log_check.py -v s3 $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log _summary: 30 suspend/resume cycles and 1 reboot, 3 times (check logs for errors) _description: Automated check of the '30 cycle suspend and 1 reboot times 3' logs for errors detected by fwts. @@ -152,7 +152,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycle-log-attach estimated_duration: 1.0 depends: power-management/suspend_30_cycles -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles.log _description: Attaches the log from the 30 cycle Suspend/Resume test if it exists @@ -161,7 +161,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycle-log-attach-with-reboots estimated_duration: 1.0 depends: power-management/suspend_30_cycles_with_reboots -command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && cat $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log ] && cat "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log _summary: 30 suspend/resume cycles and 1 reboot, 3 times (attach logs) _description: Attaches the log from the '30 cycle suspend/resume and one reboot times 3' test if it exists @@ -179,7 +179,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycles-time-check estimated_duration: 1.0 depends: power-management/suspend_30_cycles -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_30_cycles_times.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/suspend_30_cycles_times.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles_times.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/suspend_30_cycles_times.log _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold @@ -188,7 +188,7 @@ category_id: com.canonical.plainbox::stress id: power-management/suspend-30-cycles-time-check-with-reboots estimated_duration: 1.0 depends: power-management/suspend_30_cycles_with_reboots -command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.3.log _summary: 30 suspend/resume cycles and 1 reboot, 3 times (check logs for timing issues) _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold (warm boots) @@ -211,10 +211,10 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate_250_cycles -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 --s4-multiple=250 + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate_250_cycles -s s4 --s4-device-check --s4-device-check-delay=45 --s4-sleep-delay=120 --s4-multiple=250 else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -s disk -i 250 -w 120 | tee $PLAINBOX_SESSION_SHARE/hibernate_250_cycles.log + set -o pipefail; sleep_test.py -s disk -i 250 -w 120 | tee "$PLAINBOX_SESSION_SHARE"/hibernate_250_cycles.log fi _description: PURPOSE: @@ -224,7 +224,7 @@ plugin: attachment category_id: com.canonical.plainbox::stress id: stress/hibernate-250-cycle-log-attach estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_250_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/hibernate_250_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_250_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate_250_cycles.log _description: Attaches the log from the 250 cycle Hibernate/Resume test if it exists @@ -238,10 +238,10 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - set -o pipefail; checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/suspend_250_cycles -s s3 --s3-device-check --s3-device-check-delay=45 --s3-sleep-delay=30 --s3-multiple=250 | tee $PLAINBOX_SESSION_SHARE/suspend_250_cycles_times.log + set -o pipefail; checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles -s s3 --s3-device-check --s3-device-check-delay=45 --s3-sleep-delay=30 --s3-multiple=250 | tee "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles_times.log else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -p -s mem -i 250 | tee $PLAINBOX_SESSION_SHARE/suspend_250_cycles.log + set -o pipefail; sleep_test.py -p -s mem -i 250 | tee "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles.log fi _description: PURPOSE: @@ -251,7 +251,7 @@ plugin: attachment category_id: com.canonical.plainbox::stress id: stress/suspend-250-cycle-log-attach estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_250_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/suspend_250_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles.log _description: Attaches the log from the 250 cycle Suspend/Resume test if it exists @@ -259,7 +259,7 @@ plugin: shell category_id: com.canonical.plainbox::stress id: stress/suspend-250-cycles-time-check estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_250_cycles_times.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/suspend_250_cycles_times.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles_times.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/suspend_250_cycles_times.log _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold @@ -269,8 +269,8 @@ id: stress/reboot estimated_duration: 4500.0 requires: executable.name == 'fwts' command: - rm -f $PLAINBOX_SESSION_SHARE/__result - pm_test.py --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 100 --silent --log-level=notset reboot --log-dir=$PLAINBOX_SESSION_SHARE + rm -f "$PLAINBOX_SESSION_SHARE"/__result + pm_test.py --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox -r 100 --silent --log-level=notset reboot --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn user: root environ: PLAINBOX_SESSION_SHARE PM_TEST_DRY_RUN @@ -284,7 +284,7 @@ estimated_duration: 1.0 depends: stress/reboot command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*reboot.100.log + cat "$PLAINBOX_SESSION_SHARE"/*reboot.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -292,8 +292,8 @@ id: stress/reboot_30 requires: executable.name == 'fwts' executable.name == 'x-terminal-emulator' command: - rm -f $PLAINBOX_SESSION_SHARE/__result - pm_test.py --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 30 --silent --log-level=notset reboot --log-dir=$PLAINBOX_SESSION_SHARE + rm -f "$PLAINBOX_SESSION_SHARE"/__result + pm_test.py --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox -r 30 --silent --log-level=notset reboot --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn estimated_duration: 2700 user: root @@ -307,7 +307,7 @@ id: stress/reboot_30_log depends: stress/reboot_30 command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*reboot.30.log + cat "$PLAINBOX_SESSION_SHARE"/*reboot.30.log plugin: shell category_id: com.canonical.plainbox::stress @@ -317,8 +317,8 @@ requires: executable.name == 'fwts' executable.name == 'x-terminal-emulator' command: - rm -f $PLAINBOX_SESSION_SHARE/__result - pm_test.py --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 100 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE + rm -f "$PLAINBOX_SESSION_SHARE"/__result + pm_test.py --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox -r 100 --silent --log-level=notset poweroff --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn user: root environ: PLAINBOX_SESSION_SHARE PM_TEST_DRY_RUN @@ -332,7 +332,7 @@ estimated_duration: 1.0 depends: stress/poweroff command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*poweroff.100.log + cat "$PLAINBOX_SESSION_SHARE"/*poweroff.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -341,8 +341,8 @@ requires: executable.name == 'fwts' executable.name == 'x-terminal-emulator' command: - rm -f $PLAINBOX_SESSION_SHARE/__result - pm_test.py --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox -r 30 --wakeup 150 --silent --log-level=notset poweroff --log-dir=$PLAINBOX_SESSION_SHARE + rm -f "$PLAINBOX_SESSION_SHARE"/__result + pm_test.py --checkbox-respawn-cmd "$PLAINBOX_SESSION_SHARE"/__respawn_checkbox -r 30 --wakeup 150 --silent --log-level=notset poweroff --log-dir="$PLAINBOX_SESSION_SHARE" flags: noreturn estimated_duration: 3600 user: root @@ -356,14 +356,14 @@ id: stress/poweroff_30_log depends: stress/poweroff_30 command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/*poweroff.30.log + cat "$PLAINBOX_SESSION_SHARE"/*poweroff.30.log plugin: shell category_id: com.canonical.plainbox::stress id: stress/reboot_30_check estimated_duration: 1.0 depends: stress/reboot_30 -command: pm_log_check.py --log-level=notset $PLAINBOX_SESSION_SHARE/pm_test.reboot.30.log $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.30.log +command: pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.30.log "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.30.log _description: Check logs for the stress reboot (30 cycles) test case plugin: attachment @@ -373,14 +373,14 @@ estimated_duration: 1.0 depends: stress/reboot_30_check command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.30.log + cat "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.30.log plugin: shell category_id: com.canonical.plainbox::stress id: stress/poweroff_30_check estimated_duration: 1.0 depends: stress/poweroff_30 -command: pm_log_check.py --log-level=notset $PLAINBOX_SESSION_SHARE/pm_test.poweroff.30.log $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.30.log +command: pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.poweroff.30.log "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.30.log _description: Check logs for the stress poweroff (30 cycles) test case plugin: attachment @@ -390,14 +390,14 @@ estimated_duration: 1.0 depends: stress/poweroff_30_check command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.30.log + cat "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.30.log plugin: shell category_id: com.canonical.plainbox::stress id: stress/reboot_check estimated_duration: 1.0 depends: stress/reboot -command: pm_log_check.py --log-level=notset $PLAINBOX_SESSION_SHARE/pm_test.reboot.100.log $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.100.log +command: pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.100.log "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.100.log _description: Check logs for the stress reboot (100 cycles) test case plugin: attachment @@ -407,14 +407,14 @@ estimated_duration: 1.0 depends: stress/reboot_check command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.100.log + cat "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.100.log plugin: shell category_id: com.canonical.plainbox::stress id: stress/poweroff_check estimated_duration: 1.0 depends: stress/poweroff -command: pm_log_check.py --log-level=notset $PLAINBOX_SESSION_SHARE/pm_test.poweroff.100.log $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.100.log +command: pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.poweroff.100.log "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.100.log _description: Check logs for the stress poweroff (100 cycles) test case plugin: attachment @@ -424,7 +424,7 @@ estimated_duration: 1.0 depends: stress/poweroff_check command: set -o pipefail - cat $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.100.log + cat "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -434,7 +434,7 @@ requires: package.name == 'x11-apps' user: root environ: PLAINBOX_SESSION_SHARE -command: graphics_stress_test.py --iterations 20 -b repeat -d -o $PLAINBOX_SESSION_SHARE/graphics-stress-results && echo "Graphics Stress Test completed successfully" || echo "Graphics Stress Test completed, but there are errors. Please see the log $PLAINBOX_SESSION_SHARE/graphics-stress-results for details" && false +command: graphics_stress_test.py --iterations 20 -b repeat -d -o "$PLAINBOX_SESSION_SHARE"/graphics-stress-results && echo "Graphics Stress Test completed successfully" || echo "Graphics Stress Test completed, but there are errors. Please see the log $PLAINBOX_SESSION_SHARE/graphics-stress-results for details" && false _description: Run the graphics stress test. This test can take a few minutes. @@ -444,7 +444,7 @@ id: stress/graphics-tarball estimated_duration: 1.0 requires: package.name == 'x11-apps' -command: [ -f $PLAINBOX_SESSION_SHARE/graphics-stress-results ] && cat $PLAINBOX_SESSION_SHARE/graphics-stress-results +command: [ -f "$PLAINBOX_SESSION_SHARE"/graphics-stress-results ] && cat "$PLAINBOX_SESSION_SHARE"/graphics-stress-results _description: Attaches the graphics stress results to the submission. plugin: shell @@ -481,7 +481,7 @@ id: stress/network_restart estimated_duration: 1500.0 user: root environ: PLAINBOX_SESSION_SHARE -command: network_restart.py -t 100 -o $PLAINBOX_SESSION_SHARE +command: network_restart.py -t 100 -o "$PLAINBOX_SESSION_SHARE" _description: Ping ubuntu.com and restart network interfaces 100 times plugin: attachment @@ -489,7 +489,7 @@ category_id: com.canonical.plainbox::stress id: stress/network_restart_log estimated_duration: 1.0 depends: stress/network_restart -command: file=$PLAINBOX_SESSION_SHARE/network_restart.log; if [ -e "$file" ]; then iconv -t 'ascii' -c "$file"; fi +command: file="$PLAINBOX_SESSION_SHARE"/network_restart.log; if [ -e "$file" ]; then iconv -t 'ascii' -c "$file"; fi plugin: manual category_id: com.canonical.plainbox::stress @@ -513,7 +513,7 @@ requires: executable.name == 'sleepgraph' user: root _summary: Resume from idle by using Intel pm-graph command: - sleepgraph -m freeze -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o $PLAINBOX_SESSION_SHARE/s2idle_pm-graph/s2idle-{date}-{time} + sleepgraph -m freeze -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph/s2idle-"$(date -d today +%Y-%m-%d-%H%M)" plugin: attachment category_id: com.canonical.plainbox::stress @@ -522,7 +522,7 @@ estimated_duration: 1 user: root _summary: Attach pm-graph logs (s2idle) command: - tar Jcf $PLAINBOX_SESSION_SHARE/s2idle_pm-graph_30.tar.xz $PLAINBOX_SESSION_SHARE/s2idle_pm-graph && cat $PLAINBOX_SESSION_SHARE/s2idle_pm-graph_30.tar.xz + tar Jcf "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph_30.tar.xz "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph && cat "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph_30.tar.xz plugin:shell category_id: com.canonical.plainbox::stress @@ -532,7 +532,7 @@ requires: executable.name == 'sleepgraph' user: root _summary: Resume from suspend by using Intel pm-graph command: - sleepgraph -m mem -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o $PLAINBOX_SESSION_SHARE/s3_pm-graph/suspend-{date}-{time} + sleepgraph -m mem -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s3_pm-graph/suspend-"$(date -d today +%Y-%m-%d-%H%M)" plugin: attachment category_id: com.canonical.plainbox::stress @@ -541,7 +541,7 @@ estimated_duration: 1 user: root _summary: Attach pm-graph logs (s3) command: - tar Jcf $PLAINBOX_SESSION_SHARE/s3_pm-graph_30.tar.xz $PLAINBOX_SESSION_SHARE/s3_pm-graph && cat $PLAINBOX_SESSION_SHARE/s3_pm-graph_30.tar.xz + tar Jcf "$PLAINBOX_SESSION_SHARE"/s3_pm-graph_30.tar.xz "$PLAINBOX_SESSION_SHARE"/s3_pm-graph && cat "$PLAINBOX_SESSION_SHARE"/s3_pm-graph_30.tar.xz unit: job id: stress/wireless_bluetooth_coex_connect_stress @@ -566,20 +566,20 @@ command: [ -n "${SSID}" ] || SSID=${WPA_N_SSID} [ -n "${PSK}" ] || PSK=${WPA_N_PSK} for n in $(nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*"); do - nmcli c delete ${n} + nmcli c delete "${n}" done - nmcli d wifi connect ${SSID} password ${PSK} + nmcli d wifi connect "${SSID}" password "${PSK}" UUID=$(nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*") i=1 while [ ! $i -gt $NUM ] do echo "Connect/Disconnect Round ${i}" - nmcli c up uuid ${UUID} + nmcli c up uuid "${UUID}" sleep 5 if nmcli | grep ^wl | grep -q disconnected; then exit 1 fi - nmcli c down uuid ${UUID} + nmcli c down uuid "${UUID}" sleep 3 i=$((i+1)) done diff --git a/units/stress/s3s4.pxu b/units/stress/s3s4.pxu index f7a3c77..0e349c3 100644 --- a/units/stress/s3s4.pxu +++ b/units/stress/s3s4.pxu @@ -54,7 +54,7 @@ environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LI user: root command: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" - set -o pipefail; checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles -f none -s s3 --s3-device-check --s3-device-check-delay=${{STRESS_S3_WAIT_DELAY:-45}} --s3-sleep-delay=${{STRESS_S3_SLEEP_DELAY:-30}} --s3-multiple={s3_iterations} -j $SNAP/share/fwts | tee $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles_times.log + set -o pipefail; checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles -f none -s s3 --s3-device-check --s3-device-check-delay="${{STRESS_S3_WAIT_DELAY:-45}}" --s3-sleep-delay="${{STRESS_S3_SLEEP_DELAY:-30}}" --s3-multiple={s3_iterations} -j "$SNAP"/share/fwts | tee "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles_times.log _description: PURPOSE: This is an automated stress test that will force the system to suspend/resume for {s3_iterations} cycles. @@ -68,7 +68,7 @@ category_id: stress-tests/suspend id: stress-tests/suspend-{s3_iterations}-cycles-log-check after: stress-tests/suspend_{s3_iterations}_cycles estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log ] && sleep_test_log_check.py -v s3 $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log _description: Automated check of the {s3_iterations} cycles suspend log for errors detected by fwts. @@ -81,7 +81,7 @@ category_id: stress-tests/suspend id: stress-tests/suspend-{s3_iterations}-cycles-log-attach estimated_duration: 1.0 after: stress-tests/suspend_{s3_iterations}_cycles -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log _description: Attaches the log from the {s3_iterations} cycles Suspend/Resume test if it exists @@ -104,7 +104,7 @@ environ: PLAINBOX_SESSION_SHARE STRESS_S4_SLEEP_DELAY STRESS_S4_WAIT_DELAY LD_LI user: root command: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles -f none -s s4 --s4-device-check --s4-device-check-delay=${{STRESS_S4_WAIT_DELAY:-45}} --s4-sleep-delay=${{STRESS_S4_SLEEP_DELAY:-120}} --s4-multiple={s4_iterations} -j $SNAP/share/fwts + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles -f none -s s4 --s4-device-check --s4-device-check-delay="${{STRESS_S4_WAIT_DELAY:-45}}" --s4-sleep-delay="${{STRESS_S4_SLEEP_DELAY:-120}}" --s4-multiple={s4_iterations} -j "$SNAP"/share/fwts _description: PURPOSE: This is an automated stress test that will force the system to hibernate/resume for {s4_iterations} cycles @@ -118,7 +118,7 @@ category_id: stress-tests/hibernate id: stress-tests/hibernate-{s4_iterations}-cycles-log-check after: stress-tests/hibernate_{s4_iterations}_cycles estimated_duration: 1.0 -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log ] && sleep_test_log_check.py -v s4 $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && sleep_test_log_check.py -v s4 "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log _description: Automated check of the {s4_iterations} cycles hibernate log for errors detected by fwts. @@ -131,6 +131,6 @@ category_id: stress-tests/hibernate id: stress-tests/hibernate-{s4_iterations}-cycles-log-attach estimated_duration: 1.0 after: stress-tests/hibernate_{s4_iterations}_cycles -command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log _description: Attaches the log from the {s4_iterations} cycles Hibernate/Resume test if it exists diff --git a/units/submission/jobs.pxu b/units/submission/jobs.pxu index d33b49e..5a002bc 100644 --- a/units/submission/jobs.pxu +++ b/units/submission/jobs.pxu @@ -32,7 +32,7 @@ id: modprobe_json plugin: attachment category_id: com.canonical.plainbox::info command: - find /etc/modprobe.* -name \*.conf | xargs cat | python3 -m plainbox dev parse modprobe | + find /etc/modprobe.* -name \*.conf -exec cat {} + | python3 -m plainbox dev parse modprobe | jq 'to_entries | map({"module": .key, "options": .value})' estimated_duration: 0.015 _description: Attaches the contents of the various modprobe conf files. diff --git a/units/suspend/suspend-graphics.pxu b/units/suspend/suspend-graphics.pxu index ec1be28..0b0611d 100644 --- a/units/suspend/suspend-graphics.pxu +++ b/units/suspend/suspend-graphics.pxu @@ -8,8 +8,9 @@ after: graphics/{index}_auto_switch_card_{product_slug} estimated_duration: 1.2 _description: Record the current resolution before suspending. command: + # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} - xrandr -q | grep '*'| awk '{{print $1}}' > $PLAINBOX_SESSION_SHARE/{index}_resolution_before_suspend.txt + xrandr -q | grep "[*]" | awk '{{print $1}}' > "$PLAINBOX_SESSION_SHARE"/{index}_resolution_before_suspend.txt unit: template template-resource: graphics_card @@ -27,7 +28,7 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log estimated_duration: 1m30s _summary: Test auto suspend/resume after switching to {vendor} {product} @@ -48,8 +49,9 @@ depends: {%- endif %} _description: Test to see that we have the same resolution after resuming as before. command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} - xrandr -q | grep '*'| awk '{print $1}' | diff $PLAINBOX_SESSION_SHARE/{{ index }}_resolution_before_suspend.txt - + xrandr -q | grep "[*]" | awk '{print $1}' | diff "$PLAINBOX_SESSION_SHARE"/{{ index }}_resolution_before_suspend.txt - unit: template template-resource: graphics_card @@ -89,8 +91,9 @@ depends: {%- endif %} estimated_duration: 120.0 command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} - xrandr_cycle.py --keyword={{ index }}_after_suspend --screenshot-dir $PLAINBOX_SESSION_SHARE + xrandr_cycle.py --keyword={{ index }}_after_suspend --screenshot-dir "$PLAINBOX_SESSION_SHARE" _description: PURPOSE: This test will cycle through the detected display modes @@ -106,7 +109,7 @@ plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/{index}_xrandr_screens_after_suspend.tar.gz_auto depends: suspend/{index}_cycle_resolutions_after_suspend_{product_slug}_graphics -command: [ -f $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz ] && cat $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz +command: [ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz _description: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission. unit: template @@ -124,8 +127,9 @@ depends: {%- endif %} requires: package.name == 'nux-tools' command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} - ! /usr/lib/nux/unity_support_test -p 2>&1 | ansi_parser.py | grep -e ":\(\s\+\)no$" -ie "error" + /usr/lib/nux/unity_support_test -p 2>&1 estimated_duration: 0.130 _description: Check that {{ product }} hardware is able to run a desktop session (OpenGL) _summary: Test OpenGL support for {{ product }} after suspend @@ -144,6 +148,7 @@ depends: {%- endif %} requires: executable.name == 'glxgears' command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} glxgears true @@ -174,6 +179,7 @@ requires: package.name == 'xorg' package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} gst_pipeline_test.py -t 2 'videotestsrc ! videoconvert ! autovideosink' || gst_pipeline_test.py -t 2 'videotestsrc ! ffmpegcolorspace ! autovideosink' _summary: Test that video can be displayed after suspend with {{ vendor }} {{ product }} @@ -199,6 +205,7 @@ depends: suspend/suspend_advanced {%- endif %} command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} graphics_driver.py estimated_duration: 0.500 @@ -218,7 +225,7 @@ depends: {%- else %} suspend/suspend_advanced {%- endif %} -command: [ -e $PLAINBOX_SESSION_SHARE/{{ index }}_suspend_single.log ] && cat $PLAINBOX_SESSION_SHARE/{{ index }}_suspend_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{{ index }}_suspend_single.log ] && cat "$PLAINBOX_SESSION_SHARE"/{{ index }}_suspend_single.log _description: Attaches the log from the single suspend/resume test to the results @@ -236,7 +243,7 @@ depends: suspend/suspend_advanced {%- endif %} estimated_duration: 1.2 -command: [ -e $PLAINBOX_SESSION_SHARE/{{ index }}_suspend_single_times.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/{{ index }}_suspend_single_times.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{{ index }}_suspend_single_times.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/{{ index }}_suspend_single_times.log _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold unit: template @@ -255,10 +262,10 @@ user: root command: if type -P fwts >/dev/null; then echo "Calling fwts" - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -p | tee $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log + set -o pipefail; sleep_test.py -p | tee "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log fi _purpose: Suspend SUT 30 times while using {product_slug} graphics card @@ -277,6 +284,7 @@ depends: suspend/suspend_advanced {%- endif %} command: + # shellcheck disable=SC1091 source graphics_env.sh {{ driver }} {{ index }} rotation_test.py estimated_duration: 20.000 diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu index a610b55..eacc827 100644 --- a/units/suspend/suspend.pxu +++ b/units/suspend/suspend.pxu @@ -4,14 +4,14 @@ id: suspend/network_before_suspend depends: ethernet/detect estimated_duration: 1.2 _summary: Record the current network before suspending. -command: set -o pipefail; gateway_ping_test | tee $PLAINBOX_SESSION_SHARE/network_before_suspend.txt +command: set -o pipefail; gateway_ping_test | tee "$PLAINBOX_SESSION_SHARE"/network_before_suspend.txt plugin: shell category_id: com.canonical.plainbox::suspend id: suspend/resolution_before_suspend estimated_duration: 1.2 _summary: Record the current resolution before suspending. -command: xrandr -q |grep '*'| awk '{print $1}' > $PLAINBOX_SESSION_SHARE/resolution_before_suspend.txt +command: xrandr -q | grep "[*]" | awk '{print $1}' > "$PLAINBOX_SESSION_SHARE"/resolution_before_suspend.txt unit: template template-resource: graphics_card @@ -22,7 +22,7 @@ id: suspend/{index}_resolution_before_suspend_{product_slug} depends: graphics/{index}_switch_card_{product_slug} estimated_duration: 1.2 _summary: Record the current resolution before suspending. -command: xrandr -q |grep '*'| awk '{{print $1}}' > $PLAINBOX_SESSION_SHARE/{index}_resolution_before_suspend.txt +command: xrandr -q | grep "[*]" | awk '{{print $1}}' > "$PLAINBOX_SESSION_SHARE"/{index}_resolution_before_suspend.txt plugin: shell category_id: com.canonical.plainbox::suspend @@ -32,21 +32,21 @@ requires: device.category == 'AUDIO' package.name == 'alsa-base' _summary: Record mixer settings before suspending. -command: audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_before_suspend +command: audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend plugin: shell category_id: com.canonical.plainbox::suspend id: suspend/cpu_before_suspend estimated_duration: 1.2 _summary: Verify that all the CPUs are online before suspending -command: cpuinfo_resource.py > $PLAINBOX_SESSION_SHARE/cpuinfo_before_suspend +command: cpuinfo_resource.py > "$PLAINBOX_SESSION_SHARE"/cpuinfo_before_suspend plugin: shell category_id: com.canonical.plainbox::suspend id: suspend/memory_before_suspend estimated_duration: 1.2 _summary: Dumps memory info to a file for comparison after suspend -command: meminfo_resource.py > $PLAINBOX_SESSION_SHARE/meminfo_before_suspend +command: meminfo_resource.py > "$PLAINBOX_SESSION_SHARE"/meminfo_before_suspend unit: template template-resource: device @@ -73,9 +73,9 @@ estimated_duration: 20.0 user: root environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS command: - INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13` - [ -z $INTERFACE ] && exit 1 - network.py test -i $INTERFACE -t iperf + INTERFACE=$( (nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13) + [ -z "$INTERFACE" ] && exit 1 + network.py test -i "$INTERFACE" -t iperf _summary: Before suspend iperf test GSM mobilebroadband _description: This test executes iperf connection performance/stability against the broadband device found on the system before suspend. @@ -88,9 +88,9 @@ estimated_duration: 20.0 user: root environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS command: - INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13` - [ -z $INTERFACE ] && exit 1 - network.py test -i $INTERFACE -t iperf + INTERFACE=$( (nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13) + [ -z "$INTERFACE" ] && exit 1 + network.py test -i "$INTERFACE" -t iperf _summary: Before suspend iperf test CDMA mobilebroadband _description: This test executes iperf connection performance/stability against the broadband device found on the system before suspend. @@ -119,7 +119,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" send 2>&1 | ansi_parser.py _summary: Bluetooth OBEX send before suspend _description: This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. @@ -148,7 +148,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" browse 2>&1 | ansi_parser.py _summary: Bluetooth OBEX browse before suspend _description: This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. @@ -177,7 +177,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" get 2>&1 | ansi_parser.py _summary: Bluetooth OBEX get before suspend _description: This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable @@ -196,10 +196,10 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/suspend_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -p | tee $PLAINBOX_SESSION_SHARE/2_suspend_single_times.log + set -o pipefail; sleep_test.py -p | tee "$PLAINBOX_SESSION_SHARE"/2_suspend_single_times.log fi estimated_duration: 90.0 _summary: Manual test of suspend function @@ -233,10 +233,10 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log else echo "Calling sleep_test.py" - set -o pipefail; sleep_test.py -p | tee $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log + set -o pipefail; sleep_test.py -p | tee "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log fi estimated_duration: 90.0 _summary: Test suspend/resume after switching to {vendor} {product} @@ -271,7 +271,7 @@ command: # fwts s3 is not available on all architectures (i.e ARM) if fwts --show-tests-categories | grep -q 's3 '; then echo "Calling fwts" - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/suspend_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log else echo "Calling rtcwake" rtcwake -m mem -s 30 @@ -288,7 +288,7 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single -s s3 --s3-hybrid --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 --pm-method=pm-utils | tee $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single_times.log + set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single -s s3 --s3-hybrid --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 --pm-method=pm-utils | tee "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single_times.log estimated_duration: 90.0 _summary: This test will check hybrid sleep and resume _description: @@ -307,14 +307,14 @@ category_id: com.canonical.plainbox::suspend id: suspend/suspend-single-log-check depends: suspend/suspend_advanced_auto estimated_duration: 1.2 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_single.log ] && sleep_test_log_check.py -v s3 $PLAINBOX_SESSION_SHARE/suspend_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_single.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/suspend_single.log _summary: Automated check of the suspend log for errors reported by fwts plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/suspend-single-log-attach depends: suspend/suspend_advanced_auto -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_single.log ] && cat $PLAINBOX_SESSION_SHARE/suspend_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_single.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_single.log _summary: Attaches the log from the single suspend/resume test unit: template @@ -324,7 +324,7 @@ plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/{index}_suspend-single-log-attach_{product_slug} depends: suspend/{index}_suspend_after_switch_to_card_{product_slug} -command: [ -e $PLAINBOX_SESSION_SHARE/{index}_suspend_single.log ] && cat $PLAINBOX_SESSION_SHARE/{index}_suspend_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single.log ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single.log _summary: Attaches the log from the single suspend/resume test unit: template @@ -334,7 +334,7 @@ category_id: com.canonical.plainbox::suspend id: suspend/{index}_hybrid-sleep-single-log-check depends: suspend/{index}_hybrid_sleep_{product_slug} estimated_duration: 1.2 -command: [ -e $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single.log ] && sleep_test_log_check.py -v s3 $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single.log _summary: Automated check of the hybrid sleep log for errors reported by fwts unit: template @@ -343,14 +343,14 @@ plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/{index}_hybrid-sleep-single-log-attach_{product_slug} depends: suspend/{index}_hybrid_sleep_{product_slug} -command: [ -e $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single.log ] && cat $PLAINBOX_SESSION_SHARE/{index}_hybrid_sleep_single.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single.log ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_hybrid_sleep_single.log _summary: Attaches the log from the single hybrid sleep/resume test plugin: shell category_id: com.canonical.plainbox::suspend id: suspend/suspend-time-check estimated_duration: 1.2 -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_single_times.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/suspend_single_times.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log _summary: Ensure time to suspend/resume is under threshold _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold @@ -363,7 +363,7 @@ category_id: com.canonical.plainbox::suspend id: suspend/{index}_suspend-time-check_{product_slug} depends: suspend/{index}_suspend_after_switch_to_card_{product_slug} estimated_duration: 1.2 -command: [ -e $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log ] && sleep_time_check.py $PLAINBOX_SESSION_SHARE/{index}_suspend_single_times.log +command: [ -e "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/{index}_suspend_single_times.log _summary: Ensure time to suspend/resume is under threshold _description: Checks the sleep times to ensure that a machine suspends and resumes within a given threshold @@ -407,7 +407,7 @@ id: suspend/network_after_suspend estimated_duration: 20.0 depends: suspend/suspend_advanced suspend/network_before_suspend _description: Test the network after resuming. -command: network_wait.py; gateway_ping_test | diff $PLAINBOX_SESSION_SHARE/network_before_suspend.txt - +command: network_wait.py; gateway_ping_test | diff "$PLAINBOX_SESSION_SHARE"/network_before_suspend.txt - plugin: shell category_id: com.canonical.plainbox::suspend @@ -415,7 +415,7 @@ id: suspend/resolution_after_suspend depends: suspend/suspend_advanced suspend/resolution_before_suspend estimated_duration: 1.2 _description: Test to see that we have the same resolution after resuming as before. -command: xrandr -q |grep '*'| awk '{print $1}' | diff $PLAINBOX_SESSION_SHARE/resolution_before_suspend.txt - +command: xrandr -q | grep "[*]" | awk '{print $1}' | diff "$PLAINBOX_SESSION_SHARE"/resolution_before_suspend.txt - unit: template template-resource: graphics_card @@ -426,7 +426,7 @@ id: suspend/{index}_resolution_after_suspend_{product_slug} estimated_duration: 1.2 depends: suspend/{index}_resolution_before_suspend_{product_slug} _description: Test to see that we have the same resolution after resuming as before. -command: xrandr -q |grep '*'| awk '{{print $1}}' | diff $PLAINBOX_SESSION_SHARE/{index}_resolution_before_suspend.txt - +command: xrandr -q | grep "[*]" | awk '{{print $1}}' | diff "$PLAINBOX_SESSION_SHARE"/{index}_resolution_before_suspend.txt - plugin: shell category_id: com.canonical.plainbox::suspend @@ -438,8 +438,8 @@ requires: depends: suspend/suspend_advanced suspend/audio_before_suspend _description: Verify that mixer settings after suspend are the same as before suspend. command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_after_suspend - diff $PLAINBOX_SESSION_SHARE/audio_settings_before_suspend $PLAINBOX_SESSION_SHARE/audio_settings_after_suspend + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend + diff "$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend "$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend plugin: shell category_id: com.canonical.plainbox::suspend @@ -451,8 +451,8 @@ requires: depends: suspend/suspend_advanced_auto suspend/audio_before_suspend _description: Verify that mixer settings after suspend are the same as before suspend. command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/audio_settings_after_suspend - diff $PLAINBOX_SESSION_SHARE/audio_settings_before_suspend $PLAINBOX_SESSION_SHARE/audio_settings_after_suspend + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend + diff "$PLAINBOX_SESSION_SHARE"/audio_settings_before_suspend "$PLAINBOX_SESSION_SHARE"/audio_settings_after_suspend plugin: user-interact category_id: com.canonical.plainbox::suspend @@ -510,11 +510,11 @@ requires: package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'pulseaudio-utils' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 gst_pipeline_test.py -t 2 'audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink' EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -536,11 +536,11 @@ requires: package.name == 'pulseaudio-utils' package.name == 'gstreamer1.0-plugins-good' or package.name == 'gstreamer0.10-plugins-good' command: - audio_settings.py store --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings audio_settings.py set --device=pci --volume=50 alsa_record_playback.sh EXIT_CODE=$? - audio_settings.py restore --file=$PLAINBOX_SESSION_SHARE/pulseaudio_settings + audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings exit $EXIT_CODE _description: PURPOSE: @@ -558,7 +558,7 @@ id: suspend/cpu_after_suspend estimated_duration: 1.2 depends: suspend/suspend_advanced suspend/cpu_before_suspend _description: Verify that all CPUs are online after resuming. -command: cpuinfo_resource.py | diff $PLAINBOX_SESSION_SHARE/cpuinfo_before_suspend - +command: cpuinfo_resource.py | diff "$PLAINBOX_SESSION_SHARE"/cpuinfo_before_suspend - plugin: shell category_id: com.canonical.plainbox::suspend @@ -566,7 +566,7 @@ id: suspend/cpu_after_suspend_auto estimated_duration: 1.2 depends: suspend/suspend_advanced_auto suspend/cpu_before_suspend _description: Verify that all CPUs are online after resuming. -command: cpuinfo_resource.py | diff $PLAINBOX_SESSION_SHARE/cpuinfo_before_suspend - +command: cpuinfo_resource.py | diff "$PLAINBOX_SESSION_SHARE"/cpuinfo_before_suspend - plugin: shell category_id: com.canonical.plainbox::suspend @@ -575,7 +575,7 @@ estimated_duration: 1.2 depends: suspend/suspend_advanced suspend/memory_before_suspend _description: Verify that all memory is available after resuming from suspend. -command: meminfo_resource.py | diff $PLAINBOX_SESSION_SHARE/meminfo_before_suspend - +command: meminfo_resource.py | diff "$PLAINBOX_SESSION_SHARE"/meminfo_before_suspend - plugin: shell category_id: com.canonical.plainbox::suspend @@ -584,7 +584,7 @@ estimated_duration: 1.2 depends: suspend/suspend_advanced_auto suspend/memory_before_suspend _description: Verify that all memory is available after resuming from suspend. -command: meminfo_resource.py | diff $PLAINBOX_SESSION_SHARE/meminfo_before_suspend - +command: meminfo_resource.py | diff "$PLAINBOX_SESSION_SHARE"/meminfo_before_suspend - plugin: manual category_id: com.canonical.plainbox::suspend @@ -655,9 +655,9 @@ estimated_duration: 20.0 user: root environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS command: - INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13` - [ -z $INTERFACE ] && exit 1 - network.py test -i $INTERFACE -t iperf + INTERFACE=$( (nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 13) + [ -z "$INTERFACE" ] && exit 1 + network.py test -i "$INTERFACE" -t iperf _description: This test executes iperf connection performance/stability against the broadband device found on the system after suspend. @@ -669,9 +669,9 @@ estimated_duration: 20.0 user: root environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS command: - INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13` - [ -z $INTERFACE ] && exit 1 - network.py test -i $INTERFACE -t iperf + INTERFACE=$( (nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep cdma |cut -d ":" -f 13) + [ -z "$INTERFACE" ] && exit 1 + network.py test -i "$INTERFACE" -t iperf _description: This test executes iperf connection performance/stability against the broadband device found on the system after suspend. @@ -686,17 +686,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -726,17 +727,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -766,17 +768,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -806,17 +809,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -846,17 +850,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -886,17 +891,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -933,7 +939,7 @@ command: sleep 3 fi output=$(hcitool dev | tail -n+2 | awk '{print $2}') - echo $output | diff $PLAINBOX_SESSION_SHARE/bluetooth_address - + echo "$output" | diff "$PLAINBOX_SESSION_SHARE"/bluetooth_address - if [ -z "$output" ]; then echo "BT hardware not available" exit 1 @@ -966,7 +972,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" send 2>&1 | ansi_parser.py _description: This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. @@ -995,7 +1001,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" send 2>&1 | ansi_parser.py _description: This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. @@ -1024,7 +1030,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" browse 2>&1 | ansi_parser.py _description: This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. @@ -1053,7 +1059,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" browse 2>&1 | ansi_parser.py _description: This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. @@ -1082,7 +1088,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" get 2>&1 | ansi_parser.py _description: This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable @@ -1111,7 +1117,7 @@ command: rfkill unblock bluetooth sleep 3 fi - set -o pipefail; bluetooth_test.py $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser.py + set -o pipefail; bluetooth_test.py "$PLAINBOX_PROVIDER_DATA"/images/JPEG_Color_Image_Ubuntu.jpg "$BTDEVADDR" get 2>&1 | ansi_parser.py _description: This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable @@ -1121,7 +1127,7 @@ id: suspend/cycle_resolutions_after_suspend estimated_duration: 120.0 requires: package.name == 'xorg' depends: suspend/suspend_advanced -command: xrandr_cycle.py --keyword=after_suspend --screenshot-dir $PLAINBOX_SESSION_SHARE +command: xrandr_cycle.py --keyword=after_suspend --screenshot-dir "$PLAINBOX_SESSION_SHARE" _description: PURPOSE: This test will cycle through the detected display modes @@ -1139,7 +1145,7 @@ id: suspend/{index}_cycle_resolutions_after_suspend_{product_slug} requires: package.name == 'xorg' depends: suspend/{index}_suspend_after_switch_to_card_{product_slug} estimated_duration: 120.0 -command: xrandr_cycle.py --keyword={index}_after_suspend --screenshot-dir $PLAINBOX_SESSION_SHARE +command: xrandr_cycle.py --keyword={index}_after_suspend --screenshot-dir "$PLAINBOX_SESSION_SHARE" _description: PURPOSE: This test will cycle through the detected display modes @@ -1157,13 +1163,13 @@ depends: suspend/suspend_advanced_auto _description: This test will check to make sure supported video modes work after a suspend and resume. This is done automatically by taking screenshots and uploading them as an attachment. -command: xrandr_cycle.py --keyword=after_suspend --screenshot-dir $PLAINBOX_SESSION_SHARE +command: xrandr_cycle.py --keyword=after_suspend --screenshot-dir "$PLAINBOX_SESSION_SHARE" plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/xrandr_screens_after_suspend.tar.gz depends: suspend/cycle_resolutions_after_suspend -command: [ -f $PLAINBOX_SESSION_SHARE/xrandr_screens_after_suspend.tgz ] && cat $PLAINBOX_SESSION_SHARE/xrandr_screens_after_suspend.tgz +command: [ -f "$PLAINBOX_SESSION_SHARE"/xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/xrandr_screens_after_suspend.tgz _description: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission. unit: template @@ -1173,7 +1179,7 @@ plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/{index}_xrandr_screens_after_suspend.tar.gz depends: suspend/{index}_cycle_resolutions_after_suspend_{product_slug} -command: [ -f $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz ] && cat $PLAINBOX_SESSION_SHARE/{index}_xrandr_screens_after_suspend.tgz +command: [ -f "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz ] && cat "$PLAINBOX_SESSION_SHARE"/{index}_xrandr_screens_after_suspend.tgz _description: This attaches screenshots from the suspend/cycle_resolutions_after_suspend test to the results submission. plugin: shell @@ -1213,7 +1219,7 @@ _description: plugin: attachment category_id: com.canonical.plainbox::suspend id: suspend/suspend-auto-single-log-attach -command: [ -e $PLAINBOX_SESSION_SHARE/suspend_auto_single_log ] && cat $PLAINBOX_SESSION_SHARE/suspend_auto_single_log +command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_auto_single_log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_auto_single_log _description: Attaches the log from the single suspend/resume test to the results @@ -1223,7 +1229,7 @@ id: suspend/screenshot_after_suspend estimated_duration: 10.0 depends: suspend/suspend_advanced_auto requires: package.name == 'fswebcam' -command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f ${PLAINBOX_SESSION_SHARE}/screenshot_after_suspend.jpg -q 2>&1 | ansi_parser.py +command: set -o pipefail; camera_test.py still --device=/dev/external_webcam -f "${PLAINBOX_SESSION_SHARE}"/screenshot_after_suspend.jpg -q 2>&1 | ansi_parser.py _description: PURPOSE: Take a screengrab of the current screen after suspend (logged on Unity desktop) @@ -1236,7 +1242,7 @@ plugin: attachment category_id: com.canonical.plainbox::suspend id: screenshot_after_suspend.jpg depends: suspend/screenshot_after_suspend -command: cat ${PLAINBOX_SESSION_SHARE}/screenshot_after_suspend.jpg +command: cat "${PLAINBOX_SESSION_SHARE}"/screenshot_after_suspend.jpg _description: Attaches the screenshot captured in graphics/screenshot. plugin: shell @@ -2123,7 +2129,7 @@ category_id: com.canonical.plainbox::suspend id: suspend/{index}_gl_support_after_suspend_{product_slug} depends: suspend/{index}_suspend_after_switch_to_card_{product_slug} requires: package.name == 'nux-tools' -command: ! /usr/lib/nux/unity_support_test -p 2>&1 | ansi_parser.py | grep -e ":\(\s\+\)no$" -ie "error" +command: /usr/lib/nux/unity_support_test -p 2>&1 estimated_duration: 0.130 _description: Check that {product} hardware is able to run a desktop session (OpenGL) after suspend _summary: Test OpenGL support for {product} after suspend @@ -2133,7 +2139,7 @@ category_id: com.canonical.plainbox::suspend id: suspend/gl_support_after_suspend depends: suspend/suspend_advanced requires: package.name == 'nux-tools' -command: ! /usr/lib/nux/unity_support_test -p 2>&1 | ansi_parser.py | grep -e ":\(\s\+\)no$" -ie "error" +command: /usr/lib/nux/unity_support_test -p 2>&1 estimated_duration: 0.130 _description: Check that the hardware is able to run a desktop session (OpenGL) _summary: Test OpenGL support after suspend @@ -2248,12 +2254,12 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/fwts_oops_results_after_s3.log -t oops + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/fwts_oops_results_after_s3.log -t oops id: suspend/oops_results_after_suspend.log plugin: attachment category_id: com.canonical.plainbox::suspend estimated_duration: 0.5 command: - [ -e ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log ] && xz -c ${PLAINBOX_SESSION_SHARE}/fwts_oops_results_after_s3.log + [ -e "${PLAINBOX_SESSION_SHARE}"/fwts_oops_results_after_s3.log ] && xz -c "${PLAINBOX_SESSION_SHARE}"/fwts_oops_results_after_s3.log _description: Attaches the FWTS oops results log to the submission after suspend diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index 5e5a4f2..2fcdbc3 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -189,8 +189,7 @@ id: touchpad/detected-as-mouse requires: dmi.product in ['Notebook','Laptop','Portable','Convertible'] estimated_duration: 1.2 command: - info=`touchpad_driver_info.py` - if [ $? -eq 0 ]; then + if info=$(touchpad_driver_info.py); then echo -e "touchpad detected with:\n$info" else echo "$info" @@ -207,7 +206,7 @@ category_id: com.canonical.plainbox::touchpad id: touchpad/continuous-move requires: dmi.product in ['Notebook','Laptop','Portable','Convertible'] estimated_duration: 12 -command: qmlscene -qt5 --fullscreen $PLAINBOX_PROVIDER_DATA/touch_continuous_move_test.qml 2>&1 | grep -o PASS +command: qmlscene -qt5 --fullscreen "$PLAINBOX_PROVIDER_DATA"/touch_continuous_move_test.qml 2>&1 | grep -o PASS _purpose: Touchpad continuous move verification _steps: @@ -222,7 +221,7 @@ _siblings: id: touchpad/palm-rejection plugin: user-interact category_id: com.canonical.plainbox::touchpad -command: qmlscene -qt5 --fullscreen $PLAINBOX_PROVIDER_DATA/palm_rejection.qml 2>&1 | grep -o PASS +command: qmlscene -qt5 --fullscreen "$PLAINBOX_PROVIDER_DATA"/palm_rejection.qml 2>&1 | grep -o PASS _purpose: This test checks if touchpad ignores palm touches _steps: diff --git a/units/touchscreen/jobs.pxu b/units/touchscreen/jobs.pxu index 39a2a98..3676980 100644 --- a/units/touchscreen/jobs.pxu +++ b/units/touchscreen/jobs.pxu @@ -67,7 +67,7 @@ id: touchscreen/multitouch-zoom _summary: Check touchscreen pinch gesture for zoom imports: from com.canonical.plainbox import manifest requires: manifest.has_touchscreen == 'True' -command: qmlscene -qt5 $PLAINBOX_PROVIDER_DATA/touch_zoom_test.qml 2>&1 |grep -o PASS +command: qmlscene -qt5 "$PLAINBOX_PROVIDER_DATA"/touch_zoom_test.qml 2>&1 |grep -o PASS estimated_duration: 120.0 _description: PURPOSE: @@ -85,7 +85,7 @@ id: touchscreen/multitouch-rotate _summary: Check touchscreen pinch gesture for rotate imports: from com.canonical.plainbox import manifest requires: manifest.has_touchscreen == 'True' -command: qmlscene -qt5 $PLAINBOX_PROVIDER_DATA/touch_rotate_test.qml 2>&1 |grep -o PASS +command: qmlscene -qt5 "$PLAINBOX_PROVIDER_DATA"/touch_rotate_test.qml 2>&1 |grep -o PASS estimated_duration: 120.0 _description: PURPOSE: @@ -152,7 +152,7 @@ _description: command: {%- if 'Unity' in __system_env__["XDG_CURRENT_DESKTOP"] %} manage_compiz_plugin.py unityshell disable - qmlscene -qt5 3 $PLAINBOX_PROVIDER_DATA/touch_tap_test.qml 2>&1 | grep -o PASS + qmlscene -qt5 3 "$PLAINBOX_PROVIDER_DATA"/touch_tap_test.qml 2>&1 | grep -o PASS EXIT=$? sleep 5 manage_compiz_plugin.py unityshell enable @@ -187,7 +187,7 @@ _description: command: {%- if 'Unity' in __system_env__["XDG_CURRENT_DESKTOP"] %} manage_compiz_plugin.py unityshell disable - qmlscene -qt5 4 $PLAINBOX_PROVIDER_DATA/touch_tap_test.qml 2>&1 | grep -o PASS + qmlscene -qt5 4 "$PLAINBOX_PROVIDER_DATA"/touch_tap_test.qml 2>&1 | grep -o PASS EXIT=$? sleep 5 manage_compiz_plugin.py unityshell enable diff --git a/units/tpm/sysfs.pxu b/units/tpm/sysfs.pxu index 5db5fe7..34b3c4a 100644 --- a/units/tpm/sysfs.pxu +++ b/units/tpm/sysfs.pxu @@ -12,7 +12,7 @@ _summary: Count the number of visible TPM chips in sysfs _description: This job just counts the number of visible TPM chips in as reported by tpm_sysfs_resource.py tool. The only resource attribute is 'count' -command: echo "count: $(tpm_sysfs_resource.py | grep -F 'x-sysfs-device-name' | wc -l)" +command: echo "count: $(tpm_sysfs_resource.py | grep -c -F 'x-sysfs-device-name')" estimated_duration: 2s flags: preserve-locale diff --git a/units/usb/usb.pxu b/units/usb/usb.pxu index 29ad795..1298d72 100644 --- a/units/usb/usb.pxu +++ b/units/usb/usb.pxu @@ -7,7 +7,7 @@ estimated_duration: 1.0 command: set -o pipefail if [[ -v SNAP ]]; then - checkbox-support-lsusb -f $CHECKBOX_RUNTIME/var/lib/usbutils/usb.ids 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2 + checkbox-support-lsusb -f "$CHECKBOX_RUNTIME"/var/lib/usbutils/usb.ids 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2 else lsusb 2>/dev/null | sort || echo "No USB devices were detected" >&2 fi diff --git a/units/virtualization/jobs.pxu b/units/virtualization/jobs.pxu index 1bf566c..dca284d 100644 --- a/units/virtualization/jobs.pxu +++ b/units/virtualization/jobs.pxu @@ -8,7 +8,7 @@ requires: package.name == 'qemu-system' package.name == 'qemu-utils' virtualization.kvm == 'supported' -command: virtualization.py --debug kvm --log-file=$PLAINBOX_SESSION_SHARE/virt_debug +command: virtualization.py --debug kvm --log-file="$PLAINBOX_SESSION_SHARE"/virt_debug _description: Verifies that a KVM guest can be created and booted using an Ubuntu Server cloud image. diff --git a/units/wireless/jobs.pxu b/units/wireless/jobs.pxu index c4ee54c..6d8b27b 100644 --- a/units/wireless/jobs.pxu +++ b/units/wireless/jobs.pxu @@ -18,7 +18,7 @@ template-unit: job id: wireless/wireless_scanning_{{ interface }} _summary: Test system can discover Wi-Fi networks on {{ interface }} command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py scan {{ interface }} plugin: shell category_id: com.canonical.plainbox::wireless @@ -43,7 +43,7 @@ _purpose: Check system can connect to 802.11b/g AP with wpa security plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py secured {{ interface }} "$WPA_BG_SSID" "$WPA_BG_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -65,7 +65,7 @@ _purpose: Check system can connect to insecure 802.11b/g AP plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py open {{ interface }} "$OPEN_BG_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -87,7 +87,7 @@ _purpose: Check system can connect to 802.11n AP with wpa security plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py secured {{ interface }} "$WPA_N_SSID" "$WPA_N_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -109,7 +109,7 @@ _purpose: Check system can connect to insecure 802.11n AP plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py open {{ interface }} "$OPEN_N_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -131,7 +131,7 @@ _purpose: Check system can connect to 802.11ac AP with wpa security plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py secured {{ interface }} "$WPA_AC_SSID" "$WPA_AC_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -154,7 +154,7 @@ _purpose: Check system can connect to insecure 802.11ac AP plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py open {{ interface }} "$OPEN_AC_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -177,7 +177,7 @@ _purpose: Check system can connect to 802.11ax AP with wpa security plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py secured {{ interface }} "$WPA_AX_SSID" "$WPA_AX_PSK" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -200,7 +200,7 @@ _purpose: Check system can connect to insecure 802.11ax AP plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py open {{ interface }} "$OPEN_AX_SSID" category_id: com.canonical.plainbox::wireless estimated_duration: 30.0 @@ -221,17 +221,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -260,17 +261,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -300,17 +302,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -340,17 +343,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -380,17 +384,18 @@ requires: user: root environ: ROUTER_SSID ROUTER_PSK command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID --security=wpa --key=$ROUTER_PSK; then + if create_connection.py wifi "$ROUTER_SSID" --security=wpa --key="$ROUTER_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -420,17 +425,18 @@ requires: user: root environ: ROUTER_SSID command: + # shellcheck disable=SC2064 trap "nmcli con delete id $ROUTER_SSID" EXIT - if create_connection.py wifi $ROUTER_SSID; then + if create_connection.py wifi "$ROUTER_SSID"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - gateway_ping_test --interface=$INTERFACE + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + gateway_ping_test --interface="$INTERFACE" STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -459,17 +465,18 @@ requires: user: root environ: WPA_BG_SSID WPA_BG_PSK SERVER_IPERF command: + # shellcheck disable=SC2064 trap "nmcli con delete id $WPA_BG_SSID" EXIT - if create_connection.py wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then + if create_connection.py wifi "$WPA_BG_SSID" --security=wpa --key="$WPA_BG_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - iperf -c $SERVER_IPERF -t 300 -i 30 + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + iperf -c "$SERVER_IPERF" -t 300 -i 30 STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else @@ -488,17 +495,18 @@ requires: user: root environ: WPA_BG_SSID WPA_BG_PSK SERVER_IPERF command: + # shellcheck disable=SC2064 trap "nmcli con delete id $WPA_BG_SSID" EXIT - if create_connection.py wifi $WPA_BG_SSID --security=wpa --key=$WPA_BG_PSK; then + if create_connection.py wifi "$WPA_BG_SSID" --security=wpa --key="$WPA_BG_PSK"; then connect_wireless.sh # lp:1471663 - INTERFACE=`nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}'` - iw dev $INTERFACE link - iperf -c $SERVER_IPERF -t 300 -i 30 -u -b 100m -p 5050 + INTERFACE=$(nmcli dev status | awk '/802-11-wireless|wifi/ {print $1}') + iw dev "$INTERFACE" link + iperf -c "$SERVER_IPERF" -t 300 -i 30 -u -b 100m -p 5050 STATUS=$? # We reconnect the Ethernet connection if any (lp:1471663) WIRED=$(nmcli -f UUID,TYPE c | grep -oP ".*(?=\s+.*ethernet)") - if [[ ! -z $WIRED ]]; then - nmcli c up uuid $WIRED + if [[ -n $WIRED ]]; then + nmcli c up uuid "$WIRED" fi exit $STATUS else diff --git a/units/wireless/nm-hotspot.pxu b/units/wireless/nm-hotspot.pxu index 3baa742..ca62c7a 100644 --- a/units/wireless/nm-hotspot.pxu +++ b/units/wireless/nm-hotspot.pxu @@ -7,7 +7,7 @@ template-unit: job id: wireless/nmcli_wifi_ap_bg_{{ interface }} _summary: Create 802.11b/g Wi-Fi AP on {{ interface }} using NetworkManager command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py ap {{ interface }} bg plugin: shell category_id: com.canonical.plainbox::wireless @@ -28,7 +28,7 @@ template-unit: job id: wireless/nmcli_wifi_ap_a_{{ interface }} _summary: Create 802.11a Wi-Fi AP on {{ interface }} using NetworkManager command: - net_driver_info.py $NET_DRIVER_INFO + net_driver_info.py "$NET_DRIVER_INFO" wifi_nmcli_test.py ap {{ interface }} a plugin: shell category_id: com.canonical.plainbox::wireless @@ -39,4 +39,4 @@ requires: connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' {%- else %} executable.name == 'nmcli' - {% endif -%} \ No newline at end of file + {% endif -%} diff --git a/units/wireless/wifi-ap.pxu b/units/wireless/wifi-ap.pxu index 493a2ca..622d70f 100644 --- a/units/wireless/wifi-ap.pxu +++ b/units/wireless/wifi-ap.pxu @@ -41,7 +41,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=a @@ -50,10 +50,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_a_open echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_open)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_open)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -112,7 +112,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=b @@ -121,10 +121,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_b_open echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_open)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_open)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -183,7 +183,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=g @@ -192,10 +192,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_g_open echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_open)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_open)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -254,7 +254,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=ad @@ -263,10 +263,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_ad_open echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_open)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_open)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -326,7 +326,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=a @@ -336,10 +336,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -399,7 +399,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=b @@ -409,10 +409,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -472,7 +472,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=g @@ -482,10 +482,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -545,7 +545,7 @@ _description: then checking status of the interface using `iw` command. user: root command: - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=ad @@ -555,10 +555,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -589,7 +589,7 @@ estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: nmcli dev wifi rescan - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX user: root _purpose: Check that the system can create a WPA2 802.11a Access Point with an already active STA connection @@ -629,13 +629,13 @@ command: echo "Scanning for existing networks" nmcli dev wifi rescan echo "Connecting to existing network" - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then echo "FAILED to connect to STA before setting up AP" exit 1 fi - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=a @@ -645,10 +645,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -672,10 +672,10 @@ requires: wifi_interface_mode.{interface}_AP == 'supported' snap.name == 'wifi-ap' estimated_duration: 120.0 -environ: LD_LIBRARY_PATH $OPEN_BG_SSID +environ: LD_LIBRARY_PATH OPEN_BG_SSID command: nmcli dev wifi rescan - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX user: root _purpose: Check that the system can create a WPA2 802.11b Access Point with an already active STA connection @@ -715,13 +715,13 @@ command: echo "Scanning for existing networks" nmcli dev wifi rescan echo "Connecting to existing network" - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then echo "FAILED to connect to STA before setting up AP" exit 1 fi - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=b @@ -731,10 +731,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -761,7 +761,7 @@ estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: nmcli dev wifi rescan - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX user: root _purpose: Check that the system can create a WPA2 802.11g Access Point with an already active STA connection @@ -801,13 +801,13 @@ command: echo "Scanning for existing networks" nmcli dev wifi rescan echo "Connecting to existing network" - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then echo "FAILED to connect to STA before setting up AP" exit 1 fi - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=g @@ -817,10 +817,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -847,7 +847,7 @@ estimated_duration: 120.0 environ: LD_LIBRARY_PATH OPEN_BG_SSID command: nmcli dev wifi rescan - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX user: root _purpose: Check that the system can create a WPA2 802.11ad Access Point with an already active STA connection @@ -887,13 +887,13 @@ command: echo "Scanning for existing networks" nmcli dev wifi rescan echo "Connecting to existing network" - nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$OPEN_BG_SSID" ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then echo "FAILED to connect to STA before setting up AP" exit 1 fi - BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + BEGIN_AP_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') echo "Setting up AP" wifi-ap.config set wifi.interface={interface} wifi-ap.config set wifi.operation-mode=ad @@ -903,10 +903,10 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -938,11 +938,11 @@ command: wifi-ap.config set wifi.ssid=DISABLED wifi-ap.config set disabled=true wifi_ap_wizard.py {interface} eth0 - sleep ${{WIFI_AP_SETUPTIME:-10}} + sleep "${{WIFI_AP_SETUPTIME:-10}}" echo "Running AP setup wizard" - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_Wizard)" |wc -l` + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_Wizard)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then exit 0; else exit 1; fi + if [ "$RES" -eq 2 ]; then exit 0; else exit 1; fi _description: Check that the system can create a WPA2 802.11g Access Point using wifi-ap.setup-wizard command on {interface}. @@ -971,7 +971,7 @@ command: wifi-ap.config set disabled=false wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} + sleep "${{WIFI_AP_SETUPTIME:-10}}" echo "Rebooting" reboot requires: @@ -1006,7 +1006,7 @@ command: unsnap-wifi-ap.sh config set wifi.security-passphrase=Test1234 unsnap-wifi-ap.sh config set disabled=0 unsnap-wifi-ap.sh config set wifi.ssid=Ubuntu_g_wpa2 - sleep ${{WIFI_AP_SETUPTIME:-10}} + sleep "${{WIFI_AP_SETUPTIME:-10}}" reboot requires: wifi_interface_mode.{interface}_AP == 'supported' @@ -1029,10 +1029,10 @@ _description: user: root command: echo "Waiting for AP to become available" - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then + if [ "$RES" -eq 2 ]; then echo "Network detected" exit 0 else @@ -1060,10 +1060,10 @@ _description: This job checks if AP still works. user: root command: - sleep ${{WIFI_AP_SETUPTIME:-10}} - RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + sleep "${{WIFI_AP_SETUPTIME:-10}}" + RES=$(iw {interface} info |grep -c -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)") wifi-ap.config set disabled=true - if [ $RES -eq 2 ]; then exit 0; else exit 1; fi + if [ "$RES" -eq 2 ]; then exit 0; else exit 1; fi requires: wifi_interface_mode.{interface}_AP == 'supported' snap.name == 'wifi-ap' diff --git a/units/wireless/wireless-connection-manual.pxu b/units/wireless/wireless-connection-manual.pxu index 7eb06cb..d06b260 100644 --- a/units/wireless/wireless-connection-manual.pxu +++ b/units/wireless/wireless-connection-manual.pxu @@ -181,16 +181,15 @@ environ: WPA_BG_PSK TEST_TARGET_IPERF command: - nmcli g > /dev/null - if [ $? -ne 0 ]; then + if ! nmcli g > /dev/null; then exit 1 fi trap "nmcli dev disconnect {{ interface }}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete nmcli dev wifi rescan - nmcli dev wifi connect $WPA_BG_SSID password $WPA_BG_PSK ifname {{ interface }} name WIFI_TEST_CREATED_BY_CHECKBOX + nmcli dev wifi connect "$WPA_BG_SSID" password "$WPA_BG_PSK" ifname {{ interface }} name WIFI_TEST_CREATED_BY_CHECKBOX iw dev {{ interface }} link - iperf3 -c $TEST_TARGET_IPERF -t 300 -i 30 -u -b 100m -p 5050 + iperf3 -c "$TEST_TARGET_IPERF" -t 300 -i 30 -u -b 100m -p 5050 exit $? estimated_duration: 330.0 _summary: Wireless connection iperf3 test diff --git a/units/wireless/wireless-connection-netplan.pxu b/units/wireless/wireless-connection-netplan.pxu index 2127b8c..8eaf8b2 100644 --- a/units/wireless/wireless-connection-netplan.pxu +++ b/units/wireless/wireless-connection-netplan.pxu @@ -10,8 +10,8 @@ _purpose: Check system can connect to insecure 802.11ax AP using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_AX_SSID -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_AX_SSID" -d user: root environ: LD_LIBRARY_PATH OPEN_AX_SSID NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -34,8 +34,8 @@ _purpose: Check system can connect to insecure 802.11ac AP using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_AC_SSID -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_AC_SSID" -d user: root environ: LD_LIBRARY_PATH OPEN_AC_SSID NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -59,8 +59,8 @@ _purpose: Check system can connect to insecure 802.11b/g AP using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_BG_SSID -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_BG_SSID" -d user: root environ: LD_LIBRARY_PATH OPEN_BG_SSID NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -82,8 +82,8 @@ _purpose: Check system can connect to insecure 802.11n AP using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_N_SSID -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$OPEN_N_SSID" -d user: root environ: LD_LIBRARY_PATH OPEN_N_SSID NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -105,8 +105,8 @@ _purpose: Check system can connect to 802.11ax AP with wpa security using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $WPA_AX_SSID -k $WPA_AX_PSK -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_AX_SSID" -k "$WPA_AX_PSK" -d user: root environ: LD_LIBRARY_PATH WPA_AX_SSID WPA_AX_PSK NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -129,8 +129,8 @@ _purpose: Check system can connect to 802.11ac AP with wpa security using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $WPA_AC_SSID -k $WPA_AC_PSK -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_AC_SSID" -k "$WPA_AC_PSK" -d user: root environ: LD_LIBRARY_PATH WPA_AC_SSID WPA_AC_PSK NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -153,8 +153,8 @@ _purpose: Check system can connect to 802.11b/g AP with wpa security using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $WPA_BG_SSID -k $WPA_BG_PSK -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_BG_SSID" -k "$WPA_BG_PSK" -d user: root environ: LD_LIBRARY_PATH WPA_BG_SSID WPA_BG_PSK NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless @@ -176,8 +176,8 @@ _purpose: Check system can connect to 802.11n AP with wpa security using netplan plugin: shell command: - net_driver_info.py $NET_DRIVER_INFO - wifi_client_test_netplan.py -i {{ interface }} -s $WPA_N_SSID -k $WPA_N_PSK -d + net_driver_info.py "$NET_DRIVER_INFO" + wifi_client_test_netplan.py -i {{ interface }} -s "$WPA_N_SSID" -k "$WPA_N_PSK" -d user: root environ: LD_LIBRARY_PATH WPA_N_SSID WPA_N_PSK NET_DRIVER_INFO category_id: com.canonical.plainbox::wireless diff --git a/units/wwan/jobs.pxu b/units/wwan/jobs.pxu index b031385..aaa2089 100644 --- a/units/wwan/jobs.pxu +++ b/units/wwan/jobs.pxu @@ -16,7 +16,7 @@ plugin: shell user: root command: COUNT=$(wwan_tests.py count) - if [ $COUNT -eq 0 ]; then + if [ "$COUNT" -eq 0 ]; then exit 1 fi estimated_duration: 2.0 @@ -37,8 +37,8 @@ _description: will be tested to ensure a data connection can be made. plugin: shell command: - BEGIN_CONNECTION_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` - wwan_tests.py 3gpp-connection $WWAN_CONTROL_IF $WWAN_NET_IF $WWAN_APN ${{WWAN_SETUPTIME:-30}} + BEGIN_CONNECTION_TEST_TS=$(date '+%Y-%m-%d %H:%M:%S') + wwan_tests.py 3gpp-connection "$WWAN_CONTROL_IF" "$WWAN_NET_IF" "$WWAN_APN" "${{WWAN_SETUPTIME:-30}}" RETVAL=$? if [ $RETVAL -ne 0 ]; then echo "==== Service units logs ====" |