Refactor TLS e2e tests

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-09-30 12:55:56 -03:00
parent c4f78ef11d
commit 104fdab2f6

View file

@ -34,7 +34,6 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
ginkgo.BeforeEach(func() { ginkgo.BeforeEach(func() {
f.NewEchoDeployment() f.NewEchoDeployment()
f.UpdateNginxConfigMapData("use-forwarded-headers", "false")
}) })
ginkgo.Context("should configure TLS protocol", func() { ginkgo.Context("should configure TLS protocol", func() {
@ -112,15 +111,15 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
ginkgo.Context("should configure HSTS policy header", func() { ginkgo.Context("should configure HSTS policy header", func() {
var ( var (
tlsConfig *tls.Config tlsConfig *tls.Config
hstsMaxAge string
hstsIncludeSubdomains string
hstsPreload string
) )
ginkgo.BeforeEach(func() { const (
hstsMaxAge = "hsts-max-age" hstsMaxAge = "hsts-max-age"
hstsIncludeSubdomains = "hsts-include-subdomains" hstsIncludeSubdomains = "hsts-include-subdomains"
hstsPreload = "hsts-preload" hstsPreload = "hsts-preload"
)
ginkgo.BeforeEach(func() {
ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil)) ing := f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, nil))
tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet, tlsConfig, err := framework.CreateIngressTLSSecret(f.KubeClientSet,
ing.Spec.TLS[0].Hosts, ing.Spec.TLS[0].Hosts,
@ -246,5 +245,4 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
Header("Location").Equal("https://example.com/") Header("Location").Equal("https://example.com/")
}) })
}) })
}) })