Skip to content

Commit

Permalink
use MustPassRepeatedly
Browse files Browse the repository at this point in the history
  • Loading branch information
chotiwat committed Feb 16, 2024
1 parent dea24f1 commit d042a37
Showing 1 changed file with 36 additions and 44 deletions.
80 changes: 36 additions & 44 deletions test/e2e/settings/ssl_passthrough.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,56 +220,48 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
}
tries := 3

ginkgo.It("should handle known traffic without Host header", func() {
for i := 0; i < tries; i++ {
f.HTTPTestClientWithTLSConfig(tlsConfig).
GET("/").
WithURL(url).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
}
ginkgo.It("should handle known traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() {
f.HTTPTestClientWithTLSConfig(tlsConfig).
GET("/").
WithURL(url).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
})

ginkgo.It("should handle insecure traffic without Host header", func() {
for i := 0; i < tries; i++ {
//nolint:gosec // Ignore the gosec error in testing
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
GET("/").
WithURL(url).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
}
ginkgo.It("should handle insecure traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() {
//nolint:gosec // Ignore the gosec error in testing
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
GET("/").
WithURL(url).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
})

ginkgo.It("should handle known traffic with Host header", func() {
for i := 0; i < tries; i++ {
f.HTTPTestClientWithTLSConfig(tlsConfig).
GET("/").
WithURL(url).
WithHeader("Host", host).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
}
ginkgo.It("should handle known traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() {
f.HTTPTestClientWithTLSConfig(tlsConfig).
GET("/").
WithURL(url).
WithHeader("Host", host).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
})

ginkgo.It("should handle insecure traffic with Host header", func() {
for i := 0; i < tries; i++ {
//nolint:gosec // Ignore the gosec error in testing
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
GET("/").
WithURL(url).
WithHeader("Host", host).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
}
ginkgo.It("should handle insecure traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() {
//nolint:gosec // Ignore the gosec error in testing
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
GET("/").
WithURL(url).
WithHeader("Host", host).
ForceResolve(f.GetNginxIP(), 443).
WithDialContextMiddleware(throttleMiddleware).
Expect().
Status(http.StatusOK)
})
})
})
Expand Down

0 comments on commit d042a37

Please sign in to comment.