mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-12 09:46:25 +08:00
7b8c4e980a
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
32 lines
786 B
Bash
32 lines
786 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,'* ]]
|
|
}
|