Skip to content

Commit bde121a

Browse files
committed
use MustPassRepeatedly
1 parent 0f48040 commit bde121a

File tree

1 file changed

+36
-44
lines changed

1 file changed

+36
-44
lines changed

test/e2e/settings/ssl_passthrough.go

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -220,56 +220,48 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
220220
}
221221
tries := 3
222222

223-
ginkgo.It("should handle known traffic without Host header", func() {
224-
for i := 0; i < tries; i++ {
225-
f.HTTPTestClientWithTLSConfig(tlsConfig).
226-
GET("/").
227-
WithURL(url).
228-
ForceResolve(f.GetNginxIP(), 443).
229-
WithDialContextMiddleware(throttleMiddleware).
230-
Expect().
231-
Status(http.StatusOK)
232-
}
223+
ginkgo.It("should handle known traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() {
224+
f.HTTPTestClientWithTLSConfig(tlsConfig).
225+
GET("/").
226+
WithURL(url).
227+
ForceResolve(f.GetNginxIP(), 443).
228+
WithDialContextMiddleware(throttleMiddleware).
229+
Expect().
230+
Status(http.StatusOK)
233231
})
234232

235-
ginkgo.It("should handle insecure traffic without Host header", func() {
236-
for i := 0; i < tries; i++ {
237-
//nolint:gosec // Ignore the gosec error in testing
238-
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
239-
GET("/").
240-
WithURL(url).
241-
ForceResolve(f.GetNginxIP(), 443).
242-
WithDialContextMiddleware(throttleMiddleware).
243-
Expect().
244-
Status(http.StatusOK)
245-
}
233+
ginkgo.It("should handle insecure traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() {
234+
//nolint:gosec // Ignore the gosec error in testing
235+
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
236+
GET("/").
237+
WithURL(url).
238+
ForceResolve(f.GetNginxIP(), 443).
239+
WithDialContextMiddleware(throttleMiddleware).
240+
Expect().
241+
Status(http.StatusOK)
246242
})
247243

248-
ginkgo.It("should handle known traffic with Host header", func() {
249-
for i := 0; i < tries; i++ {
250-
f.HTTPTestClientWithTLSConfig(tlsConfig).
251-
GET("/").
252-
WithURL(url).
253-
WithHeader("Host", host).
254-
ForceResolve(f.GetNginxIP(), 443).
255-
WithDialContextMiddleware(throttleMiddleware).
256-
Expect().
257-
Status(http.StatusOK)
258-
}
244+
ginkgo.It("should handle known traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() {
245+
f.HTTPTestClientWithTLSConfig(tlsConfig).
246+
GET("/").
247+
WithURL(url).
248+
WithHeader("Host", host).
249+
ForceResolve(f.GetNginxIP(), 443).
250+
WithDialContextMiddleware(throttleMiddleware).
251+
Expect().
252+
Status(http.StatusOK)
259253
})
260254

261-
ginkgo.It("should handle insecure traffic with Host header", func() {
262-
for i := 0; i < tries; i++ {
263-
//nolint:gosec // Ignore the gosec error in testing
264-
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
265-
GET("/").
266-
WithURL(url).
267-
WithHeader("Host", host).
268-
ForceResolve(f.GetNginxIP(), 443).
269-
WithDialContextMiddleware(throttleMiddleware).
270-
Expect().
271-
Status(http.StatusOK)
272-
}
255+
ginkgo.It("should handle insecure traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() {
256+
//nolint:gosec // Ignore the gosec error in testing
257+
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
258+
GET("/").
259+
WithURL(url).
260+
WithHeader("Host", host).
261+
ForceResolve(f.GetNginxIP(), 443).
262+
WithDialContextMiddleware(throttleMiddleware).
263+
Expect().
264+
Status(http.StatusOK)
273265
})
274266
})
275267
})

0 commit comments

Comments
 (0)