Skip to content

Commit

Permalink
Merge pull request #7847 from rhatdan/network
Browse files Browse the repository at this point in the history
Make the e2e test network cleanup more robust.
  • Loading branch information
openshift-merge-robot authored Sep 30, 2020
2 parents fb43e8c + 5766f5b commit e2050d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/e2e/network_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func genericPluginsToPortMap(plugins interface{}, pluginType string) (network.Po
func (p *PodmanTestIntegration) removeCNINetwork(name string) {
session := p.Podman([]string{"network", "rm", "-f", name})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(BeZero())
Expect(session.ExitCode()).To(BeNumerically("<=", 1))
}

func removeNetworkDevice(name string) {
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ var _ = Describe("Podman network", func() {
})

It("podman network rm", func() {
SkipIfRootless("FIXME: This one is definitely broken in rootless mode")
// Setup, use uuid to prevent conflict with other tests
uuid := stringid.GenerateNonCryptoID()
secondPath := filepath.Join(podmanTest.CNIConfigDir, fmt.Sprintf("%s.conflist", uuid))
Expand Down Expand Up @@ -276,6 +275,7 @@ var _ = Describe("Podman network", func() {
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(BeZero())
defer podmanTest.removeCNINetwork(netName)

session = podmanTest.Podman([]string{"pod", "create", "--network", netName})
session.WaitWithDefaultTimeout()
Expand Down Expand Up @@ -311,11 +311,13 @@ var _ = Describe("Podman network", func() {
session := podmanTest.Podman([]string{"network", "create", netName1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(BeZero())
defer podmanTest.removeCNINetwork(netName1)

netName2 := "net2"
session = podmanTest.Podman([]string{"network", "create", netName2})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(BeZero())
defer podmanTest.removeCNINetwork(netName2)

session = podmanTest.Podman([]string{"network", "rm", netName1, netName2})
session.WaitWithDefaultTimeout()
Expand Down

0 comments on commit e2050d7

Please sign in to comment.