add a test case about missing stricky bit

Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
lifubang
2023-08-03 08:46:37 +08:00
parent 6092a4b42d
commit 83137c6884
+16
View File
@@ -77,6 +77,22 @@ function teardown() {
[[ "${lines[0]}" == *'mydomainname'* ]]
}
# https://github.com/opencontainers/runc/issues/3952
@test "runc run with tmpfs" {
requires root
chmod 'a=rwx,ug+s,+t' rootfs/tmp # set all bits
mode=$(stat -c %A rootfs/tmp)
# shellcheck disable=SC2016
update_config '.process.args = ["sh", "-c", "stat -c %A /tmp"]'
update_config '.mounts += [{"destination": "/tmp", "type": "tmpfs", "source": "tmpfs", "options":["noexec","nosuid","nodev","rprivate"]}]'
runc run test_tmpfs
[ "$status" -eq 0 ]
[ "$output" = "$mode" ]
}
@test "runc run with tmpfs perms" {
# shellcheck disable=SC2016
update_config '.process.args = ["sh", "-c", "stat -c %a /tmp/test"]'