aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/network_connect_disconnect_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-29 06:56:15 -0400
committerGitHub <noreply@github.com>2022-08-29 06:56:15 -0400
commite78363d24ce631c36579a294864af159f180a535 (patch)
treed1a6fa18e113447c71f22f785b1bddc2ea133da6 /test/e2e/network_connect_disconnect_test.go
parent3a6342062821cec7670bd9b4a5f3234866a8ed8e (diff)
parent78aec2130242b81659bd199c6c8605c76e681ff6 (diff)
downloadpodman-e78363d24ce631c36579a294864af159f180a535.tar.gz
podman-e78363d24ce631c36579a294864af159f180a535.tar.bz2
podman-e78363d24ce631c36579a294864af159f180a535.zip
Merge pull request #15516 from kubealex/handle-connected-network
Handle an already connected network in libpod API
Diffstat (limited to 'test/e2e/network_connect_disconnect_test.go')
-rw-r--r--test/e2e/network_connect_disconnect_test.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go
index ece1b519d..30a5c6482 100644
--- a/test/e2e/network_connect_disconnect_test.go
+++ b/test/e2e/network_connect_disconnect_test.go
@@ -157,7 +157,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
Expect(con.ErrorToString()).To(ContainSubstring(`"slirp4netns" is not supported: invalid network mode`))
})
- It("podman connect on a container that already is connected to the network should error", func() {
+ It("podman connect on a container that already is connected to the network should error after init", func() {
netName := "aliasTest" + stringid.GenerateNonCryptoID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
@@ -177,7 +177,15 @@ var _ = Describe("Podman network connect and disconnect", func() {
con := podmanTest.Podman([]string{"network", "connect", netName, "test"})
con.WaitWithDefaultTimeout()
- Expect(con).Should(ExitWithError())
+ Expect(con).Should(Exit(0))
+
+ init := podmanTest.Podman([]string{"init", "test"})
+ init.WaitWithDefaultTimeout()
+ Expect(init).Should(Exit(0))
+
+ con2 := podmanTest.Podman([]string{"network", "connect", netName, "test"})
+ con2.WaitWithDefaultTimeout()
+ Expect(con2).Should(ExitWithError())
})
It("podman network connect", func() {