summaryrefslogtreecommitdiff
path: root/test/e2e/port_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2019-06-12 22:30:41 -0500
committerbaude <bbaude@redhat.com>2019-06-18 10:43:53 -0500
commitd87cb1a5f94e5f3dde9aa498ff1588674b4c2db9 (patch)
tree833acbcfcf910075997b0ad4d10c459c5accd934 /test/e2e/port_test.go
parent265d55edbf698b624adee081a48f47b3b73b6164 (diff)
downloadpodman-d87cb1a5f94e5f3dde9aa498ff1588674b4c2db9.tar.gz
podman-d87cb1a5f94e5f3dde9aa498ff1588674b4c2db9.tar.bz2
podman-d87cb1a5f94e5f3dde9aa498ff1588674b4c2db9.zip
fix port -l timing with healthchecks
many of the port tests use our nginx container image. in some cases, we have timing issues between when the nginx and the container are running and when the port -l command is run causing test flakes. we now use the container image's built in healthcheck to ensure that nginx is running (and subsequently the container itself) before running the port command. Fixes: #3309 Signed-off-by: Brent Baude <bbaude@redhat.com> Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/port_test.go')
-rw-r--r--test/e2e/port_test.go30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/e2e/port_test.go b/test/e2e/port_test.go
index e45118361..26c5fd7d0 100644
--- a/test/e2e/port_test.go
+++ b/test/e2e/port_test.go
@@ -48,11 +48,14 @@ var _ = Describe("Podman port", func() {
Expect(result.ExitCode()).ToNot(Equal(0))
})
- It("podman port -l nginx", func() {
- session := podmanTest.Podman([]string{"run", "-dt", "-P", nginx})
- session.WaitWithDefaultTimeout()
+ It("podman port -l nginx", func() {
+ session, cid := podmanTest.RunNginxWithHealthCheck("")
Expect(session.ExitCode()).To(Equal(0))
+ if err := podmanTest.RunHealthCheck(cid); err != nil {
+ Fail(err.Error())
+ }
+
result := podmanTest.Podman([]string{"port", "-l"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -61,10 +64,13 @@ var _ = Describe("Podman port", func() {
})
It("podman container port -l nginx", func() {
- session := podmanTest.Podman([]string{"container", "run", "-dt", "-P", nginx})
- session.WaitWithDefaultTimeout()
+ session, cid := podmanTest.RunNginxWithHealthCheck("")
Expect(session.ExitCode()).To(Equal(0))
+ if err := podmanTest.RunHealthCheck(cid); err != nil {
+ Fail(err.Error())
+ }
+
result := podmanTest.Podman([]string{"container", "port", "-l"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -73,10 +79,13 @@ var _ = Describe("Podman port", func() {
})
It("podman port -l port nginx", func() {
- session := podmanTest.Podman([]string{"run", "-dt", "-P", nginx})
- session.WaitWithDefaultTimeout()
+ session, cid := podmanTest.RunNginxWithHealthCheck("")
Expect(session.ExitCode()).To(Equal(0))
+ if err := podmanTest.RunHealthCheck(cid); err != nil {
+ Fail(err.Error())
+ }
+
result := podmanTest.Podman([]string{"port", "-l", "80"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -85,10 +94,13 @@ var _ = Describe("Podman port", func() {
})
It("podman port -a nginx", func() {
- session := podmanTest.Podman([]string{"run", "-dt", "-P", nginx})
- session.WaitWithDefaultTimeout()
+ session, cid := podmanTest.RunNginxWithHealthCheck("")
Expect(session.ExitCode()).To(Equal(0))
+ if err := podmanTest.RunHealthCheck(cid); err != nil {
+ Fail(err.Error())
+ }
+
result := podmanTest.Podman([]string{"port", "-a"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))