Skip to content

Commit

Permalink
test/ctr.bats: fix SC2086
Browse files Browse the repository at this point in the history
This commit is brought to you by

	shellcheck -f diff ctr.bats | patch -p1

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Oct 9, 2020
1 parent 27dd454 commit 4ab4128
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/ctr.bats
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function wait_until_exit() {
[ -f "$logpath" ]
echo "$logpath :: $(cat "$logpath")"
len=$(wc -l "$logpath" | awk '{print $1}')
[ $len -lt 250 ]
[ "$len" -lt 250 ]
}

@test "ctr log max with default value" {
Expand All @@ -294,7 +294,7 @@ function wait_until_exit() {
[ -f "$logpath" ]
echo "$logpath :: $(cat "$logpath")"
len=$(wc -l "$logpath" | awk '{print $1}')
[ $len -eq 250 ]
[ "$len" -eq 250 ]
}

@test "ctr log max with minimum value" {
Expand All @@ -316,7 +316,7 @@ function wait_until_exit() {
[ -f "$logpath" ]
echo "$logpath :: $(cat "$logpath")"
len=$(wc -l "$logpath" | awk '{print $1}')
[ $len -lt 250 ]
[ "$len" -lt 250 ]
}

@test "ctr partial line logging" {
Expand Down Expand Up @@ -628,7 +628,7 @@ function wait_until_exit() {
pod_id=$(crictl runp "$TESTDATA"/sandbox_config.json)
ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_redis.json "$TESTDATA"/sandbox_config.json)
crictl start "$ctr_id"
output=$(crictl exec --sync $ctr_id grep Cap /proc/1/status)
output=$(crictl exec --sync "$ctr_id" grep Cap /proc/1/status)

# This magic value originates from the output of
# `grep CapEff /proc/self/status`
Expand All @@ -644,7 +644,7 @@ function wait_until_exit() {
ctr_id=$(crictl create "$pod_id" "$TESTDATA"/container_redis.json "$TESTDATA"/sandbox_config.json)
crictl start "$ctr_id"

output=$(crictl exec --sync $ctr_id grep Cap /proc/1/status)
output=$(crictl exec --sync "$ctr_id" grep Cap /proc/1/status)
[[ "$output" =~ 00000000002020db ]]
}

Expand Down

0 comments on commit 4ab4128

Please sign in to comment.