diff options
author | Boaz Shuster <boaz.shuster.github@gmail.com> | 2022-06-15 12:40:11 +0300 |
---|---|---|
committer | Boaz Shuster <boaz.shuster.github@gmail.com> | 2022-06-27 21:34:39 +0300 |
commit | 3b10c1b78a8aa2acab59d1a99a010437a73a50b8 (patch) | |
tree | 8f0850f53d3ad4f978c25e11555a84b2d1d1f61d /test/system | |
parent | 9c4b8a29b06c179725983e7fa8fadf7ee68d9863 (diff) | |
download | podman-3b10c1b78a8aa2acab59d1a99a010437a73a50b8.tar.gz podman-3b10c1b78a8aa2acab59d1a99a010437a73a50b8.tar.bz2 podman-3b10c1b78a8aa2acab59d1a99a010437a73a50b8.zip |
Use Regexp in volume ls --filter name
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/160-volumes.bats | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index 797883ec6..da60112a0 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -64,6 +64,29 @@ function teardown() { } +# Filter volumes by name +@test "podman volume filter --name" { + suffix=$(random_string) + prefix="volume" + + for i in 1 2; do + myvolume=${prefix}_${i}_${suffix} + run_podman volume create $myvolume + is "$output" "$myvolume" "output from volume create $i" + done + + run_podman volume ls --filter name=${prefix}_1.+ --format "{{.Name}}" + is "$output" "${prefix}_1_${suffix}" "--filter name=${prefix}_1.+ shows only one volume" + + # The _1* is intentional as asterisk has different meaning in glob and regexp. Make sure this is regexp + run_podman volume ls --filter name=${prefix}_1* --format "{{.Name}}" + is "$output" "${prefix}_1_${suffix}.*${prefix}_2_${suffix}.*" "--filter name=${prefix}_1* shows ${prefix}_1_${suffix} and ${prefix}_2_${suffix}" + + for i in 1 2; do + run_podman volume rm ${prefix}_${i}_${suffix} + done +} + # Named volumes @test "podman volume create / run" { myvolume=myvol$(random_string) |