mirror of https://github.com/containers/podman.git
CI: --image-volume test: robustify
Test is failing on 1mt because of differences between 'stat' command output and /proc/mounts. Solution: compare stat %t (hex filesystem type), not %T (human-readable). This should match no matter what kernel version or version of stat on host/container. Fixes: #24611 Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
parent
569fefc783
commit
97ed067d1a
|
@ -516,7 +516,6 @@ NeedsChown | true
|
||||||
FROM $IMAGE
|
FROM $IMAGE
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
EOF
|
EOF
|
||||||
fs=$(stat -f -c %T .)
|
|
||||||
run_podman build -t volume_image $tmpdir
|
run_podman build -t volume_image $tmpdir
|
||||||
|
|
||||||
containersconf=$tmpdir/containers.conf
|
containersconf=$tmpdir/containers.conf
|
||||||
|
@ -534,15 +533,16 @@ EOF
|
||||||
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --rm volume_image stat -f -c %T /data
|
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --rm volume_image stat -f -c %T /data
|
||||||
is "$output" "tmpfs" "Should be tmpfs"
|
is "$output" "tmpfs" "Should be tmpfs"
|
||||||
|
|
||||||
# get the hostfs first so we can match it below
|
# Get the hostfs first so we can match it below. The important check is
|
||||||
|
# the HEX filesystem type (%t); readable one (%T) is for ease of debugging.
|
||||||
|
# We can't compare %T because our alpine-based testimage doesn't grok btrfs.
|
||||||
run_podman info --format {{.Store.GraphRoot}}
|
run_podman info --format {{.Store.GraphRoot}}
|
||||||
hostfs=$(stat -f -c %T $output)
|
hostfs=$(stat -f -c '%t %T' $output)
|
||||||
|
echo "# for debug: stat( $output ) = '$hostfs'"
|
||||||
|
|
||||||
# stat -f -c %T seems to just return unknown for our normal bind mount for some reason.
|
# "${foo%% *}" strips everything after the first space: "9123683e btrfs" -> "9123683e"
|
||||||
# Therefore manually parse /proc/mounts to get the real fs for the bind mount.
|
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --image-volume anonymous --rm volume_image stat -f -c '%t %T' /data
|
||||||
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --image-volume anonymous --rm volume_image \
|
assert "${output%% *}" == "${hostfs%% *}" "/data fs type should match hosts graphroot"
|
||||||
sh -c "grep ' /data ' /proc/mounts | cut -f3 -d' '"
|
|
||||||
assert "$output" == "$hostfs" "Should match hosts graphroot fs"
|
|
||||||
|
|
||||||
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --image-volume tmpfs --rm volume_image stat -f -c %T /data
|
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --image-volume tmpfs --rm volume_image stat -f -c %T /data
|
||||||
is "$output" "tmpfs" "Should be tmpfs"
|
is "$output" "tmpfs" "Should be tmpfs"
|
||||||
|
|
Loading…
Reference in New Issue