Skip to content

Commit 371fd9d

Browse files
committed
apply sug
1 parent 460a891 commit 371fd9d

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

test/e2e/suite-chore/etcd_consistency.go

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ spec:
5454

5555
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK)
5656
})
57-
58-
ginkgo.By("restart ingress controller")
59-
s.RestartIngressControllerDeploy()
60-
61-
ginkgo.By("apply route again and this should take effect", func() {
57+
ginkgo.By("apply route again", func() {
6258
backendSvc, backendSvcPort := s.DefaultHTTPBackend()
6359
ar := fmt.Sprintf(`
6460
apiVersion: apisix.apache.org/v2
@@ -83,5 +79,34 @@ spec:
8379

8480
s.NewAPISIXClient().GET("/headers").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK)
8581
})
82+
83+
ginkgo.By("restart ingress controller")
84+
s.RestartIngressControllerDeploy()
85+
86+
ginkgo.By("apply route again and this should take effect", func() {
87+
backendSvc, backendSvcPort := s.DefaultHTTPBackend()
88+
ar := fmt.Sprintf(`
89+
apiVersion: apisix.apache.org/v2
90+
kind: ApisixRoute
91+
metadata:
92+
name: httpbin-route-3
93+
spec:
94+
http:
95+
- name: rule3
96+
match:
97+
hosts:
98+
- httpbin.org
99+
paths:
100+
- /get
101+
backends:
102+
- serviceName: %s
103+
servicePort: %d
104+
`, backendSvc, backendSvcPort[0])
105+
assert.Nil(ginkgo.GinkgoT(), s.CreateVersionedApisixResource(ar))
106+
assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixRoutesCreated(3), "checking number of routes")
107+
assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixUpstreamsCreated(1), "checking number of upstreams")
108+
109+
s.NewAPISIXClient().GET("/get").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK)
110+
})
86111
})
87112
})

0 commit comments

Comments
 (0)