File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff 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"]}] '
You can’t perform that action at this time.
0 commit comments