Refactor e2e tests to use the service ClusterIP

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-02-22 11:03:42 -03:00
parent f04361cc06
commit 5e249d3366
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
80 changed files with 777 additions and 706 deletions

View file

@ -20,6 +20,7 @@ import (
"fmt"
"net/http"
"strings"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@ -37,11 +38,11 @@ var _ = framework.IngressNginxDescribe("Proxy host variable", func() {
})
It("should exist a proxy_host", func() {
upstreamName := fmt.Sprintf("%v-http-svc-80", f.IngressController.Namespace)
upstreamName := fmt.Sprintf("%v-http-svc-80", f.Namespace)
annotations := map[string]string{
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Custom-Header: $proxy_host"`,
}
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.IngressController.Namespace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.Namespace, "http-svc", 80, &annotations))
f.WaitForNginxConfiguration(
func(server string) bool {
@ -50,7 +51,8 @@ var _ = framework.IngressNginxDescribe("Proxy host variable", func() {
})
resp, _, errs := gorequest.New().
Get(f.IngressController.HTTPURL).
Get(f.GetURL(framework.HTTP)).
Retry(10, 1*time.Second, http.StatusNotFound).
Set("Host", test).
End()
@ -60,13 +62,13 @@ var _ = framework.IngressNginxDescribe("Proxy host variable", func() {
})
It("should exist a proxy_host using the upstream-vhost annotation value", func() {
upstreamName := fmt.Sprintf("%v-http-svc-80", f.IngressController.Namespace)
upstreamName := fmt.Sprintf("%v-http-svc-80", f.Namespace)
upstreamVHost := "different.host"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/upstream-vhost": upstreamVHost,
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Custom-Header: $proxy_host"`,
}
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.IngressController.Namespace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.Namespace, "http-svc", 80, &annotations))
f.WaitForNginxConfiguration(
func(server string) bool {
@ -75,7 +77,8 @@ var _ = framework.IngressNginxDescribe("Proxy host variable", func() {
})
resp, _, errs := gorequest.New().
Get(f.IngressController.HTTPURL).
Get(f.GetURL(framework.HTTP)).
Retry(10, 1*time.Second, http.StatusNotFound).
Set("Host", test).
End()