Fix readonly=false failure

There was a huge cut and paste of mount options which were not constent
in parsing tmpfs, bind and volume mounts.  Consolidated into a single
function to guarantee all parse the same.

Fixes: https://github.com/containers/podman/issues/18995

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-06-27 08:40:10 -04:00
parent 4dc2e08618
commit bcb89fc8b2
2 changed files with 163 additions and 228 deletions

View File

@ -84,6 +84,22 @@ load helpers
is "$output" "" "podman image mount, no args, after umount"
}
@test "podman run --mount ro=false " {
local volpath=/path/in/container
local stdopts="type=volume,destination=$volpath"
# Variations on a theme (not by Paganini). All of these should fail.
for varopt in readonly readonly=true ro=true ro rw=false;do
run_podman 1 run --rm -q --mount $stdopts,$varopt $IMAGE touch $volpath/a
is "$output" "touch: $volpath/a: Read-only file system" "with $varopt"
done
# All of these should pass
for varopt in rw rw=true ro=false readonly=false;do
run_podman run --rm -q --mount $stdopts,$varopt $IMAGE touch $volpath/a
done
}
@test "podman run --mount image" {
skip_if_rootless "too hard to test rootless"