summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-26 05:11:50 -0400
committerGitHub <noreply@github.com>2020-06-26 05:11:50 -0400
commitbb11b428798094f33b3ec6102d2e52a3baf46324 (patch)
treebc08687ddf003e3c0b7612ba9e8cffb25f581f5f /test
parent4db296fab3ca5e201f76931f71ea3bcb58e43a87 (diff)
parentd78e83f47d487c1680ae0e2a1db42ef9d70caf30 (diff)
downloadpodman-bb11b428798094f33b3ec6102d2e52a3baf46324.tar.gz
podman-bb11b428798094f33b3ec6102d2e52a3baf46324.tar.bz2
podman-bb11b428798094f33b3ec6102d2e52a3baf46324.zip
Merge pull request #6756 from mheon/add_dangling_filter
Add support for dangling filter to volumes
Diffstat (limited to 'test')
-rw-r--r--test/e2e/volume_ls_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index 7664e64bb..d2d75af9e 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -1,6 +1,7 @@
package integration
import (
+ "fmt"
"os"
. "github.com/containers/libpod/test/utils"
@@ -82,4 +83,30 @@ var _ = Describe("Podman volume ls", func() {
Expect(len(session.OutputToStringArray())).To(Equal(2))
Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
})
+
+ It("podman volume ls with --filter dangling", func() {
+ volName1 := "volume1"
+ session := podmanTest.Podman([]string{"volume", "create", volName1})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ volName2 := "volume2"
+ session2 := podmanTest.Podman([]string{"volume", "create", volName2})
+ session2.WaitWithDefaultTimeout()
+ Expect(session2.ExitCode()).To(Equal(0))
+
+ ctr := podmanTest.Podman([]string{"create", "-v", fmt.Sprintf("%s:/test", volName2), ALPINE, "sh"})
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+
+ lsNoDangling := podmanTest.Podman([]string{"volume", "ls", "--filter", "dangling=false", "--quiet"})
+ lsNoDangling.WaitWithDefaultTimeout()
+ Expect(lsNoDangling.ExitCode()).To(Equal(0))
+ Expect(lsNoDangling.OutputToString()).To(ContainSubstring(volName2))
+
+ lsDangling := podmanTest.Podman([]string{"volume", "ls", "--filter", "dangling=true", "--quiet"})
+ lsDangling.WaitWithDefaultTimeout()
+ Expect(lsDangling.ExitCode()).To(Equal(0))
+ Expect(lsDangling.OutputToString()).To(ContainSubstring(volName1))
+ })
})