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 /units/power-management | |
| parent | 2b1956220674c34911ce718e065bba8370c7a4ef (diff) | |
units: Fix all jobs commands shellcheck errors
Diffstat (limited to 'units/power-management')
| -rw-r--r-- | units/power-management/jobs.pxu | 32 |
1 files changed, 18 insertions, 14 deletions
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 |
