Fix unitest issue
This commit is contained in:
parent
43354ddd2c
commit
f7556a3634
1 changed files with 18 additions and 0 deletions
|
@ -645,10 +645,28 @@ var _ = framework.IngressNginxDescribe("[Flag] ingress-class", func() {
|
|||
Status(http.StatusOK)
|
||||
})
|
||||
|
||||
ginkgo.It("should watch Ingress with matched Ingress.Spec.IngressClassName and CLI parameter --ingress-class", func() {
|
||||
validHost := fooHost
|
||||
|
||||
ing := framework.NewSingleIngress(validHost, "/", validHost, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxConfiguration(func(cfg string) bool {
|
||||
return !strings.Contains(cfg, "server_name noclassforyou")
|
||||
})
|
||||
|
||||
f.HTTPTestClient().
|
||||
GET("/").
|
||||
WithHeader("Host", validHost).
|
||||
Expect().
|
||||
Status(http.StatusOK)
|
||||
})
|
||||
|
||||
ginkgo.It("should ignore Ingress with only IngressClassName", func() {
|
||||
invalidHost := "noclassforyou"
|
||||
|
||||
ing := framework.NewSingleIngress(invalidHost, "/", invalidHost, f.Namespace, framework.EchoService, 80, nil)
|
||||
ing.Spec.IngressClassName = &invalidHost
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxConfiguration(func(cfg string) bool {
|
||||
|
|
Loading…
Reference in a new issue