mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
add a test case about missing stricky bit
Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
@@ -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"]'
|
||||
|
||||
Reference in New Issue
Block a user