Skip to content

Commit

Permalink
Fix test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
rikatz committed Nov 13, 2024
1 parent f3e7f3a commit 8eac53c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion test/e2e/lua/dynamic_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ func createIngress(f *framework.Framework, host, deploymentName string) {

f.WaitForNginxServer(host,
func(server string) bool {
return strings.Contains(server, fmt.Sprintf("server_name %s;", host)) &&
return (strings.Contains(server, fmt.Sprintf("server_name %s;", host)) ||
strings.Contains(server, fmt.Sprintf("server_name %s ;", host))) &&
strings.Contains(server, "proxy_pass http://upstream_balancer;")
})
}
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ var _ = framework.IngressNginxDescribe("[metrics] exported prometheus metrics",
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
f.WaitForNginxServer(host,
func(server string) bool {
return strings.Contains(server, fmt.Sprintf("server_name %s;", host)) &&
return (strings.Contains(server, fmt.Sprintf("server_name %s;", host)) ||
strings.Contains(server, fmt.Sprintf("server_name %s ;", host))) &&
strings.Contains(server, "proxy_pass http://upstream_balancer;")
})
})
Expand Down
12 changes: 8 additions & 4 deletions test/e2e/settings/badannotationvalues.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var _ = framework.DescribeAnnotation("Bad annotation values", func() {

f.WaitForNginxServer(host,
func(server string) bool {
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host))
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host)) &&
!strings.Contains(server, fmt.Sprintf("server_name %s ;", host))
})

f.WaitForNginxServer(host,
Expand Down Expand Up @@ -87,7 +88,8 @@ var _ = framework.DescribeAnnotation("Bad annotation values", func() {

f.WaitForNginxServer(host,
func(server string) bool {
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host))
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host)) &&
!strings.Contains(server, fmt.Sprintf("server_name %s ;", host))
})

f.WaitForNginxServer(host,
Expand Down Expand Up @@ -123,7 +125,8 @@ var _ = framework.DescribeAnnotation("Bad annotation values", func() {

f.WaitForNginxServer(hostValid,
func(server string) bool {
return strings.Contains(server, fmt.Sprintf("server_name %s;", hostValid))
return strings.Contains(server, fmt.Sprintf("server_name %s;", hostValid)) ||
strings.Contains(server, fmt.Sprintf("server_name %s ;", hostValid))
})

f.WaitForNginxServer(hostValid,
Expand Down Expand Up @@ -156,7 +159,8 @@ var _ = framework.DescribeAnnotation("Bad annotation values", func() {

f.WaitForNginxServer(host,
func(server string) bool {
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host))
return !strings.Contains(server, fmt.Sprintf("server_name %s;", host)) &&
!strings.Contains(server, fmt.Sprintf("server_name %s ;", host))
})

f.WaitForNginxServer(host,
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/settings/limit_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ var _ = framework.DescribeSetting("Configmap - limit-rate", func() {
f.EnsureIngress(ing)

f.WaitForNginxServer(host, func(server string) bool {
return strings.Contains(server, fmt.Sprintf("server_name %s;", host))
return strings.Contains(server, fmt.Sprintf("server_name %s;", host)) ||
strings.Contains(server, fmt.Sprintf("server_name %s ;", host))
})

wlKey := "limit-rate"
Expand Down

0 comments on commit 8eac53c

Please sign in to comment.