mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +08:00
Merge pull request #7593 from edsantiago/network_test_cleanup
run_networking e2e test: add cleanup to some tests
This commit is contained in:
@ -535,15 +535,12 @@ var _ = Describe("Podman run networking", func() {
|
|||||||
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.30.0/24", netName})
|
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.30.0/24", netName})
|
||||||
create.WaitWithDefaultTimeout()
|
create.WaitWithDefaultTimeout()
|
||||||
Expect(create.ExitCode()).To(BeZero())
|
Expect(create.ExitCode()).To(BeZero())
|
||||||
|
defer podmanTest.removeCNINetwork(netName)
|
||||||
|
|
||||||
run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
|
run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run.ExitCode()).To(BeZero())
|
Expect(run.ExitCode()).To(BeZero())
|
||||||
Expect(run.OutputToString()).To(ContainSubstring(ipAddr))
|
Expect(run.OutputToString()).To(ContainSubstring(ipAddr))
|
||||||
|
|
||||||
netrm := podmanTest.Podman([]string{"network", "rm", netName})
|
|
||||||
netrm.WaitWithDefaultTimeout()
|
|
||||||
Expect(netrm.ExitCode()).To(BeZero())
|
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman run with new:pod and static-ip", func() {
|
It("podman run with new:pod and static-ip", func() {
|
||||||
@ -555,6 +552,7 @@ var _ = Describe("Podman run networking", func() {
|
|||||||
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.40.0/24", netName})
|
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.40.0/24", netName})
|
||||||
create.WaitWithDefaultTimeout()
|
create.WaitWithDefaultTimeout()
|
||||||
Expect(create.ExitCode()).To(BeZero())
|
Expect(create.ExitCode()).To(BeZero())
|
||||||
|
defer podmanTest.removeCNINetwork(netName)
|
||||||
|
|
||||||
run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--pod", "new:" + podname, "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
|
run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--pod", "new:" + podname, "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
@ -564,9 +562,5 @@ var _ = Describe("Podman run networking", func() {
|
|||||||
podrm := podmanTest.Podman([]string{"pod", "rm", "-f", podname})
|
podrm := podmanTest.Podman([]string{"pod", "rm", "-f", podname})
|
||||||
podrm.WaitWithDefaultTimeout()
|
podrm.WaitWithDefaultTimeout()
|
||||||
Expect(podrm.ExitCode()).To(BeZero())
|
Expect(podrm.ExitCode()).To(BeZero())
|
||||||
|
|
||||||
netrm := podmanTest.Podman([]string{"network", "rm", netName})
|
|
||||||
netrm.WaitWithDefaultTimeout()
|
|
||||||
Expect(netrm.ExitCode()).To(BeZero())
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user