From a45d22a1ddd2840cf8c3a38540aa8683cc0d5c7d Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 18 Jan 2021 18:52:06 +0100 Subject: podman network exists Add podman network exists command with remote support. Signed-off-by: Paul Holzinger --- test/e2e/network_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index 4e8ab5ad5..98512f01a 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -456,4 +456,20 @@ var _ = Describe("Podman network", func() { nc.WaitWithDefaultTimeout() Expect(nc.ExitCode()).To(Equal(0)) }) + + It("podman network exists", func() { + net := "net" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", net}) + session.WaitWithDefaultTimeout() + defer podmanTest.removeCNINetwork(net) + Expect(session.ExitCode()).To(BeZero()) + + session = podmanTest.Podman([]string{"network", "exists", net}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"network", "exists", stringid.GenerateNonCryptoID()}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(1)) + }) }) -- cgit v1.2.3-54-g00ecf