Refactor e2e tests to use the service ClusterIP
This commit is contained in:
parent
f04361cc06
commit
5e249d3366
80 changed files with 777 additions and 706 deletions
|
|
@ -54,14 +54,14 @@ 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.IngressController.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
ing.Namespace)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
framework.WaitForTLS(f.IngressController.HTTPSURL, tlsConfig)
|
||||
framework.WaitForTLS(f.GetURL(framework.HTTPS), tlsConfig)
|
||||
|
||||
By("setting cipher suite")
|
||||
f.UpdateNginxConfigMapData(sslCiphers, testCiphers)
|
||||
|
|
@ -72,7 +72,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs := gorequest.New().
|
||||
Get(f.IngressController.HTTPSURL).
|
||||
Get(f.GetURL(framework.HTTPS)).
|
||||
TLSClientConfig(tlsConfig).
|
||||
Set("Host", host).
|
||||
End()
|
||||
|
|
@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs = gorequest.New().
|
||||
Get(f.IngressController.HTTPSURL).
|
||||
Get(f.GetURL(framework.HTTPS)).
|
||||
TLSClientConfig(tlsConfig).
|
||||
Set("Host", host).
|
||||
End()
|
||||
|
|
@ -107,14 +107,14 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
hstsIncludeSubdomains := "hsts-include-subdomains"
|
||||
hstsPreload := "hsts-preload"
|
||||
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.IngressController.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
ing.Namespace)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
framework.WaitForTLS(f.IngressController.HTTPSURL, tlsConfig)
|
||||
framework.WaitForTLS(f.GetURL(framework.HTTPS), tlsConfig)
|
||||
|
||||
By("setting max-age parameter")
|
||||
f.UpdateNginxConfigMapData(hstsMaxAge, "86400")
|
||||
|
|
@ -125,7 +125,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs := gorequest.New().
|
||||
Get(f.IngressController.HTTPSURL).
|
||||
Get(f.GetURL(framework.HTTPS)).
|
||||
TLSClientConfig(tlsConfig).
|
||||
Set("Host", host).
|
||||
End()
|
||||
|
|
@ -143,7 +143,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs = gorequest.New().
|
||||
Get(f.IngressController.HTTPSURL).
|
||||
Get(f.GetURL(framework.HTTPS)).
|
||||
TLSClientConfig(tlsConfig).
|
||||
Set("Host", host).
|
||||
End()
|
||||
|
|
@ -161,7 +161,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs = gorequest.New().
|
||||
Get(f.IngressController.HTTPSURL).
|
||||
Get(f.GetURL(framework.HTTPS)).
|
||||
TLSClientConfig(tlsConfig).
|
||||
Set("Host", host).
|
||||
End()
|
||||
|
|
@ -172,14 +172,14 @@ 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.IngressController.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
ing.Namespace)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
framework.WaitForTLS(f.IngressController.HTTPSURL, tlsConfig)
|
||||
framework.WaitForTLS(f.GetURL(framework.HTTPS), tlsConfig)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
|
|
@ -188,7 +188,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs := gorequest.New().
|
||||
Get(fmt.Sprintf(f.IngressController.HTTPURL)).
|
||||
Get(fmt.Sprintf(f.GetURL(framework.HTTP))).
|
||||
Retry(10, 1*time.Second, http.StatusNotFound).
|
||||
RedirectPolicy(noRedirectPolicyFunc).
|
||||
Set("Host", host).
|
||||
|
|
@ -202,14 +202,14 @@ 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.IngressController.Namespace, "http-svc", 80, nil))
|
||||
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, nil))
|
||||
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
|
||||
ing.Spec.TLS[0].Hosts,
|
||||
ing.Spec.TLS[0].SecretName,
|
||||
ing.Namespace)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
framework.WaitForTLS(f.IngressController.HTTPSURL, tlsConfig)
|
||||
framework.WaitForTLS(f.GetURL(framework.HTTPS), tlsConfig)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
|
|
@ -218,7 +218,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() {
|
|||
})
|
||||
|
||||
resp, _, errs := gorequest.New().
|
||||
Get(fmt.Sprintf(f.IngressController.HTTPURL)).
|
||||
Get(fmt.Sprintf(f.GetURL(framework.HTTP))).
|
||||
Retry(10, 1*time.Second, http.StatusNotFound).
|
||||
RedirectPolicy(noRedirectPolicyFunc).
|
||||
Set("Host", host).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue