summaryrefslogtreecommitdiff
path: root/test/system/160-volumes.bats
diff options
context:
space:
mode:
authorAchilleas Tzenetopoulos <atzenetopoulos@gmail.com>2021-01-27 01:49:34 +0200
committerAchilleas Tzenetopoulos <atzenetopoulos@gmail.com>2021-01-31 16:31:43 +0200
commit9b5b03d1e03b20a80c0a0c92866136d4243e5f4a (patch)
treefe2cc038ebb626b23f6b2cb2df840b3ae4ed54bc /test/system/160-volumes.bats
parent2102e26506f392499b78297d25e24d591dee3bc8 (diff)
downloadpodman-9b5b03d1e03b20a80c0a0c92866136d4243e5f4a.tar.gz
podman-9b5b03d1e03b20a80c0a0c92866136d4243e5f4a.tar.bz2
podman-9b5b03d1e03b20a80c0a0c92866136d4243e5f4a.zip
list volumes before pruning
Signed-off-by: Achilleas Tzenetopoulos <atzenetopoulos@gmail.com>
Diffstat (limited to 'test/system/160-volumes.bats')
-rw-r--r--test/system/160-volumes.bats15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 0b7aab2fb..4952eafc2 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -214,6 +214,13 @@ EOF
run_podman volume create $vol
done
+ # Create two additional labeled volumes
+ for i in 5 6; do
+ vol=myvol${i}$(random_string)
+ v[$i]=$vol
+ run_podman volume create $vol --label "mylabel"
+ done
+
# (Assert that output is formatted, not a one-line blob: #8011)
run_podman volume inspect ${v[1]}
if [[ "${#lines[*]}" -lt 10 ]]; then
@@ -225,6 +232,14 @@ EOF
run_podman run --name c2 --volume ${v[2]}:/vol2 -v ${v[3]}:/vol3 \
$IMAGE date
+ # List available volumes for pruning after using 1,2,3
+ run_podman volume prune <<< N
+ is "$(echo $(sort <<<${lines[@]:1:3}))" "${v[4]} ${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use, lists 4,5,6"
+
+ # List available volumes for pruning after using 1,2,3 and filtering; see #8913
+ run_podman volume prune --filter label=mylabel <<< N
+ is "$(echo $(sort <<<${lines[@]:1:2}))" "${v[5]} ${v[6]}" "volume prune, with 1,2,3 in use and 4 filtered out, lists 5,6"
+
# prune should remove v4
run_podman volume prune --force
is "$output" "${v[4]}" "volume prune, with 1, 2, 3 in use, deletes only 4"