@@ -48,7 +48,7 @@ func init() {
48
48
var OIDCTest = suite.ConformanceTest {
49
49
ShortName : "OIDC" ,
50
50
Description : "Test OIDC authentication" ,
51
- Manifests : []string {"testdata/oidc-keycloak.yaml" , "testdata/oidc-securitypolicy.yaml" },
51
+ Manifests : []string {"testdata/oidc-keycloak.yaml" },
52
52
Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
53
53
t .Run ("oidc provider represented by a URL" , func (t * testing.T ) {
54
54
testOIDC (t , suite , "testdata/oidc-securitypolicy.yaml" )
@@ -104,6 +104,13 @@ func testOIDC(t *testing.T, suite *suite.ConformanceTestSuite, securityPolicyMan
104
104
ns = "gateway-conformance-infra"
105
105
)
106
106
107
+ podInitialized := corev1.PodCondition {Type : corev1 .PodInitialized , Status : corev1 .ConditionTrue }
108
+ // Wait for the keycloak pod to be configured with the test user and client
109
+ WaitForPods (t , suite .Client , ns , map [string ]string {"job-name" : "setup-keycloak" }, corev1 .PodSucceeded , podInitialized )
110
+
111
+ // Apply the security policy that configures OIDC authentication
112
+ suite .Applier .MustApplyWithCleanup (t , suite .Client , suite .TimeoutConfig , securityPolicyManifest , false )
113
+
107
114
routeNN := types.NamespacedName {Name : route , Namespace : ns }
108
115
gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
109
116
httpGWAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN , "http" ), routeNN )
@@ -115,12 +122,8 @@ func testOIDC(t *testing.T, suite *suite.ConformanceTestSuite, securityPolicyMan
115
122
Namespace : gatewayapi .NamespacePtr (gwNN .Namespace ),
116
123
Name : gwapiv1 .ObjectName (gwNN .Name ),
117
124
}
118
- SecurityPolicyMustBeAccepted (t , suite .Client , types.NamespacedName {Name : sp , Namespace : ns }, suite .ControllerName , ancestorRef )
119
125
120
- podInitialized := corev1.PodCondition {Type : corev1 .PodInitialized , Status : corev1 .ConditionTrue }
121
-
122
- // Wait for the keycloak pod to be configured with the test user and client
123
- WaitForPods (t , suite .Client , ns , map [string ]string {"job-name" : "setup-keycloak" }, corev1 .PodSucceeded , podInitialized )
126
+ SecurityPolicyMustBeAccepted (t , suite .Client , types.NamespacedName {Name : sp , Namespace : ns }, suite .ControllerName , ancestorRef )
124
127
125
128
// Initialize the test OIDC client that will keep track of the state of the OIDC login process
126
129
oidcClient , err := NewOIDCTestClient (
0 commit comments