summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorCarlo Lobrano <c.lobrano@gmail.com>2022-06-17 09:54:22 +0200
committerCarlo Lobrano <c.lobrano@gmail.com>2022-06-21 17:50:55 +0200
commit4a981c490be01547c17fb0b1fc4d1c3bfbf3551e (patch)
tree30f5c0a94a89d8a361272dd9243602e34890d927 /test/e2e
parent78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc (diff)
downloadpodman-4a981c490be01547c17fb0b1fc4d1c3bfbf3551e.tar.gz
podman-4a981c490be01547c17fb0b1fc4d1c3bfbf3551e.tar.bz2
podman-4a981c490be01547c17fb0b1fc4d1c3bfbf3551e.zip
allow filter networks by dangling status
add the ability to filter networks by their dangling status via: `network ls --filter dangling=true/false` Fixes: #14595 Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/network_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 715455521..2fdd62f7e 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -163,6 +163,26 @@ var _ = Describe("Podman network", func() {
Expect(session.OutputToString()).To(Not(ContainSubstring(name)))
})
+ It("podman network list --filter dangling", func() {
+ name, path := generateNetworkConfig(podmanTest)
+ defer removeConf(path)
+
+ session := podmanTest.Podman([]string{"network", "ls", "--filter", "dangling=true"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(ContainSubstring(name))
+
+ session = podmanTest.Podman([]string{"network", "ls", "--filter", "dangling=false"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).NotTo(ContainSubstring(name))
+
+ session = podmanTest.Podman([]string{"network", "ls", "--filter", "dangling=foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).To(ExitWithError())
+ Expect(session.ErrorToString()).To(ContainSubstring(`invalid dangling filter value "foo"`))
+ })
+
It("podman network ID test", func() {
net := "networkIDTest"
// the network id should be the sha256 hash of the network name