Skip to content

Commit

Permalink
Merge pull request containers#18342 from edsantiago/aardvarks_are_slow
Browse files Browse the repository at this point in the history
Netavark userns test: give aardvark time to come up
  • Loading branch information
openshift-merge-robot authored Apr 26, 2023
2 parents 3b85ab3 + bdf3679 commit 846e7aa
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions test/e2e/run_networking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -965,31 +965,6 @@ EXPOSE 2004-2005/tcp`, ALPINE)
})

It("podman network works across user ns", func() {
netName := stringid.GenerateRandomID()
create := podmanTest.Podman([]string{"network", "create", netName})
create.WaitWithDefaultTimeout()
Expect(create).Should(Exit(0))
defer podmanTest.removeNetwork(netName)

name := "nc-server"
run := podmanTest.Podman([]string{"run", "--log-driver", "k8s-file", "-d", "--name", name, "--net", netName, ALPINE, "nc", "-l", "-p", "9480"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))

// NOTE: we force the k8s-file log driver to make sure the
// tests are passing inside a container.
run = podmanTest.Podman([]string{"run", "--log-driver", "k8s-file", "--rm", "--net", netName, "--uidmap", "0:1:4096", ALPINE, "sh", "-c", fmt.Sprintf("echo podman | nc -w 1 %s.dns.podman 9480", name)})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))

log := podmanTest.Podman([]string{"logs", name})
log.WaitWithDefaultTimeout()
Expect(log).Should(Exit(0))
Expect(log.OutputToString()).To(Equal("podman"))
})

It("podman Netavark network works across user ns", func() {
SkipIfCNI(podmanTest)
netName := createNetworkName("")
create := podmanTest.Podman([]string{"network", "create", netName})
create.WaitWithDefaultTimeout()
Expand All @@ -1003,7 +978,8 @@ EXPOSE 2004-2005/tcp`, ALPINE)

// NOTE: we force the k8s-file log driver to make sure the
// tests are passing inside a container.
run = podmanTest.Podman([]string{"run", "--log-driver", "k8s-file", "--rm", "--net", netName, "--uidmap", "0:1:4096", ALPINE, "sh", "-c", fmt.Sprintf("echo podman | nc -w 1 %s.dns.podman 9480", name)})
// "sleep" needed to give aardvark-dns time to come up; #16272
run = podmanTest.Podman([]string{"run", "--log-driver", "k8s-file", "--rm", "--net", netName, "--uidmap", "0:1:4096", ALPINE, "sh", "-c", fmt.Sprintf("sleep 2;echo podman | nc -w 1 %s.dns.podman 9480", name)})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))

Expand Down

0 comments on commit 846e7aa

Please sign in to comment.