Skip to content

Commit e949339

Browse files
authored
Merge pull request #2561 from kolyshkin/shellcheck-followup
shellcheck CI files
2 parents 2265daa + b8efb02 commit e949339

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

tests/integration/checkpoint.bats

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ function simple_cr() {
6161

6262
testcontainer test_busybox running
6363

64-
# shellcheck disable=SC2034
65-
for i in $(seq 2); do
64+
for _ in $(seq 2); do
6665
# checkpoint the running container
6766
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox
6867
grep -B 5 Error ./work-dir/dump.log || true
@@ -243,8 +242,7 @@ function simple_cr() {
243242

244243
testcontainer test_busybox running
245244

246-
# shellcheck disable=SC2034
247-
for i in $(seq 2); do
245+
for _ in $(seq 2); do
248246
# checkpoint the running container; this automatically tells CRIU to
249247
# handle the network namespace defined in config.json as an external
250248
runc --criu "$CRIU" checkpoint --work-path ./work-dir test_busybox

tests/integration/delete.bats

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ function teardown() {
6161

6262
local subsystems="memory freezer"
6363

64-
for i in $(seq 1); do
65-
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
64+
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
6665
[ "$status" -eq 0 ]
6766

6867
testcontainer test_busybox running
@@ -89,9 +88,9 @@ EOF
8988

9089
for s in ${subsystems}; do
9190
name=CGROUP_${s^^}
92-
eval path=\$${name}/foo
93-
echo $path
94-
[ -d ${path} ] || fail "test failed to create memory sub-cgroup"
91+
eval path=\$"${name}"/foo
92+
# shellcheck disable=SC2154
93+
[ -d "${path}" ] || fail "test failed to create memory sub-cgroup ($path not found)"
9594
done
9695

9796
runc delete --force test_busybox
@@ -102,8 +101,6 @@ EOF
102101
run find /sys/fs/cgroup -wholename '*testbusyboxdelete*' -type d
103102
[ "$status" -eq 0 ]
104103
[ "$output" = "" ] || fail "cgroup not cleaned up correctly: $output"
105-
106-
done
107104
}
108105

109106
@test "runc delete --force in cgroupv2 with subcgroups" {

0 commit comments

Comments
 (0)