@@ -19,33 +19,18 @@ package v1alpha1
1919
2020import (
2121 "fmt"
22+ "time"
2223
2324 . "github.com/onsi/ginkgo/v2"
2425 . "github.com/onsi/gomega"
2526
27+ "github.com/apache/apisix-ingress-controller/internal/provider/adc"
2628 "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
2729)
2830
2931var _ = Describe ("Test Consumer" , Label ("apisix.apache.org" , "v1alpha1" , "consumer" ), func () {
3032 s := scaffold .NewDefaultScaffold ()
3133
32- var defaultGatewayProxy = `
33- apiVersion: apisix.apache.org/v1alpha1
34- kind: GatewayProxy
35- metadata:
36- name: apisix-proxy-config
37- spec:
38- provider:
39- type: ControlPlane
40- controlPlane:
41- endpoints:
42- - %s
43- auth:
44- type: AdminKey
45- adminKey:
46- value: "%s"
47- `
48-
4934 var defaultGatewayClass = `
5035apiVersion: gateway.networking.k8s.io/v1
5136kind: GatewayClass
@@ -152,7 +137,7 @@ spec:
152137`
153138
154139 BeforeEach (func () {
155- s .ApplyDefaultGatewayResource (defaultGatewayProxy , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
140+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec () , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
156141 })
157142
158143 It ("limit-count plugin" , func () {
@@ -248,7 +233,7 @@ spec:
248233`
249234
250235 BeforeEach (func () {
251- s .ApplyDefaultGatewayResource (defaultGatewayProxy , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
236+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec () , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
252237 })
253238
254239 It ("Create/Update/Delete" , func () {
@@ -397,7 +382,7 @@ spec:
397382`
398383
399384 BeforeEach (func () {
400- s .ApplyDefaultGatewayResource (defaultGatewayProxy , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
385+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec () , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
401386 })
402387 It ("Create/Update/Delete" , func () {
403388 err := s .CreateResourceFromString (keyAuthSecret )
@@ -518,7 +503,7 @@ spec:
518503`
519504
520505 BeforeEach (func () {
521- s .ApplyDefaultGatewayResource (defaultGatewayProxy , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
506+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec () , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
522507 })
523508
524509 It ("Should sync consumer when GatewayProxy is updated" , func () {
@@ -611,10 +596,13 @@ spec:
611596`
612597
613598 BeforeEach (func () {
614- s .ApplyDefaultGatewayResource (defaultGatewayProxy , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
599+ s .ApplyDefaultGatewayResource (s . GetGatewayProxySpec () , defaultGatewayClass , defaultGateway , defaultHTTPRoute )
615600 })
616601
617602 It ("Should sync Consumer during startup" , func () {
603+ if s .Deployer .Name () == adc .BackendModeAPI7EE {
604+ Skip ("skipping test in API7EE mode" )
605+ }
618606 Expect (s .CreateResourceFromString (consumer2 )).NotTo (HaveOccurred (), "creating unused consumer" )
619607 s .ResourceApplied ("Consumer" , "consumer-sample" , consumer1 , 1 )
620608
@@ -644,14 +632,16 @@ spec:
644632 s .Deployer .ScaleDataplane (1 )
645633 s .Deployer .ScaleIngress (1 )
646634
635+ By ("check consumer sync" )
647636 s .RequestAssert (& scaffold.RequestAssert {
648637 Method : "GET" ,
649638 Path : "/get" ,
650639 Host : "httpbin.org" ,
651640 Headers : map [string ]string {
652641 "apikey" : "sample-key" ,
653642 },
654- Check : scaffold .WithExpectedStatus (200 ),
643+ Timeout : 1 * time .Minute ,
644+ Check : scaffold .WithExpectedStatus (200 ),
655645 })
656646
657647 s .RequestAssert (& scaffold.RequestAssert {
0 commit comments