Remove hard-coded names from e2e test and use local docker dependencies (#4502)
This commit is contained in:
parent
c7d2444cf4
commit
c85450c1e7
68 changed files with 894 additions and 293 deletions
|
|
@ -39,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Configmap change", func() {
|
|||
It("should reload after an update in the configuration", func() {
|
||||
host := "configmap-change"
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
wlKey := "whitelist-source-range"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ var _ = framework.IngressNginxDescribe("default-ssl-certificate", func() {
|
|||
f := framework.NewDefaultFramework("default-ssl-certificate")
|
||||
var tlsConfig *tls.Config
|
||||
secretName := "my-custom-cert"
|
||||
service := "http-svc"
|
||||
service := framework.EchoService
|
||||
port := 80
|
||||
|
||||
BeforeEach(func() {
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ var _ = framework.IngressNginxDescribe("Disabled catch-all", func() {
|
|||
It("should ignore catch all Ingress", func() {
|
||||
host := "foo"
|
||||
|
||||
ing := framework.NewSingleCatchAllIngress("catch-all", f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleCatchAllIngress("catch-all", f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
ing = framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ing = framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host, func(cfg string) bool {
|
||||
|
|
@ -73,7 +73,7 @@ var _ = framework.IngressNginxDescribe("Disabled catch-all", func() {
|
|||
It("should delete Ingress updated to catch-all", func() {
|
||||
host := "foo"
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
|
|
@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Disabled catch-all", func() {
|
|||
err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *extensions.Ingress) error {
|
||||
ingress.Spec.Rules = nil
|
||||
ingress.Spec.Backend = &extensions.IngressBackend{
|
||||
ServiceName: "http-svc",
|
||||
ServiceName: framework.EchoService,
|
||||
ServicePort: intstr.FromInt(80),
|
||||
}
|
||||
return nil
|
||||
|
|
@ -113,7 +113,7 @@ var _ = framework.IngressNginxDescribe("Disabled catch-all", func() {
|
|||
It("should allow Ingress with both a default backend and rules", func() {
|
||||
host := "foo"
|
||||
|
||||
ing := framework.NewSingleIngressWithBackendAndRules("not-catch-all", "/rulepath", host, f.Namespace, "http-svc", 80, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngressWithBackendAndRules("not-catch-all", "/rulepath", host, f.Namespace, framework.EchoService, 80, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host, func(cfg string) bool {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ var _ = framework.IngressNginxDescribe("X-Forwarded headers", func() {
|
|||
|
||||
f.UpdateNginxConfigMapData(setting, "true")
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
|
|
@ -93,7 +93,7 @@ var _ = framework.IngressNginxDescribe("X-Forwarded headers", func() {
|
|||
|
||||
f.UpdateNginxConfigMapData(setting, "false")
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ var _ = framework.IngressNginxDescribe("Geoip2", func() {
|
|||
"nginx.ingress.kubernetes.io/configuration-snippet": configSnippet,
|
||||
}
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations))
|
||||
|
||||
f.WaitForNginxConfiguration(
|
||||
func(cfg string) bool {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ var _ = framework.IngressNginxDescribe("Global access block", func() {
|
|||
|
||||
BeforeEach(func() {
|
||||
f.NewEchoDeploymentWithReplicas(1)
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ var _ = framework.IngressNginxDescribe("Global External Auth", func() {
|
|||
|
||||
host := "global-external-auth"
|
||||
|
||||
echoServiceName := "http-svc"
|
||||
echoServiceName := framework.EchoService
|
||||
|
||||
globalExternalAuthURLSetting := "global-auth-url"
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ var _ = framework.IngressNginxDescribe("Global External Auth", func() {
|
|||
Context("when global external authentication is configured", func() {
|
||||
|
||||
BeforeEach(func() {
|
||||
globalExternalAuthURL := fmt.Sprintf("http://httpbin.%s.svc.cluster.local:80/status/401", f.Namespace)
|
||||
globalExternalAuthURL := fmt.Sprintf("http://%s.%s.svc.cluster.local:80/status/401", framework.HTTPBinService, f.Namespace)
|
||||
|
||||
By("Adding an ingress rule for /foo")
|
||||
fooIng := framework.NewSingleIngress("foo-ingress", fooPath, host, f.Namespace, echoServiceName, 80, nil)
|
||||
|
|
@ -153,7 +153,7 @@ var _ = framework.IngressNginxDescribe("Global External Auth", func() {
|
|||
globalExternalAuthCacheKey := "foo"
|
||||
globalExternalAuthCacheDurationSetting := "global-auth-cache-duration"
|
||||
globalExternalAuthCacheDuration := "200 201 401 30m"
|
||||
globalExternalAuthURL := fmt.Sprintf("http://httpbin.%s.svc.cluster.local:80/status/200", f.Namespace)
|
||||
globalExternalAuthURL := fmt.Sprintf("http://%s.%s.svc.cluster.local:80/status/200", framework.HTTPBinService, f.Namespace)
|
||||
|
||||
By("Adding a global-auth-cache-key to configMap")
|
||||
f.UpdateNginxConfigMapData(globalExternalAuthCacheKeySetting, globalExternalAuthCacheKey)
|
||||
|
|
@ -178,7 +178,7 @@ var _ = framework.IngressNginxDescribe("Global External Auth", func() {
|
|||
}
|
||||
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
|
||||
|
||||
err := f.DeleteDeployment("httpbin")
|
||||
err := f.DeleteDeployment(framework.HTTPBinService)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
_, _, errs = gorequest.New().
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ var _ = framework.IngressNginxDescribe("Ingress class", func() {
|
|||
annotations := map[string]string{
|
||||
"kubernetes.io/ingress.class": "testclass",
|
||||
}
|
||||
ing := framework.NewSingleIngress(invalidHost, "/", invalidHost, f.Namespace, "http-svc", 80, &annotations)
|
||||
ing := framework.NewSingleIngress(invalidHost, "/", invalidHost, f.Namespace, framework.EchoService, 80, &annotations)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
validHost := "bar"
|
||||
ing = framework.NewSingleIngress(validHost, "/", validHost, f.Namespace, "http-svc", 80, nil)
|
||||
ing = framework.NewSingleIngress(validHost, "/", validHost, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxConfiguration(func(cfg string) bool {
|
||||
|
|
@ -89,14 +89,14 @@ var _ = framework.IngressNginxDescribe("Ingress class", func() {
|
|||
It("should ignore Ingress with no class", func() {
|
||||
invalidHost := "bar"
|
||||
|
||||
ing := framework.NewSingleIngress(invalidHost, "/", invalidHost, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngress(invalidHost, "/", invalidHost, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
validHost := "foo"
|
||||
annotations := map[string]string{
|
||||
"kubernetes.io/ingress.class": "testclass",
|
||||
}
|
||||
ing = framework.NewSingleIngress(validHost, "/", validHost, f.Namespace, "http-svc", 80, &annotations)
|
||||
ing = framework.NewSingleIngress(validHost, "/", validHost, f.Namespace, framework.EchoService, 80, &annotations)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(validHost, func(cfg string) bool {
|
||||
|
|
@ -127,7 +127,7 @@ var _ = framework.IngressNginxDescribe("Ingress class", func() {
|
|||
annotations := map[string]string{
|
||||
"kubernetes.io/ingress.class": "testclass",
|
||||
}
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
|
||||
ing = f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host, func(cfg string) bool {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ var _ = framework.IngressNginxDescribe("Listen on nondefault ports", func() {
|
|||
Context("with a plain HTTP ingress", func() {
|
||||
It("should set X-Forwarded-Port headers accordingly when listening on a non-default HTTP port", func() {
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
|
|
@ -71,7 +71,7 @@ var _ = framework.IngressNginxDescribe("Listen on nondefault ports", func() {
|
|||
|
||||
It("should set X-Forwarded-Port header to 443", func() {
|
||||
|
||||
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil)
|
||||
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
|
|
@ -105,10 +105,10 @@ var _ = framework.IngressNginxDescribe("Listen on nondefault ports", func() {
|
|||
|
||||
var httpbinIP string
|
||||
|
||||
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, "httpbin", f.Namespace, 1)
|
||||
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get("httpbin", metav1.GetOptions{})
|
||||
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(framework.HTTPBinService, metav1.GetOptions{})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
httpbinIP = e.Subsets[0].Addresses[0].IP
|
||||
|
|
@ -118,7 +118,7 @@ var _ = framework.IngressNginxDescribe("Listen on nondefault ports", func() {
|
|||
"nginx.ingress.kubernetes.io/auth-signin": "http://$host/auth/start",
|
||||
}
|
||||
|
||||
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, &annotations)
|
||||
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, &annotations)
|
||||
|
||||
f.EnsureIngress(ing)
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ var _ = framework.IngressNginxDescribe("LuaSharedDict", func() {
|
|||
})
|
||||
|
||||
It("configures lua shared dicts", func() {
|
||||
ingress := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
|
||||
ingress := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ingress)
|
||||
|
||||
f.UpdateNginxConfigMapData("lua-shared-dicts", "configuration_data:60,certificate_data:300, my_dict: 15 , invalid: 1a")
|
||||
|
|
|
|||
|
|
@ -124,14 +124,14 @@ func buildBasicAuthIngressWithSecondPath(host, namespace, secretName, pathName s
|
|||
{
|
||||
Path: "/",
|
||||
Backend: extensions.IngressBackend{
|
||||
ServiceName: "http-svc",
|
||||
ServiceName: framework.EchoService,
|
||||
ServicePort: intstr.FromInt(80),
|
||||
},
|
||||
},
|
||||
{
|
||||
Path: pathName,
|
||||
Backend: extensions.IngressBackend{
|
||||
ServiceName: "http-svc",
|
||||
ServiceName: framework.EchoService,
|
||||
ServicePort: intstr.FromInt(80),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,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.Namespace)
|
||||
upstreamName := fmt.Sprintf("%v-%v-80", f.Namespace, framework.EchoService)
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Custom-Header: $proxy_host"`,
|
||||
}
|
||||
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.Namespace, "http-svc", 80, &annotations))
|
||||
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.Namespace, framework.EchoService, 80, &annotations))
|
||||
|
||||
f.WaitForNginxConfiguration(
|
||||
func(server string) bool {
|
||||
|
|
@ -62,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.Namespace)
|
||||
upstreamName := fmt.Sprintf("%v-%v-80", f.Namespace, framework.EchoService)
|
||||
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.Namespace, "http-svc", 80, &annotations))
|
||||
f.EnsureIngress(framework.NewSingleIngress(test, "/", test, f.Namespace, framework.EchoService, 80, &annotations))
|
||||
|
||||
f.WaitForNginxConfiguration(
|
||||
func(server string) bool {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ var _ = framework.IngressNginxDescribe("Proxy Protocol", func() {
|
|||
|
||||
f.UpdateNginxConfigMapData(setting, "true")
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ var _ = framework.IngressNginxDescribe("Server Tokens", func() {
|
|||
It("should not exists Server header in the response", func() {
|
||||
f.UpdateNginxConfigMapData(serverTokens, "false")
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(serverTokens, "/", serverTokens, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(serverTokens, "/", serverTokens, f.Namespace, framework.EchoService, 80, nil))
|
||||
|
||||
f.WaitForNginxConfiguration(
|
||||
func(cfg string) bool {
|
||||
|
|
@ -69,7 +69,7 @@ var _ = framework.IngressNginxDescribe("Server Tokens", func() {
|
|||
{
|
||||
Path: "/",
|
||||
Backend: extensions.IngressBackend{
|
||||
ServiceName: "http-svc",
|
||||
ServiceName: framework.EchoService,
|
||||
ServicePort: intstr.FromInt(80),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
// https://www.openssl.org/docs/man1.1.0/apps/ciphers.html - "CIPHER SUITE NAMES"
|
||||
testCiphers := "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA"
|
||||
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
|
|
@ -107,7 +107,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
hstsIncludeSubdomains := "hsts-include-subdomains"
|
||||
hstsPreload := "hsts-preload"
|
||||
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
|
|
@ -172,7 +172,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
It("should not use ports during the HTTP to HTTPS redirection", func() {
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
|
|
@ -196,7 +196,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
It("should not use ports or X-Forwarded-Host during the HTTP to HTTPS redirection", func() {
|
||||
f.UpdateNginxConfigMapData("use-forwarded-headers", "true")
|
||||
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue