summaryrefslogtreecommitdiff
path: root/test/e2e/run_staticip_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-02-25 15:51:34 -0600
committerBrent Baude <bbaude@redhat.com>2020-02-26 08:30:28 -0600
commit04f1306c87a6aad73487dd0da5d65f77fb23f2d2 (patch)
tree3e72a74e61e2363cd078cc5c442417776c04cb8b /test/e2e/run_staticip_test.go
parentd3aa64c77c501b630ae2e0a227e10c38e14b1f4f (diff)
downloadpodman-04f1306c87a6aad73487dd0da5d65f77fb23f2d2.tar.gz
podman-04f1306c87a6aad73487dd0da5d65f77fb23f2d2.tar.bz2
podman-04f1306c87a6aad73487dd0da5d65f77fb23f2d2.zip
curb flakes in integration tests
instead of searching the fedora registry which is error prone, we instead search a local registry for the empty set search. when running two containers with the same IP, i suspect the first container has not fully gotten its ip information back from cni when the second container fires. rework this test such that we use nginx to make sure the container is up and running before continues which should pace the subsequent test. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/run_staticip_test.go')
-rw-r--r--test/e2e/run_staticip_test.go16
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())