@@ -148,7 +148,7 @@ spec:
148148 })
149149
150150 Context ("Gateway SSL" , func () {
151- PIt ("Check if SSL resource was created" , func () {
151+ It ("Check if SSL resource was created" , func () {
152152 By ("create GatewayProxy" )
153153 gatewayProxy := fmt .Sprintf (gatewayProxyYaml , s .Deployer .GetAdminEndpoint (), s .AdminKey ())
154154 err := s .CreateResourceFromString (gatewayProxy )
@@ -206,10 +206,10 @@ spec:
206206 assert .Len (GinkgoT (), tls , 1 , "tls number not expect" )
207207 assert .Len (GinkgoT (), tls [0 ].Certificates , 1 , "length of certificates not expect" )
208208 assert .Equal (GinkgoT (), Cert , tls [0 ].Certificates [0 ].Certificate , "tls cert not expect" )
209- assert .ElementsMatch (GinkgoT (), []string {host , "*.api6.com" }, tls [0 ].Snis )
209+ assert .ElementsMatch (GinkgoT (), []string {host }, tls [0 ].Snis )
210210 })
211211
212- PIt ("Gateway SSL with and without hostname" , func () {
212+ It ("Gateway SSL with and without hostname" , func () {
213213 By ("create GatewayProxy" )
214214 gatewayProxy := fmt .Sprintf (gatewayProxyYaml , s .Deployer .GetAdminEndpoint (), s .AdminKey ())
215215 err := s .CreateResourceFromString (gatewayProxy )
@@ -277,36 +277,24 @@ spec:
277277 tls , err := s .DefaultDataplaneResource ().SSL ().List (context .Background ())
278278 assert .Nil (GinkgoT (), err , "list tls error" )
279279 assert .Len (GinkgoT (), tls , 1 , "tls number not expect" )
280- assert .Equal (GinkgoT (), Cert , tls [0 ].Cert , "tls cert not expect" )
280+ assert .Len (GinkgoT (), tls [0 ].Certificates , 1 , "length of certificates not expect" )
281+ assert .Equal (GinkgoT (), Cert , tls [0 ].Certificates [0 ].Certificate , "tls cert not expect" )
281282 assert .Equal (GinkgoT (), tls [0 ].Labels ["k8s/controller-name" ], "apisix.apache.org/apisix-ingress-controller" )
282283
283284 By ("update secret" )
284285 err = s .NewKubeTlsSecret (secretName , framework .TestCert , framework .TestKey )
285286 Expect (err ).NotTo (HaveOccurred (), "update secret" )
286287 Eventually (func () string {
287288 tls , err := s .DefaultDataplaneResource ().SSL ().List (context .Background ())
288- assert .Nil (GinkgoT (), err , "list tls error" )
289- assert .Len (GinkgoT (), tls , 1 , "tls number not expect" )
290- assert .Len (GinkgoT (), tls [0 ].Certificates , 1 , "length of certificates not expect" )
291- assert .Equal (GinkgoT (), Cert , tls [0 ].Certificates [0 ].Certificate , "tls cert not expect" )
292- assert .Equal (GinkgoT (), tls [0 ].Labels ["k8s/controller-name" ], "apisix.apache.org/apisix-ingress-controller" )
293-
294- By ("update secret" )
295- err = s .NewKubeTlsSecret (secretName , framework .TestCert , framework .TestKey )
296- Expect (err ).NotTo (HaveOccurred (), "update secret" )
297- Eventually (func () string {
298- tls , err := s .DefaultDataplaneResource ().SSL ().List (context .Background ())
299- Expect (err ).NotTo (HaveOccurred (), "list ssl from dashboard" )
300- if len (tls ) < 1 {
301- return ""
302- }
303- if len (tls [0 ].Certificates ) < 1 {
304- return ""
305- }
306- return tls [0 ].Certificates [0 ].Certificate
307- }).WithTimeout (8 * time .Second ).ProbeEvery (time .Second ).Should (Equal (framework .TestCert ))
308- })
289+ Expect (err ).NotTo (HaveOccurred (), "list ssl from dashboard" )
290+ if len (tls ) < 1 {
291+ return ""
292+ }
293+ if len (tls [0 ].Certificates ) < 1 {
294+ return ""
295+ }
296+ return tls [0 ].Certificates [0 ].Certificate
297+ }).WithTimeout (8 * time .Second ).ProbeEvery (time .Second ).Should (Equal (framework .TestCert ))
309298 })
310299 })
311-
312300})
0 commit comments