Refactor e2e tests to use testify y httpexpect

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-02-19 00:08:56 -03:00
parent 046e2d959d
commit f9624cbe46
80 changed files with 2280 additions and 2631 deletions

View file

@ -20,26 +20,27 @@ import (
"fmt"
"strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/ginkgo"
"github.com/stretchr/testify/assert"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
f := framework.NewDefaultFramework("proxyssl")
BeforeEach(func() {
f.NewEchoDeploymentWithReplicas(2)
ginkgo.BeforeEach(func() {
f.NewEchoDeployment()
})
It("should set valid proxy-ssl-secret", func() {
ginkgo.It("should set valid proxy-ssl-secret", func() {
host := "proxyssl.foo.com"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/proxy-ssl-secret": f.Namespace + "/" + host,
}
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
assert.Nil(ginkgo.GinkgoT(), err)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
f.EnsureIngress(ing)
@ -47,7 +48,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "off", 1)
})
It("should set valid proxy-ssl-secret, proxy-ssl-verify to on, and proxy-ssl-verify-depth to 2", func() {
ginkgo.It("should set valid proxy-ssl-secret, proxy-ssl-verify to on, and proxy-ssl-verify-depth to 2", func() {
host := "proxyssl.foo.com"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/proxy-ssl-secret": f.Namespace + "/" + host,
@ -56,7 +57,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
}
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
assert.Nil(ginkgo.GinkgoT(), err)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
f.EnsureIngress(ing)
@ -64,7 +65,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 2)
})
It("should set valid proxy-ssl-secret, proxy-ssl-ciphers to HIGH:!AES", func() {
ginkgo.It("should set valid proxy-ssl-secret, proxy-ssl-ciphers to HIGH:!AES", func() {
host := "proxyssl.foo.com"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/proxy-ssl-secret": f.Namespace + "/" + host,
@ -72,7 +73,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
}
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
assert.Nil(ginkgo.GinkgoT(), err)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
f.EnsureIngress(ing)
@ -80,7 +81,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
assertProxySSL(f, host, "HIGH:!AES", "TLSv1 TLSv1.1 TLSv1.2", "off", 1)
})
It("should set valid proxy-ssl-secret, proxy-ssl-protocols", func() {
ginkgo.It("should set valid proxy-ssl-secret, proxy-ssl-protocols", func() {
host := "proxyssl.foo.com"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/proxy-ssl-secret": f.Namespace + "/" + host,
@ -88,7 +89,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
}
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
assert.Nil(ginkgo.GinkgoT(), err)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
f.EnsureIngress(ing)