Fix for podman network rm (-f) workflow

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
This commit is contained in:
Jakub Guzik
2021-03-05 11:39:03 +01:00
parent 87e20560ac
commit 2bcc95257f
2 changed files with 32 additions and 1 deletions

View File

@ -352,6 +352,29 @@ var _ = Describe("Podman network", func() {
Expect(rmAll.ExitCode()).To(BeZero())
})
It("podman network remove after disconnect when container initially created with the network", func() {
SkipIfRootless("disconnect works only in non rootless container")
container := "test"
network := "foo"
session := podmanTest.Podman([]string{"network", "create", network})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
session = podmanTest.Podman([]string{"run", "--name", container, "--network", network, "-d", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
session = podmanTest.Podman([]string{"network", "disconnect", network, container})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
session = podmanTest.Podman([]string{"network", "rm", network})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman network remove bogus", func() {
session := podmanTest.Podman([]string{"network", "rm", "bogus"})
session.WaitWithDefaultTimeout()