Skip to content

Commit b32200b

Browse files
committed
add key assertion in gateway e2e test
1 parent c82c3c4 commit b32200b

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

test/e2e/gatewayapi/gateway.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ spec:
206206
listeners:
207207
- name: http1
208208
protocol: HTTPS
209-
port: 80
209+
port: 443
210210
hostname: %s
211211
tls:
212212
certificateRefs:
@@ -229,6 +229,7 @@ spec:
229229
assert.Len(GinkgoT(), tls, 1, "tls number not expect")
230230
assert.Equal(GinkgoT(), Cert, tls[0].Cert, "tls cert not expect")
231231
assert.Equal(GinkgoT(), []string{host}, tls[0].Snis)
232+
assert.Equal(GinkgoT(), Key, tls[0].Key, "tls key not expect, got "+tls[0].Key)
232233
})
233234
})
234235
})

test/e2e/gatewayapi/httproute.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ spec:
125125
Expect(gwyaml).To(ContainSubstring(`status: "True"`), "checking Gateway condition status")
126126
Expect(gwyaml).To(ContainSubstring("message: the gateway has been accepted by the api7-ingress-controller"), "checking Gateway condition message")
127127
}
128-
FContext("HTTPRoute with HTTPS Gateway", func() {
128+
Context("HTTPRoute with HTTPS Gateway", func() {
129129
var exactRouteByGet = `
130130
apiVersion: gateway.networking.k8s.io/v1
131131
kind: HTTPRoute
@@ -153,22 +153,23 @@ spec:
153153
ResourceApplied("HTTPRoute", "httpbin", exactRouteByGet, 1)
154154

155155
By("access dataplane to check the HTTPRoute")
156+
// time.Sleep(1000000 * time.Second)
156157
s.NewAPISIXClientWithHTTPS().
157158
GET("/get").
158159
WithHost("api6.com").
159160
Expect().
160161
Status(200)
161-
time.Sleep(1000 * time.Second)
162-
// By("delete HTTPRoute")
163-
// err := s.DeleteResourceFromString(exactRouteByGet)
164-
// Expect(err).NotTo(HaveOccurred(), "deleting HTTPRoute")
165-
// time.Sleep(5 * time.Second)
166-
167-
// s.NewAPISIXClientWithHTTPS().
168-
// GET("/get").
169-
// WithHost("api6.com").
170-
// Expect().
171-
// Status(404)
162+
// time.Sleep(1000 * time.Second)
163+
By("delete HTTPRoute")
164+
err := s.DeleteResourceFromString(exactRouteByGet)
165+
Expect(err).NotTo(HaveOccurred(), "deleting HTTPRoute")
166+
time.Sleep(5 * time.Second)
167+
168+
s.NewAPISIXClientWithHTTPS().
169+
GET("/get").
170+
WithHost("api6.com").
171+
Expect().
172+
Status(404)
172173
})
173174
})
174175

0 commit comments

Comments
 (0)