Skip to content

Commit 0888fdb

Browse files
committed
test access stdio in userns container
Signed-off-by: lifubang <[email protected]>
1 parent e9e4f3c commit 0888fdb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/integration/userns.bats

+21
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ function teardown() {
3636
fi
3737
}
3838

39+
@test "runc check stdio permission in userns [terminal=false]" {
40+
update_config ' .process.terminal = false
41+
| .process.args = ["sh", "-c", "echo errormsg > /dev/stderr"]'
42+
43+
touch log
44+
__runc create test_busybox >log 2>&1
45+
46+
runc start test_busybox
47+
[ "$status" -eq 0 ]
48+
49+
wait_for_container 10 1 test_busybox stopped
50+
51+
out=$(cat log)
52+
# Keep this to debug is useful once we have a regression about this.
53+
echo "$out" >&2
54+
55+
# We should let stdio could be accessed in user ns container.
56+
# Please see https://github.com/opencontainers/runc/issues/4475
57+
[[ "$out" = "errormsg" ]]
58+
}
59+
3960
@test "userns with simple mount" {
4061
update_config ' .process.args += ["-c", "stat /tmp/mount-1/foo.txt"]
4162
| .mounts += [{"source": "source-accessible/dir", "destination": "/tmp/mount-1", "options": ["bind"]}] '

0 commit comments

Comments
 (0)