diff --git a/test/e2e/annotations/affinity.go b/test/e2e/annotations/affinity.go index 6e175b6c3..0e9a0da40 100644 --- a/test/e2e/annotations/affinity.go +++ b/test/e2e/annotations/affinity.go @@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", match := md5Regex.FindStringSubmatch(resp.Header.Get("Set-Cookie")) Expect(len(match)).Should(BeNumerically("==", 1)) - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring(match[0])) }) @@ -97,7 +97,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", match := sha1Regex.FindStringSubmatch(resp.Header.Get("Set-Cookie")) Expect(len(match)).Should(BeNumerically("==", 1)) - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring(match[0])) }) @@ -122,7 +122,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring("Path=/something")) }) @@ -179,7 +179,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring("Path=/something;")) @@ -188,7 +188,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring("Path=/somewhereelese;")) }) @@ -215,7 +215,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) local, _ := time.LoadLocation("GMT") duration, _ := time.ParseDuration("48h") diff --git a/test/e2e/annotations/alias.go b/test/e2e/annotations/alias.go index 2ebda7b5e..a37026b4b 100644 --- a/test/e2e/annotations/alias.go +++ b/test/e2e/annotations/alias.go @@ -55,7 +55,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Alias", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("host=%v", host))) @@ -64,7 +64,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Alias", func() { Set("Host", "bar"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusNotFound)) Expect(body).Should(ContainSubstring("404 Not Found")) }) @@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Alias", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("host=%v", host))) } diff --git a/test/e2e/annotations/approot.go b/test/e2e/annotations/approot.go index 5c6d2942a..9a325202d 100644 --- a/test/e2e/annotations/approot.go +++ b/test/e2e/annotations/approot.go @@ -59,7 +59,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Approot", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusFound)) Expect(resp.Header.Get("Location")).Should(Equal("http://approot.bar.com/foo")) }) diff --git a/test/e2e/annotations/auth.go b/test/e2e/annotations/auth.go index 4e1286373..fdc6a59c4 100644 --- a/test/e2e/annotations/auth.go +++ b/test/e2e/annotations/auth.go @@ -63,7 +63,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("host=%v", host))) }) @@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusServiceUnavailable)) Expect(body).Should(ContainSubstring("503 Service Temporarily Unavailable")) }) @@ -122,7 +122,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusUnauthorized)) Expect(body).Should(ContainSubstring("401 Authorization Required")) }) @@ -154,7 +154,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { SetBasicAuth("user", "pass"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusUnauthorized)) Expect(body).Should(ContainSubstring("401 Authorization Required")) }) @@ -186,7 +186,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { SetBasicAuth("foo", "bar"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) @@ -229,7 +229,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() { SetBasicAuth("foo", "bar"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusInternalServerError)) }) diff --git a/test/e2e/annotations/authtls.go b/test/e2e/annotations/authtls.go index 89f1de4a6..d489f842e 100644 --- a/test/e2e/annotations/authtls.go +++ b/test/e2e/annotations/authtls.go @@ -81,7 +81,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() { TLSClientConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusBadRequest)) // Send Request Passing the Client Certs @@ -90,7 +90,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() { TLSClientConfig(clientConfig). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) @@ -135,7 +135,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() { TLSClientConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) @@ -191,7 +191,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() { Set("Host", host). RedirectPolicy(noRedirectPolicyFunc). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusFound)) Expect(resp.Header.Get("Location")).Should(Equal(f.IngressController.HTTPURL + errorPath)) @@ -201,7 +201,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() { TLSClientConfig(clientConfig). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) }) diff --git a/test/e2e/annotations/canary.go b/test/e2e/annotations/canary.go index b2c518667..6201eadb2 100644 --- a/test/e2e/annotations/canary.go +++ b/test/e2e/annotations/canary.go @@ -76,7 +76,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() { Set("CanaryByHeader", "always"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).ShouldNot(Equal(http.StatusNotFound)) Expect(body).Should(ContainSubstring("http-svc-canary")) }) @@ -113,7 +113,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() { Set("CanaryByHeader", "never"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).ShouldNot(Equal(http.StatusNotFound)) Expect(body).ShouldNot(ContainSubstring("http-svc-canary")) }) @@ -152,7 +152,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() { AddCookie(&http.Cookie{Name: "CanaryByCookie", Value: "always"}). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).ShouldNot(Equal(http.StatusNotFound)) Expect(body).Should(ContainSubstring("http-svc-canary")) }) @@ -191,7 +191,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() { AddCookie(&http.Cookie{Name: "CanaryByCookie", Value: "never"}). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).ShouldNot(Equal(http.StatusNotFound)) Expect(body).ShouldNot(ContainSubstring("http-svc-canary")) }) diff --git a/test/e2e/annotations/connection.go b/test/e2e/annotations/connection.go index c281a2a69..6ca77cce7 100644 --- a/test/e2e/annotations/connection.go +++ b/test/e2e/annotations/connection.go @@ -57,7 +57,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Connection", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("connection=keep-alive"))) }) diff --git a/test/e2e/annotations/cors.go b/test/e2e/annotations/cors.go index 8da735c61..4fb4c9d4f 100644 --- a/test/e2e/annotations/cors.go +++ b/test/e2e/annotations/cors.go @@ -75,7 +75,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() { Options(f.IngressController.HTTPURL+uri). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusNoContent)) }) diff --git a/test/e2e/annotations/default_backend.go b/test/e2e/annotations/default_backend.go index a1d7967f9..0d105c386 100644 --- a/test/e2e/annotations/default_backend.go +++ b/test/e2e/annotations/default_backend.go @@ -58,7 +58,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom default-backend", f Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).To(ContainSubstring("x-code=503")) diff --git a/test/e2e/annotations/forcesslredirect.go b/test/e2e/annotations/forcesslredirect.go index 590bf3c31..e46eb6465 100644 --- a/test/e2e/annotations/forcesslredirect.go +++ b/test/e2e/annotations/forcesslredirect.go @@ -59,7 +59,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Forcesslredirect", func() Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusPermanentRedirect)) Expect(resp.Header.Get("Location")).Should(Equal("https://forcesslredirect.bar.com/")) }) diff --git a/test/e2e/annotations/fromtowwwredirect.go b/test/e2e/annotations/fromtowwwredirect.go index 6d1e597ed..d5bc376c8 100644 --- a/test/e2e/annotations/fromtowwwredirect.go +++ b/test/e2e/annotations/fromtowwwredirect.go @@ -63,7 +63,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Fromtowwwredirect", func() Set("Host", fmt.Sprintf("%s.%s", "www", host)). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusPermanentRedirect)) Expect(resp.Header.Get("Location")).Should(Equal("http://fromtowwwredirect.bar.com/foo")) }) diff --git a/test/e2e/defaultbackend/default_backend.go b/test/e2e/defaultbackend/default_backend.go index f957bbfe1..3e4b6b87b 100644 --- a/test/e2e/defaultbackend/default_backend.go +++ b/test/e2e/defaultbackend/default_backend.go @@ -94,7 +94,7 @@ var _ = framework.IngressNginxDescribe("Default backend", func() { } resp, _, errs := cm.End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(test.Status)) } }) diff --git a/test/e2e/defaultbackend/ssl.go b/test/e2e/defaultbackend/ssl.go index 7dda5ce31..80f2be185 100644 --- a/test/e2e/defaultbackend/ssl.go +++ b/test/e2e/defaultbackend/ssl.go @@ -44,7 +44,7 @@ var _ = framework.IngressNginxDescribe("Default backend - SSL", func() { InsecureSkipVerify: true, }).End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(len(resp.TLS.PeerCertificates)).Should(BeNumerically("==", 1)) for _, pc := range resp.TLS.PeerCertificates { @@ -59,7 +59,7 @@ var _ = framework.IngressNginxDescribe("Default backend - SSL", func() { InsecureSkipVerify: true, }). Set("Host", "foo.bar.com").End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(len(resp.TLS.PeerCertificates)).Should(BeNumerically("==", 1)) for _, pc := range resp.TLS.PeerCertificates { Expect(pc.Issuer.CommonName).Should(Equal("Kubernetes Ingress Controller Fake Certificate")) diff --git a/test/e2e/servicebackend/service_backend.go b/test/e2e/servicebackend/service_backend.go index 7e28d0315..3df7e8996 100644 --- a/test/e2e/servicebackend/service_backend.go +++ b/test/e2e/servicebackend/service_backend.go @@ -56,7 +56,7 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() { Get(f.IngressController.HTTPURL). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(503)) }) @@ -79,7 +79,7 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() { Get(f.IngressController.HTTPURL). Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(503)) }) diff --git a/test/e2e/settings/forwarded_headers.go b/test/e2e/settings/forwarded_headers.go index fe451655e..b08ee075e 100644 --- a/test/e2e/settings/forwarded_headers.go +++ b/test/e2e/settings/forwarded_headers.go @@ -63,7 +63,7 @@ var _ = framework.IngressNginxDescribe("X-Forwarded headers", func() { Set("X-Forwarded-Host", "myhost"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("host=myhost"))) Expect(body).Should(ContainSubstring(fmt.Sprintf("x-forwarded-host=myhost"))) @@ -92,7 +92,7 @@ var _ = framework.IngressNginxDescribe("X-Forwarded headers", func() { Set("X-Forwarded-Host", "myhost"). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(body).Should(ContainSubstring(fmt.Sprintf("host=forwarded-headers"))) Expect(body).Should(ContainSubstring(fmt.Sprintf("x-forwarded-port=80"))) diff --git a/test/e2e/settings/no_auth_locations.go b/test/e2e/settings/no_auth_locations.go index a1eb741fc..546df3043 100644 --- a/test/e2e/settings/no_auth_locations.go +++ b/test/e2e/settings/no_auth_locations.go @@ -67,7 +67,7 @@ var _ = framework.IngressNginxDescribe("No Auth locations", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusUnauthorized)) Expect(body).Should(ContainSubstring("401 Authorization Required")) }) @@ -84,7 +84,7 @@ var _ = framework.IngressNginxDescribe("No Auth locations", func() { SetBasicAuth(username, password). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) @@ -99,7 +99,7 @@ var _ = framework.IngressNginxDescribe("No Auth locations", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) }) }) diff --git a/test/e2e/settings/tls.go b/test/e2e/settings/tls.go index 2247ebff9..6139f6b7d 100644 --- a/test/e2e/settings/tls.go +++ b/test/e2e/settings/tls.go @@ -67,7 +67,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.TLS.Version).Should(BeNumerically("==", tls.VersionTLS12)) Expect(resp.TLS.CipherSuite).Should(BeNumerically("==", tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)) @@ -86,7 +86,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.TLS.Version).Should(BeNumerically("==", tls.VersionTLS10)) Expect(resp.TLS.CipherSuite).Should(BeNumerically("==", tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA)) @@ -116,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Strict-Transport-Security")).Should(ContainSubstring("max-age=86400")) @@ -134,7 +134,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Strict-Transport-Security")).ShouldNot(ContainSubstring("includeSubDomains")) @@ -152,7 +152,7 @@ var _ = framework.IngressNginxDescribe("Settings - TLS)", func() { Set("Host", host). End() - Expect(len(errs)).Should(BeNumerically("==", 0)) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) Expect(resp.Header.Get("Strict-Transport-Security")).Should(ContainSubstring("preload")) }) diff --git a/test/e2e/tcpudp/tcp.go b/test/e2e/tcpudp/tcp.go index 5391d0488..cebb90be2 100644 --- a/test/e2e/tcpudp/tcp.go +++ b/test/e2e/tcpudp/tcp.go @@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("TCP Feature", func() { resp, _, errs := gorequest.New(). Get(fmt.Sprintf("http://%v:%v", ip, port)). End() - Expect(len(errs)).Should(BeEmpty()) + Expect(errs).Should(BeEmpty()) Expect(resp.StatusCode).Should(Equal(200)) }) })