Skip to content

Commit c32e8d3

Browse files
committed
adding one GIE test
1 parent ac88cdc commit c32e8d3

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

test/extended/router/gatewayapicontroller.go

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ const (
4747
var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feature:Router][apigroup:gateway.networking.k8s.io]", g.Ordered, g.Serial, func() {
4848
defer g.GinkgoRecover()
4949
var (
50-
oc = exutil.NewCLIWithPodSecurityLevel("gatewayapi-controller", admissionapi.LevelBaseline)
51-
csvName string
52-
err error
53-
gateways []string
50+
oc = exutil.NewCLIWithPodSecurityLevel("gatewayapi-controller", admissionapi.LevelBaseline)
51+
csvName string
52+
err error
53+
gateways []string
54+
infPoolCRD = "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api-inference-extension/main/config/crd/bases/inference.networking.k8s.io_inferencepools.yaml"
5455
)
5556

5657
const (
@@ -246,6 +247,28 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
246247
g.By("Validating the http connectivity to the backend application")
247248
assertHttpRouteConnection(defaultRoutename)
248249
})
250+
251+
g.It("Ensure GIE is enabled after creating an inferencePool CRD", func() {
252+
errCheck := checkGatewayClass(oc, gatewayClassName)
253+
o.Expect(errCheck).NotTo(o.HaveOccurred(), "GatewayClass %q was not installed and accepted", gatewayClassName)
254+
255+
g.By("Install the GIE CRD")
256+
err := oc.AsAdmin().Run("create").Args("-f", infPoolCRD).Execute()
257+
o.Expect(err).NotTo(o.HaveOccurred())
258+
259+
g.By("Confirm istio is healthy and contains the env variable")
260+
waitForIstioHealthy(oc)
261+
istioEnv, err := oc.AsAdmin().Run("get").Args("-n", "openshift-ingress", "istio", "openshift-gateway", "-o=jsonpath={.spec.values.pilot.env}").Output()
262+
o.Expect(err).NotTo(o.HaveOccurred())
263+
o.Expect(istioEnv).To(o.ContainSubstring(`ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true`))
264+
265+
g.By("Uninstall the GIE CRD and confirm the env variable is removed")
266+
err = oc.AsAdmin().Run("delete").Args("-f", infPoolCRD).Execute()
267+
o.Expect(err).NotTo(o.HaveOccurred())
268+
istioEnv, err = oc.AsAdmin().Run("get").Args("-n", "openshift-ingress", "istio", "openshift-gateway", "-o=jsonpath={.spec.values.pilot.env}").Output()
269+
o.Expect(err).NotTo(o.HaveOccurred())
270+
o.Expect(istioEnv).NotTo(o.ContainSubstring(`ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true`))
271+
})
249272
})
250273

251274
func skipGatewayIfNonCloudPlatform(oc *exutil.CLI) {

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zz_generated.manifests/test-reporting.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ spec:
405405
Verify Gateway API CRDs and ensure required CRDs should already be installed'
406406
- featureGate: GatewayAPIController
407407
tests:
408+
- testName: '[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feature:Router][apigroup:gateway.networking.k8s.io]
409+
Ensure GIE is enabled after creating an inferencePool CRD'
408410
- testName: '[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feature:Router][apigroup:gateway.networking.k8s.io]
409411
Ensure HTTPRoute object is created'
410412
- testName: '[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feature:Router][apigroup:gateway.networking.k8s.io]

0 commit comments

Comments
 (0)