Skip to content

Commit

Permalink
tests/integration: add tests for mount propagation flags
Browse files Browse the repository at this point in the history
Signed-off-by: Dongsu Park <dpark@linux.microsoft.com>
  • Loading branch information
dongsupark committed Jul 28, 2023
1 parent 4ba925f commit 7d00e0b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/integration/mounts_propagation.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bats

load helpers

function setup() {
requires root

setup_debian

mkdir -p rootfs/{proc,sys,tmp}
mkdir -p rootfs/tmp/mount1

update_config ' .mounts += [
{
"source": "tmpfs",
"destination": "/tmp/mount1",
"type": "tmpfs"
}
] '
}

function teardown() {
teardown_bundle
}

# https://github.com/opencontainers/runc/issues/1755
@test "runc run [tmpfs mount propagation]" {
update_config ' .process.args = ["sh", "-c", "findmnt --noheadings -o PROPAGATION /tmp/mount1"]'
# Add the shared option to the mount
update_config ' .mounts |= map((select(.destination == "/tmp/mount1") | .options += ["shared"]) // .)'

runc run test_debian
[ "$status" -eq 0 ]
[[ "$output" == *"shared"* ]]
}

0 comments on commit 7d00e0b

Please sign in to comment.