Skip to content

Commit

Permalink
tests/int: add rootless + host pidns test case
Browse files Browse the repository at this point in the history
For the fix, see previous commit. Without the fix, this test case fails:

> container_linux.go:380: starting container process caused:
> process_linux.go:545: container init caused: readonly path /proc/bus:
> operation not permitted

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Apr 15, 2021
1 parent c1460b0 commit b0bdf5f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/integration/start_hello.bats
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,20 @@ function teardown() {

[[ "$(cat pid.txt)" =~ [0-9]+ ]]
}

# https://github.com/opencontainers/runc/pull/2897
@test "runc run [rootless with host pidns]" {
requires rootless_no_features

# Remove pid namespace, and replace /proc mount
# with a bind mount from the host.
update_config ' .linux.namespaces -= [{"type": "pid"}]
| .mounts |= map((select(.type == "proc")
| .type = "none"
| .source = "/proc"
| .options = ["rbind", "nosuid", "nodev", "noexec"]
) // .)'

runc run test_hello
[ "$status" -eq 0 ]
}

0 comments on commit b0bdf5f

Please sign in to comment.