Skip to content

Commit

Permalink
Merge pull request #17343 from giuseppe/fix-cgroup-ro-test-cgroupv1
Browse files Browse the repository at this point in the history
test: adapt test to work on cgroupv1
  • Loading branch information
openshift-merge-robot authored Feb 3, 2023
2 parents 78458e0 + ed1f769 commit 90d3380
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,17 @@ EOF
}

@test "podman run --net=host --cgroupns=host with read only cgroupfs" {
# verify that the last /sys/fs/cgroup mount is read-only
run_podman run --net=host --cgroupns=host --rm $IMAGE sh -c "grep ' / /sys/fs/cgroup ' /proc/self/mountinfo | tail -n 1 | grep '/sys/fs/cgroup ro'"
skip_if_rootless_cgroupsv1

if is_cgroupsv1; then
# verify that the memory controller is mounted read-only
run_podman run --net=host --cgroupns=host --rm $IMAGE cat /proc/self/mountinfo
assert "$output" =~ "/sys/fs/cgroup/memory ro.* cgroup cgroup"
else
# verify that the last /sys/fs/cgroup mount is read-only
run_podman run --net=host --cgroupns=host --rm $IMAGE sh -c "grep ' / /sys/fs/cgroup ' /proc/self/mountinfo | tail -n 1"
assert "$output" =~ "/sys/fs/cgroup ro"
fi
}

@test "podman run - rootfs with idmapped mounts" {
Expand Down

0 comments on commit 90d3380

Please sign in to comment.