tests/int/*bats: ignore SC2016
Ignore the shellcheck warnings like this one: > In tty.bats line 32: > update_config '(.. | select(.[]? == "sh")) += ["-c", "stat -c %u:%g $(tty) | tr : \\\\n"]' > ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that. While at it, fix some minor whitespace issues in tty.bats. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
598d8b73a5
commit
f36fb46bdf
|
@ -170,6 +170,7 @@ function setup() {
|
|||
[[ ${lines[0]} == "0::/foo" ]]
|
||||
|
||||
# teardown: remove "/foo"
|
||||
# shellcheck disable=SC2016
|
||||
runc exec test_cgroups_group sh -uxc 'echo -memory > /sys/fs/cgroup/cgroup.subtree_control; for f in $(cat /sys/fs/cgroup/foo/cgroup.procs); do echo $f > /sys/fs/cgroup/cgroup.procs; done; rmdir /sys/fs/cgroup/foo'
|
||||
runc exec test_cgroups_group test ! -d /sys/fs/cgroup/foo
|
||||
[ "$status" -eq 0 ]
|
||||
|
|
|
@ -27,6 +27,7 @@ function teardown() {
|
|||
|
||||
function setup_pipes() {
|
||||
# The changes to 'terminal' are needed for running in detached mode
|
||||
# shellcheck disable=SC2016
|
||||
update_config ' (.. | select(.terminal? != null)) .terminal |= false
|
||||
| (.. | select(.[]? == "sh")) += ["-c", "for i in `seq 10`; do read xxx || continue; echo ponG $xxx; done"]'
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ function teardown() {
|
|||
(__runc events test_busybox > events.log) &
|
||||
(
|
||||
retry 10 1 eval "grep -q 'test_busybox' events.log"
|
||||
# shellcheck disable=SC2016
|
||||
__runc exec -d test_busybox sh -c 'test=$(dd if=/dev/urandom ibs=5120k)'
|
||||
retry 10 1 eval "grep -q 'oom' events.log"
|
||||
__runc delete -f test_busybox
|
||||
|
|
|
@ -13,7 +13,8 @@ function teardown() {
|
|||
|
||||
@test "runc run [tty ptsname]" {
|
||||
# Replace sh script with readlink.
|
||||
update_config '(.. | select(.[]? == "sh")) += ["-c", "for file in /proc/self/fd/[012]; do readlink $file; done"]'
|
||||
# shellcheck disable=SC2016
|
||||
update_config '(.. | select(.[]? == "sh")) += ["-c", "for file in /proc/self/fd/[012]; do readlink $file; done"]'
|
||||
|
||||
# run busybox
|
||||
runc run test_busybox
|
||||
|
@ -29,7 +30,8 @@ function teardown() {
|
|||
[[ "$ROOTLESS" -ne 0 ]] && requires rootless_idmap
|
||||
|
||||
# Replace sh script with stat.
|
||||
update_config '(.. | select(.[]? == "sh")) += ["-c", "stat -c %u:%g $(tty) | tr : \\\\n"]'
|
||||
# shellcheck disable=SC2016
|
||||
update_config '(.. | select(.[]? == "sh")) += ["-c", "stat -c %u:%g $(tty) | tr : \\\\n"]'
|
||||
|
||||
# run busybox
|
||||
runc run test_busybox
|
||||
|
@ -46,7 +48,8 @@ function teardown() {
|
|||
# replace "uid": 0 with "uid": 1000
|
||||
# and do a similar thing for gid.
|
||||
# Replace sh script with stat.
|
||||
update_config ' (.. | select(.uid? == 0)) .uid |= 1000
|
||||
# shellcheck disable=SC2016
|
||||
update_config ' (.. | select(.uid? == 0)) .uid |= 1000
|
||||
| (.. | select(.gid? == 0)) .gid |= 100
|
||||
| (.. | select(.[]? == "sh")) += ["-c", "stat -c %u:%g $(tty) | tr : \\\\n"]'
|
||||
|
||||
|
@ -67,7 +70,8 @@ function teardown() {
|
|||
testcontainer test_busybox running
|
||||
|
||||
# run the exec
|
||||
runc exec -t test_busybox sh -c 'for file in /proc/self/fd/[012]; do readlink $file; done'
|
||||
# shellcheck disable=SC2016
|
||||
runc exec -t test_busybox sh -c 'for file in /proc/self/fd/[012]; do readlink $file; done'
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ /dev/pts/+ ]]
|
||||
[[ ${lines[1]} =~ /dev/pts/+ ]]
|
||||
|
@ -87,7 +91,8 @@ function teardown() {
|
|||
testcontainer test_busybox running
|
||||
|
||||
# run the exec
|
||||
runc exec -t test_busybox sh -c 'stat -c %u:%g $(tty) | tr : \\n'
|
||||
# shellcheck disable=SC2016
|
||||
runc exec -t test_busybox sh -c 'stat -c %u:%g $(tty) | tr : \\n'
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ 0 ]]
|
||||
[[ ${lines[1]} =~ 5 ]]
|
||||
|
@ -99,8 +104,9 @@ 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'
|
||||
| (.. | select(.gid? == 0)) .gid |= 100'
|
||||
|
||||
# run busybox detached
|
||||
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
|
||||
|
@ -110,6 +116,7 @@ function teardown() {
|
|||
testcontainer test_busybox running
|
||||
|
||||
# run the exec
|
||||
# shellcheck disable=SC2016
|
||||
runc exec -t test_busybox sh -c 'stat -c %u:%g $(tty) | tr : \\n'
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ 1000 ]]
|
||||
|
@ -197,7 +204,7 @@ EOF
|
|||
@test "runc run [terminal=false]" {
|
||||
# Disable terminal creation.
|
||||
# Replace sh script with sleep.
|
||||
|
||||
|
||||
update_config ' (.. | select(.terminal? != null)) .terminal |= false
|
||||
| (.. | select(.[]? == "sh")) += ["sleep", "1000s"]
|
||||
| del(.. | select(.? == "sh"))'
|
||||
|
@ -219,7 +226,7 @@ EOF
|
|||
# Disable terminal creation.
|
||||
# Replace sh script with sleep.
|
||||
update_config ' (.. | select(.terminal? != null)) .terminal |= false
|
||||
| (.. | select(.[]? == "sh")) += ["sleep", "1000s"]
|
||||
| (.. | select(.[]? == "sh")) += ["sleep", "1000s"]
|
||||
| del(.. | select(.? == "sh"))'
|
||||
|
||||
# Make sure that the handling of detached IO is done properly. See #1354.
|
||||
|
|
Loading…
Reference in New Issue