diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-26 16:17:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 16:17:34 +0100 |
commit | 75d0d48d20f7406079a641829917356ca00218e8 (patch) | |
tree | 6061e3296091498191b90bc8f2127fde6008852e /test/e2e/run_staticip_test.go | |
parent | dd289950de604d0e4a1ecf9833d9c56311e06d1d (diff) | |
parent | 04f1306c87a6aad73487dd0da5d65f77fb23f2d2 (diff) | |
download | podman-75d0d48d20f7406079a641829917356ca00218e8.tar.gz podman-75d0d48d20f7406079a641829917356ca00218e8.tar.bz2 podman-75d0d48d20f7406079a641829917356ca00218e8.zip |
Merge pull request #5330 from baude/flakefixesfored
curb flakes in integration tests
Diffstat (limited to 'test/e2e/run_staticip_test.go')
-rw-r--r-- | test/e2e/run_staticip_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go index 5b4842fea..5ad8f9fb0 100644 --- a/test/e2e/run_staticip_test.go +++ b/test/e2e/run_staticip_test.go @@ -3,7 +3,10 @@ package integration import ( + "fmt" + "net/http" "os" + "time" . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" @@ -65,9 +68,20 @@ var _ = Describe("Podman run with --ip flag", func() { It("Podman run two containers with the same IP", func() { ip := GetRandomIPAddress() - result := podmanTest.Podman([]string{"run", "-d", "--ip", ip, ALPINE, "sleep", "999"}) + result := podmanTest.Podman([]string{"run", "-dt", "--ip", ip, nginx}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) + for i := 0; i < 10; i++ { + fmt.Println("Waiting for nginx", err) + time.Sleep(1 * time.Second) + response, err := http.Get(fmt.Sprintf("http://%s", ip)) + if err != nil { + continue + } + if response.StatusCode == http.StatusOK { + break + } + } result = podmanTest.Podman([]string{"run", "-ti", "--ip", ip, ALPINE, "ip", "addr"}) result.WaitWithDefaultTimeout() Expect(result).To(ExitWithError()) |