From 5e53e6592af16d78ea41eb3a87cb368bb6a628e3 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 6 Jun 2023 17:39:47 -0700 Subject: [PATCH] ci: bump shellcheck to 0.9.0, fix new SC2016 warnings Signed-off-by: Kir Kolyshkin --- .github/workflows/validate.yml | 4 ++-- tests/integration/helpers.bash | 2 +- tests/integration/hooks.bats | 10 +++++----- tests/integration/update.bats | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 591a11bed62..0dd805e810f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -83,9 +83,9 @@ jobs: - uses: actions/checkout@v3 - name: install shellcheck env: - VERSION: v0.8.0 + VERSION: v0.9.0 BASEURL: https://github.com/koalaman/shellcheck/releases/download - SHA256: f4bce23c11c3919c1b20bcb0f206f6b44c44e26f2bc95f8aa708716095fa0651 + SHA256: 7087178d54de6652b404c306233264463cb9e7a9afeb259bb663cc4dbfd64149 run: | mkdir ~/bin curl -sSfL --retry 5 $BASEURL/$VERSION/shellcheck-$VERSION.linux.x86_64.tar.xz | diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 7b1cc4a088f..e2e6c86bb53 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -287,7 +287,7 @@ function check_cpu_quota() { fi check_cgroup_value "cpu.max" "$quota $period" else - check_cgroup_value "cpu.cfs_quota_us" $quota + check_cgroup_value "cpu.cfs_quota_us" "$quota" check_cgroup_value "cpu.cfs_period_us" "$period" fi # systemd values are the same for v1 and v2 diff --git a/tests/integration/hooks.bats b/tests/integration/hooks.bats index 1850f33e691..2ebc174e5a1 100644 --- a/tests/integration/hooks.bats +++ b/tests/integration/hooks.bats @@ -14,9 +14,9 @@ function setup() { function teardown() { if [ -v LIBPATH ]; then - umount "$LIBPATH"/$HOOKLIBCR.1.0.0 &>/dev/null || true - umount "$LIBPATH"/$HOOKLIBCC.1.0.0 &>/dev/null || true - rm -f $HOOKLIBCR.1.0.0 $HOOKLIBCC.1.0.0 + umount "$LIBPATH/$HOOKLIBCR".1.0.0 &>/dev/null || true + umount "$LIBPATH/$HOOKLIBCC".1.0.0 &>/dev/null || true + rm -f "$HOOKLIBCR".1.0.0 "$HOOKLIBCC".1.0.0 unset LIBPATH HOOKLIBCR HOOKLIBCC fi teardown_bundle @@ -52,8 +52,8 @@ function teardown() { [ "$status" -eq 0 ] echo "Checking create-runtime library" - echo "$output" | grep $HOOKLIBCR + echo "$output" | grep "$HOOKLIBCR" echo "Checking create-container library" - echo "$output" | grep $HOOKLIBCC + echo "$output" | grep "$HOOKLIBCC" } diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 56d9f98d43e..ba7a41809f4 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -99,8 +99,8 @@ function setup() { # try to remove memory swap limit runc update test_update --memory-swap -1 [ "$status" -eq 0 ] - check_cgroup_value "$MEM_SWAP" $SYSTEM_MEM - check_systemd_value "$SD_MEM_SWAP" $SD_UNLIMITED + check_cgroup_value "$MEM_SWAP" "$SYSTEM_MEM" + check_systemd_value "$SD_MEM_SWAP" "$SD_UNLIMITED" # update memory swap if [ -v CGROUP_V2 ]; then @@ -123,13 +123,13 @@ function setup() { [ "$status" -eq 0 ] # check memory limit is gone - check_cgroup_value $MEM_LIMIT $SYSTEM_MEM - check_systemd_value $SD_MEM_LIMIT $SD_UNLIMITED + check_cgroup_value "$MEM_LIMIT" "$SYSTEM_MEM" + check_systemd_value "$SD_MEM_LIMIT" "$SD_UNLIMITED" # check swap memory limited is gone if [ "$HAVE_SWAP" = "yes" ]; then - check_cgroup_value $MEM_SWAP $SYSTEM_MEM - check_systemd_value "$SD_MEM_SWAP" $SD_UNLIMITED + check_cgroup_value "$MEM_SWAP" "$SYSTEM_MEM" + check_systemd_value "$SD_MEM_SWAP" "$SD_UNLIMITED" fi # update pids limit