Skip to content

Commit 83137c6

Browse files
committed
add a test case about missing stricky bit
Signed-off-by: lifubang <[email protected]>
1 parent 6092a4b commit 83137c6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/integration/run.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ function teardown() {
7777
[[ "${lines[0]}" == *'mydomainname'* ]]
7878
}
7979

80+
# https://github.com/opencontainers/runc/issues/3952
81+
@test "runc run with tmpfs" {
82+
requires root
83+
84+
chmod 'a=rwx,ug+s,+t' rootfs/tmp # set all bits
85+
mode=$(stat -c %A rootfs/tmp)
86+
87+
# shellcheck disable=SC2016
88+
update_config '.process.args = ["sh", "-c", "stat -c %A /tmp"]'
89+
update_config '.mounts += [{"destination": "/tmp", "type": "tmpfs", "source": "tmpfs", "options":["noexec","nosuid","nodev","rprivate"]}]'
90+
91+
runc run test_tmpfs
92+
[ "$status" -eq 0 ]
93+
[ "$output" = "$mode" ]
94+
}
95+
8096
@test "runc run with tmpfs perms" {
8197
# shellcheck disable=SC2016
8298
update_config '.process.args = ["sh", "-c", "stat -c %a /tmp/test"]'

0 commit comments

Comments
 (0)