Skip to content

Commit

Permalink
bring back e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
  • Loading branch information
Shriram Rajagopalan committed Feb 27, 2019
1 parent 865bb38 commit a3fbb48
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/e2e/tests/pilot/egressgateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ func TestRouteHTTPViaEgressGateway(t *testing.T) {
}
return errAgain
})

runRetriableTest(t, "RoutePassthroughAndNonPassthroughViaGateway", defaultRetryBudget, func() error {
// We use an arbitrary IP to ensure that the test fails if networking logic is implemented incorrectly
reqURL := fmt.Sprintf("https://1.1.1.1/bookinfo")
resp := ClientRequest(cluster, "a", reqURL, 100, "-key Host -val scooby.eu.bookinfo.com")
count := make(map[string]int)
for _, elt := range resp.Host {
count[elt]++
}
for _, elt := range resp.Code {
count[elt]++
}
handledByEgress := strings.Count(resp.Body, "Handled-By-Egress-Gateway=true")
log.Infof("request counts %v", count)
if count["scooby.eu.bookinfo.com"] >= 95 && count[httpOK] >= 95 && handledByEgress >= 95 {
return nil
}
return errAgain
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ spec:
- www.bing.com
tls:
mode: PASSTHROUGH
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "*.bookinfo.com"
tls:
# This test ensures that we can have both passthrough and non passthrough on same port
mode: SIMPLE #enables HTTPS on this port
serverCertificate: /etc/certs/cert-chain.pem
privateKey: /etc/certs/key.pem
caCertificates: /etc/certs/root-cert.pem

0 comments on commit a3fbb48

Please sign in to comment.