File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,26 @@ function teardown() {
3636 fi
3737}
3838
39+ @test " runc check stdio in userns [terminal=false]" {
40+ update_config ' (.. | select(.terminal? != null)) .terminal |= false
41+ | (.. | select(.[]? == "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+ out=$( cat log)
50+ # Keep this to debug is useful once we have a regression about this.
51+ echo $out >&2
52+
53+ # We should let stdio could be accessed in user ns container.
54+ # Please see https://github.com/opencontainers/runc/issues/4475
55+ # We should not get error: touch: /dev/stderr: Permission denied.
56+ [[ " $out " = " errormsg" ]]
57+ }
58+
3959@test " userns with simple mount" {
4060 update_config ' .process.args += ["-c", "stat /tmp/mount-1/foo.txt"]
4161 | .mounts += [{"source": "source-accessible/dir", "destination": "/tmp/mount-1", "options": ["bind"]}] '
You can’t perform that action at this time.
0 commit comments