added checks to verify backend works with the given configs (#7415)
Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
This commit is contained in:
parent
f222c752be
commit
5315ab24ff
1 changed files with 37 additions and 1 deletions
|
@ -18,10 +18,10 @@ package annotations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
|
|
||||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -46,6 +46,12 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set client_body_buffer_size to 1K", func() {
|
ginkgo.It("should set client_body_buffer_size to 1K", func() {
|
||||||
|
@ -62,6 +68,12 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set client_body_buffer_size to 1k", func() {
|
ginkgo.It("should set client_body_buffer_size to 1k", func() {
|
||||||
|
@ -78,6 +90,12 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set client_body_buffer_size to 1m", func() {
|
ginkgo.It("should set client_body_buffer_size to 1m", func() {
|
||||||
|
@ -94,6 +112,12 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set client_body_buffer_size to 1M", func() {
|
ginkgo.It("should set client_body_buffer_size to 1M", func() {
|
||||||
|
@ -110,6 +134,12 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not set client_body_buffer_size to invalid 1b", func() {
|
ginkgo.It("should not set client_body_buffer_size to invalid 1b", func() {
|
||||||
|
@ -126,5 +156,11 @@ var _ = framework.DescribeAnnotation("client-body-buffer-size", func() {
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
return !strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
return !strings.Contains(server, fmt.Sprintf("client_body_buffer_size %s;", clientBodyBufferSize))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
f.HTTPTestClient().
|
||||||
|
GET("/").
|
||||||
|
WithHeader("Host", host).
|
||||||
|
Expect().
|
||||||
|
Status(http.StatusOK)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue