test/system: fix podman --image-volume to allow tmpfs storage
The test check the the default volume is not on tmpfs, however what it should really check that the volume is on our container storage fs. It is possible that users run the storage on top of tmpfs so this test always failed there. The better check is to compare the fs from the graphroot and the volume. Unfortunately, for unknown reasons stat -f -c %T returns UNKNOWN and not the actual fs. I have no idea why, to work around that we now parse /proc/mounts manually for the fs. Not nice but at least it works correctly. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
e810b340ef
commit
fad1f757cc
|
|
@ -534,8 +534,15 @@ EOF
|
|||
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --rm volume_image stat -f -c %T /data
|
||||
is "$output" "tmpfs" "Should be tmpfs"
|
||||
|
||||
CONTAINERS_CONF_OVERRIDE="$containersconf" run_podman run --image-volume anonymous --rm volume_image stat -f -c %T /data
|
||||
assert "$output" != "tmpfs" "Should match hosts $fs"
|
||||
# get the hostfs first so we can match it below
|
||||
run_podman info --format {{.Store.GraphRoot}}
|
||||
hostfs=$(stat -f -c %T $output)
|
||||
|
||||
# stat -f -c %T seems to just return unknown for our normal bind mount for some reason.
|
||||
# Therfore 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 \
|
||||
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
|
||||
is "$output" "tmpfs" "Should be tmpfs"
|
||||
|
|
|
|||
Loading…
Reference in New Issue