diff options
author | Alessandro Rossi <al.rossi87@gmail.com> | 2022-08-27 18:28:24 +0200 |
---|---|---|
committer | Jason T. Greene <jason.greene@redhat.com> | 2022-08-27 20:03:40 -0500 |
commit | 78aec2130242b81659bd199c6c8605c76e681ff6 (patch) | |
tree | 90bd2f2134774d27769b9888542703a4466e5576 /test/e2e | |
parent | 03e51a058d35820fe8a9a9050b438f9db021ce11 (diff) | |
download | podman-78aec2130242b81659bd199c6c8605c76e681ff6.tar.gz podman-78aec2130242b81659bd199c6c8605c76e681ff6.tar.bz2 podman-78aec2130242b81659bd199c6c8605c76e681ff6.zip |
Fix #15499 already connected network
Compat: Treat already attached networks as a no-op
Applies only to containers in created state. Maintain error in running state.
Co-authored-by: Alessandro Rossi <al.rossi87@gmail.com>
Co-authored-by: Brent Baude <bbaude@redhat.com>
Co-authored-by: Jason T. Greene <jason.greene@redhat.com>
Signed-off-by: Alessandro Rossi <al.rossi87@gmail.com>
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/network_connect_disconnect_test.go | 12 |
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() { |