Improved disableaccesslog tests (#7463)
1. Added check to validate if nginx ingress controller is reachable after disabling access log. 2. Added disable-stream-access-log test
This commit is contained in:
parent
7842d732b0
commit
b510b0e930
1 changed files with 31 additions and 0 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue