@@ -516,7 +516,6 @@ NeedsChown | true
516516FROM $IMAGE
517517VOLUME /data
518518EOF
519- fs=$( stat -f -c %T .)
520519 run_podman build -t volume_image $tmpdir
521520
522521 containersconf=$tmpdir /containers.conf
@@ -534,15 +533,16 @@ EOF
534533 CONTAINERS_CONF_OVERRIDE=" $containersconf " run_podman run --rm volume_image stat -f -c %T /data
535534 is " $output " " tmpfs" " Should be tmpfs"
536535
537- # get the hostfs first so we can match it below
536+ # Get the hostfs first so we can match it below. The important check is
537+ # the HEX filesystem type (%t); readable one (%T) is for ease of debugging.
538+ # We can't compare %T because our alpine-based testimage doesn't grok btrfs.
538539 run_podman info --format {{.Store.GraphRoot}}
539- hostfs=$( stat -f -c %T $output )
540+ hostfs=$( stat -f -c ' %t %T' $output )
541+ echo " # for debug: stat( $output ) = '$hostfs '"
540542
541- # stat -f -c %T seems to just return unknown for our normal bind mount for some reason.
542- # Therefore manually parse /proc/mounts to get the real fs for the bind mount.
543- CONTAINERS_CONF_OVERRIDE=" $containersconf " run_podman run --image-volume anonymous --rm volume_image \
544- sh -c " grep ' /data ' /proc/mounts | cut -f3 -d' '"
545- assert " $output " == " $hostfs " " Should match hosts graphroot fs"
543+ # "${foo%% *}" strips everything after the first space: "9123683e btrfs" -> "9123683e"
544+ CONTAINERS_CONF_OVERRIDE=" $containersconf " run_podman run --image-volume anonymous --rm volume_image stat -f -c ' %t %T' /data
545+ assert " ${output%% * } " == " ${hostfs%% * } " " /data fs type should match hosts graphroot"
546546
547547 CONTAINERS_CONF_OVERRIDE=" $containersconf " run_podman run --image-volume tmpfs --rm volume_image stat -f -c %T /data
548548 is " $output " " tmpfs" " Should be tmpfs"
0 commit comments