diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-06-02 10:16:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 10:16:28 -0400 |
commit | 13cdf862e6dbf31902405e4204a5bd87f62a9759 (patch) | |
tree | e539f745d2f5650d74d004c41caae17a1cf77105 /test/system | |
parent | 8b972ff8ca2d44d7d724d84e00bec3afb90feb20 (diff) | |
parent | fb163976f4d46bbcbd793bd7a07a2c688d7924b5 (diff) | |
download | podman-13cdf862e6dbf31902405e4204a5bd87f62a9759.tar.gz podman-13cdf862e6dbf31902405e4204a5bd87f62a9759.tar.bz2 podman-13cdf862e6dbf31902405e4204a5bd87f62a9759.zip |
Merge pull request #14301 from rhatdan/volume
Support setting image_volume_mode in containers.conf
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/160-volumes.bats | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index 5b0460723..797883ec6 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -411,4 +411,43 @@ NeedsChown | true fi } +@test "podman --image-volume" { + tmpdir=$PODMAN_TMPDIR/volume-test + mkdir -p $tmpdir + containerfile=$tmpdir/Containerfile + cat >$containerfile <<EOF +FROM $IMAGE +VOLUME /data +EOF + fs=$(stat -f -c %T .) + run_podman build -t volume_image $tmpdir + + containersconf=$tmpdir/containers.conf + cat >$containersconf <<EOF +[engine] +image_volume_mode="tmpfs" +EOF + + run_podman run --image-volume tmpfs --rm volume_image stat -f -c %T /data + is "$output" "tmpfs" "Should be tmpfs" + + run_podman 1 run --image-volume ignore --rm volume_image stat -f -c %T /data + is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exists" + + CONTAINERS_CONF="$containersconf" run_podman run --rm volume_image stat -f -c %T /data + is "$output" "tmpfs" "Should be tmpfs" + + CONTAINERS_CONF="$containersconf" run_podman run --image-volume bind --rm volume_image stat -f -c %T /data + assert "$output" != "tmpfs" "Should match hosts $fs" + + CONTAINERS_CONF="$containersconf" run_podman run --image-volume tmpfs --rm volume_image stat -f -c %T /data + is "$output" "tmpfs" "Should be tmpfs" + + CONTAINERS_CONF="$containersconf" run_podman 1 run --image-volume ignore --rm volume_image stat -f -c %T /data + is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exists" + + run_podman rm --all --force -t 0 + run_podman image rm --force localhost/volume_image +} + # vim: filetype=sh |