Files
runc/tests/integration/mounts.bats
T
Akihiro Suda 9d4c02cf29 Merge pull request #2570 from EduardoVega/2246-fix-chmod-ro-tmpfs-mount
Fix mount error when chmod RO tmpfs
2020-10-26 18:19:16 +09:00

32 lines
788 B
Bash

#!/usr/bin/env bats
load helpers
function setup() {
teardown_busybox
setup_busybox
}
function teardown() {
teardown_busybox
teardown_running_container test_bind_mount
}
@test "runc run [bind mount]" {
update_config ' .mounts += [{"source": ".", "destination": "/tmp/bind", "options": ["bind"]}]
| .process.args |= ["ls", "/tmp/bind/config.json"]'
runc run test_bind_mount
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *'/tmp/bind/config.json'* ]]
}
@test "runc run [ro tmpfs mount]" {
update_config ' .mounts += [{"source": "tmpfs", "destination": "/mnt", "type": "tmpfs", "options": ["ro", "nodev", "nosuid", "mode=755"]}]
| .process.args |= ["grep", "^tmpfs /mnt", "/proc/mounts"]'
runc run test_ro_tmpfs_mount
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *'ro,'* ]]
}