Fix http default backend test

This commit is contained in:
Ricardo Katz 2023-09-07 21:29:08 -03:00
parent 5f14abced0
commit c6b800e391

View file

@ -63,25 +63,27 @@ var _ = framework.IngressNginxDescribe("[Default Backend]", func() {
framework.Sleep() framework.Sleep()
for _, test := range testCases { for _, test := range testCases {
ginkgo.By(test.Name, func() { ginkgo.By(test.Name)
var req *httpexpect.HTTPRequest framework.Logf("test running is %s", test.Name)
var req *httpexpect.HTTPRequest
switch test.Scheme { switch test.Scheme {
case framework.HTTP: case framework.HTTP:
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTP) + test.Path) req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTP) + test.Path)
case framework.HTTPS: case framework.HTTPS:
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTPS) + test.Path) req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTPS) + test.Path)
default: default:
ginkgo.Fail("Unexpected request scheme") ginkgo.Fail("Unexpected request scheme")
} }
if test.Host != "" { if test.Host != "" {
req.WithHeader("Host", test.Host) req.WithHeader("Host", test.Host)
} }
req.Expect(). framework.Logf("test running req is %+v", req.Request)
Status(test.Status)
}) req.Expect().
Status(test.Status)
} }
}) })