tests/int: rm some "shellcheck disable" annotations

Those are no longer needed with shellcheck v0.10.0 (possibly with an
earlier version, too, but I am too lazy to check that).

While at it, fix a typo in the comment.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-03-10 14:11:37 -07:00
parent b48dd65114
commit af386d1df1
4 changed files with 1 additions and 8 deletions
-2
View File
@@ -21,7 +21,6 @@ function teardown() {
@test "runc create [hook fails]" {
for hook in prestart createRuntime createContainer; do
echo "testing hook $hook"
# shellcheck disable=SC2016
update_config '.hooks |= {"'$hook'": [{"path": "/bin/true"}, {"path": "/bin/false"}]}'
runc create --console-socket "$CONSOLE_SOCKET" test_hooks
[ "$status" -ne 0 ]
@@ -34,7 +33,6 @@ function teardown() {
# All hooks except Poststop.
for hook in prestart createRuntime createContainer startContainer poststart; do
echo "testing hook $hook"
# shellcheck disable=SC2016
update_config '.hooks |= {"'$hook'": [{"path": "/bin/true"}, {"path": "/bin/false"}]}'
runc run "test_hook-$hook"
[[ "$output" != "Hello World" ]]
-4
View File
@@ -84,7 +84,6 @@ function teardown() {
chmod 'a=rwx,ug+s,+t' rootfs/tmp # set all bits
mode=$(stat -c %A rootfs/tmp)
# shellcheck disable=SC2016
update_config '.process.args = ["sh", "-c", "stat -c %A /tmp"]'
update_config '.mounts += [{"destination": "/tmp", "type": "tmpfs", "source": "tmpfs", "options":["noexec","nosuid","nodev","rprivate"]}]'
@@ -94,7 +93,6 @@ function teardown() {
}
@test "runc run with tmpfs perms" {
# shellcheck disable=SC2016
update_config '.process.args = ["sh", "-c", "stat -c %a /tmp/test"]'
update_config '.mounts += [{"destination": "/tmp/test", "type": "tmpfs", "source": "tmpfs", "options": ["mode=0444"]}]'
@@ -113,14 +111,12 @@ function teardown() {
# so it should use the directory's perms.
update_config '.mounts[-1].options = []'
chmod 0710 rootfs/tmp/test
# shellcheck disable=SC2016
runc run test_tmpfs
[ "$status" -eq 0 ]
[ "${lines[0]}" = "710" ]
# Add back the mode on the mount, and it should use that instead.
# Just for fun, use different perms than was used earlier.
# shellcheck disable=SC2016
update_config '.mounts[-1].options = ["mode=0410"]'
runc run test_tmpfs
[ "$status" -eq 0 ]
+1 -1
View File
@@ -183,7 +183,7 @@ function scmp_act_notify_template() {
@test "runc run [seccomp] (SCMP_ACT_NOTIFY startContainer hook)" {
# shellcheck disable=SC2016
# We use single quotes to properly delimit the $1 param to
# update_config(), but this shellshcheck is quite silly and fails if the
# update_config(), but shellcheck is quite silly and fails if the
# multi-line string includes some $var (even when it is properly outside of the
# single quotes) or when we use this syntax to execute commands in the
# string: $(command).
-1
View File
@@ -123,7 +123,6 @@ function teardown() {
# replace "uid": 0 with "uid": 1000
# and do a similar thing for gid.
# shellcheck disable=SC2016
update_config ' (.. | select(.uid? == 0)) .uid |= 1000
| (.. | select(.gid? == 0)) .gid |= 100'