summaryrefslogtreecommitdiff
path: root/test/e2e/pod_infra_container_test.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2022-04-06 08:17:42 -0600
committerEd Santiago <santiago@redhat.com>2022-04-25 14:25:10 -0600
commitee9d755c5b86ef996a7896f09e6e91ee5e488af7 (patch)
tree718919a8183f4d3c1be5fb977ff764e965e70272 /test/e2e/pod_infra_container_test.go
parent181c9d3ee3ad4820b9ae91f1f02faf7b9e65fc87 (diff)
downloadpodman-ee9d755c5b86ef996a7896f09e6e91ee5e488af7.tar.gz
podman-ee9d755c5b86ef996a7896f09e6e91ee5e488af7.tar.bz2
podman-ee9d755c5b86ef996a7896f09e6e91ee5e488af7.zip
Robustify nginx tests
[skip ci] While chasing a flake, I discovered that our alpine_nginx image is broken: it returns 404 on all requests. We never caught this because--surprise!--curl exits 0 even when server returns 4xx/5xx status. Let's be strict: add -f (--fail) option to all invocations of curl. And, although I couldn't identify the root cause of the flake (in "run two containers with the same IP" test), I can at least fix the broken wait-for-nginx loop, bump up the number of retries, and improve diagnostics on failure. And add a strict error-message check. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/pod_infra_container_test.go')
-rw-r--r--test/e2e/pod_infra_container_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index 6373b949a..2b56502b0 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -119,11 +119,11 @@ var _ = Describe("Podman pod create", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- session = podmanTest.Podman([]string{"run", "--pod", podID, fedoraMinimal, "curl", "localhost:80"})
+ session = podmanTest.Podman([]string{"run", "--pod", podID, fedoraMinimal, "curl", "-f", "localhost:80"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- session = podmanTest.Podman([]string{"run", fedoraMinimal, "curl", "localhost"})
+ session = podmanTest.Podman([]string{"run", fedoraMinimal, "curl", "-f", "localhost"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
})
@@ -219,7 +219,7 @@ var _ = Describe("Podman pod create", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- session = podmanTest.Podman([]string{"run", "--pod", podID, "--network", "bridge", nginx, "curl", "localhost"})
+ session = podmanTest.Podman([]string{"run", "--pod", podID, "--network", "bridge", nginx, "curl", "-f", "localhost"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
})