diff --git a/test/e2e/annotations/disableaccesslog.go b/test/e2e/annotations/disableaccesslog.go index dab54c561..1824af27c 100644 --- a/test/e2e/annotations/disableaccesslog.go +++ b/test/e2e/annotations/disableaccesslog.go @@ -22,6 +22,7 @@ import ( "github.com/onsi/ginkgo" "k8s.io/ingress-nginx/test/e2e/framework" + "net/http" ) var _ = framework.DescribeAnnotation("disable-access-log disable-http-access-log disable-stream-access-log", func() { @@ -41,6 +42,12 @@ var _ = framework.DescribeAnnotation("disable-access-log disable-http-access-log f.WaitForNginxConfiguration(func(ngx string) bool { return strings.Contains(ngx, `access_log off;`) }) + + f.HTTPTestClient(). + GET("/"). + WithHeader("Host", host). + Expect(). + Status(http.StatusOK) }) ginkgo.It("disable-http-access-log set access_log off", func() { @@ -53,5 +60,29 @@ var _ = framework.DescribeAnnotation("disable-access-log disable-http-access-log f.WaitForNginxConfiguration(func(ngx string) bool { return strings.Contains(ngx, `access_log off;`) }) + + f.HTTPTestClient(). + GET("/"). + WithHeader("Host", host). + Expect(). + Status(http.StatusOK) + }) + + ginkgo.It("disable-stream-access-log set access_log off", func() { + host := "disablehttpaccesslog.foo.com" + + f.UpdateNginxConfigMapData("disable-stream-access-log", "true") + ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil) + f.EnsureIngress(ing) + + f.WaitForNginxConfiguration(func(ngx string) bool { + return strings.Contains(ngx, `access_log off;`) + }) + + f.HTTPTestClient(). + GET("/"). + WithHeader("Host", host). + Expect(). + Status(http.StatusOK) }) })