From 2af627f0fe9a6b562eb9d9f5eb255820c17aa8bc Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 29 Sep 2020 08:14:24 -0300 Subject: [PATCH] Fix e2e test error --- test/e2e/annotations/disableaccesslog.go | 44 ++++++------------------ 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/test/e2e/annotations/disableaccesslog.go b/test/e2e/annotations/disableaccesslog.go index 9a83d7c5d..dab54c561 100644 --- a/test/e2e/annotations/disableaccesslog.go +++ b/test/e2e/annotations/disableaccesslog.go @@ -33,49 +33,25 @@ var _ = framework.DescribeAnnotation("disable-access-log disable-http-access-log ginkgo.It("disable-access-log set access_log off", func() { host := "disableaccesslog.foo.com" - annotations := map[string]string{ - "nginx.ingress.kubernetes.io/disable-access-log": "true", - } - ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations) + f.UpdateNginxConfigMapData("disable-access-log", "true") + ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil) f.EnsureIngress(ing) - f.WaitForNginxServer(host, - func(server string) bool { - str := ` - multiline - string.` - return strings.Contains(server, `access_log off;`) - }) + f.WaitForNginxConfiguration(func(ngx string) bool { + return strings.Contains(ngx, `access_log off;`) + }) }) ginkgo.It("disable-http-access-log set access_log off", func() { host := "disablehttpaccesslog.foo.com" - annotations := map[string]string{ - "nginx.ingress.kubernetes.io/disable-http-access-log": "true", - } - ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations) + f.UpdateNginxConfigMapData("disable-http-access-log", "true") + ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil) f.EnsureIngress(ing) - f.WaitForNginxServer(host, - func(server string) bool { - return strings.Contains(server, `access_log off;`) - }) - }) - - ginkgo.It("disable-stream-access-log set access_log off", func() { - host := "disablehttpaccesslog.foo.com" - annotations := map[string]string{ - "nginx.ingress.kubernetes.io/disable-stream-access-log": "true", - } - - ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations) - f.EnsureIngress(ing) - - f.WaitForNginxServer(host, - func(server string) bool { - return strings.Contains(server, `access_log off;`) - }) + f.WaitForNginxConfiguration(func(ngx string) bool { + return strings.Contains(ngx, `access_log off;`) + }) }) })