Fix http default backend test
This commit is contained in:
parent
910297f9da
commit
5f14abced0
1 changed files with 16 additions and 16 deletions
|
@ -63,25 +63,25 @@ var _ = framework.IngressNginxDescribe("[Default Backend]", func() {
|
||||||
framework.Sleep()
|
framework.Sleep()
|
||||||
|
|
||||||
for _, test := range testCases {
|
for _, test := range testCases {
|
||||||
ginkgo.By(test.Name)
|
ginkgo.By(test.Name, func() {
|
||||||
|
var req *httpexpect.HTTPRequest
|
||||||
|
|
||||||
var req *httpexpect.HTTPRequest
|
switch test.Scheme {
|
||||||
|
case framework.HTTP:
|
||||||
|
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTP) + test.Path)
|
||||||
|
case framework.HTTPS:
|
||||||
|
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTPS) + test.Path)
|
||||||
|
default:
|
||||||
|
ginkgo.Fail("Unexpected request scheme")
|
||||||
|
}
|
||||||
|
|
||||||
switch test.Scheme {
|
if test.Host != "" {
|
||||||
case framework.HTTP:
|
req.WithHeader("Host", test.Host)
|
||||||
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTP) + test.Path)
|
}
|
||||||
case framework.HTTPS:
|
|
||||||
req = f.HTTPTestClient().DoRequest(test.Method, test.Path).WithURL(f.GetURL(framework.HTTPS) + test.Path)
|
|
||||||
default:
|
|
||||||
ginkgo.Fail("Unexpected request scheme")
|
|
||||||
}
|
|
||||||
|
|
||||||
if test.Host != "" {
|
req.Expect().
|
||||||
req.WithHeader("Host", test.Host)
|
Status(test.Status)
|
||||||
}
|
})
|
||||||
|
|
||||||
req.Expect().
|
|
||||||
Status(test.Status)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue