mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Netavark userns test: give aardvark time to come up
Nasty test flake, "bad address nc-server.dns.podman" Cause: "There is absolutely no guarantee that aardvark-dns is ready before the container is started." (source: Paul). Workaround (not a real solution): wait before doing a host lookup. Also: remove a 99%-duplicate test. Closes: #16272 (I hope) Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -965,31 +965,6 @@ EXPOSE 2004-2005/tcp`, ALPINE)
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman network works across user ns", func() {
|
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("")
|
netName := createNetworkName("")
|
||||||
create := podmanTest.Podman([]string{"network", "create", netName})
|
create := podmanTest.Podman([]string{"network", "create", netName})
|
||||||
create.WaitWithDefaultTimeout()
|
create.WaitWithDefaultTimeout()
|
||||||
@ -1003,7 +978,8 @@ EXPOSE 2004-2005/tcp`, ALPINE)
|
|||||||
|
|
||||||
// NOTE: we force the k8s-file log driver to make sure the
|
// NOTE: we force the k8s-file log driver to make sure the
|
||||||
// tests are passing inside a container.
|
// 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()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run).Should(Exit(0))
|
Expect(run).Should(Exit(0))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user