Skip to content

Commit a4bf0d0

Browse files
authored
Merge pull request #30087 from kevinrizza/reenable-oidc-tests
CNTRLPLANE-945: OIDC/enable skipped tests
2 parents 4ad9050 + 8cba85d commit a4bf0d0

File tree

3 files changed

+33
-42
lines changed

3 files changed

+33
-42
lines changed

test/extended/authentication/oidc.go

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,12 @@ var _ = g.Describe("[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow]
113113
o.Expect(apiServerArgs["authentication-config"].([]interface{})[0].(string)).To(o.Equal("/etc/kubernetes/static-pod-resources/configmaps/auth-config/auth-config.json"))
114114
})
115115

116-
g.It("[Skipped] should remove the OpenShift OAuth stack", func() {
117-
g.Skip("functionality not yet implemented")
118-
/*
119-
o.Eventually(func(gomega o.Gomega) {
120-
_, err := oc.AdminKubeClient().AppsV1().Deployments("openshift-authentication").Get(ctx, "oauth-openshift", metav1.GetOptions{})
121-
gomega.Expect(err).NotTo(o.BeNil(), "should not be able to get the integrated oauth stack")
122-
gomega.Expect(apierrors.IsNotFound(err)).To(o.BeTrue(), "integrated oauth stack should not be present when OIDC authentication is configured")
123-
}).WithTimeout(20 * time.Minute).WithPolling(30 * time.Second).Should(o.Succeed())
124-
*/
116+
g.It("should remove the OpenShift OAuth stack", func() {
117+
o.Eventually(func(gomega o.Gomega) {
118+
_, err := oc.AdminKubeClient().AppsV1().Deployments("openshift-authentication").Get(ctx, "oauth-openshift", metav1.GetOptions{})
119+
gomega.Expect(err).NotTo(o.BeNil(), "should not be able to get the integrated oauth stack")
120+
gomega.Expect(apierrors.IsNotFound(err)).To(o.BeTrue(), "integrated oauth stack should not be present when OIDC authentication is configured")
121+
}).WithTimeout(5 * time.Minute).WithPolling(10 * time.Second).Should(o.Succeed())
125122
})
126123

127124
g.It("should not accept tokens provided by the OAuth server", func() {
@@ -332,32 +329,26 @@ var _ = g.Describe("[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow]
332329
})
333330
})
334331

335-
g.Describe("[Skipped] with invalid specified UID or Extra claim mappings", func() {
332+
g.Describe("with invalid specified UID or Extra claim mappings", func() {
336333
g.It("should reject admission when UID claim expression is not compilable CEL", func() {
337-
g.Skip("functionality not yet implemented")
338-
/*
339-
_, _, err := configureOIDCAuthentication(ctx, oc, func(o *configv1.OIDCProvider) {
340-
o.ClaimMappings.UID = &configv1.TokenClaimOrExpressionMapping{
341-
Expression: "!@&*#^",
342-
}
343-
})
344-
o.Expect(err).To(o.HaveOccurred(), "should encounter an error configuring OIDC authentication")
345-
*/
334+
_, _, err := configureOIDCAuthentication(ctx, oc, keycloakNamespace, func(o *configv1.OIDCProvider) {
335+
o.ClaimMappings.UID = &configv1.TokenClaimOrExpressionMapping{
336+
Expression: "!@&*#^",
337+
}
338+
})
339+
o.Expect(err).To(o.HaveOccurred(), "should encounter an error configuring OIDC authentication")
346340
})
347341

348342
g.It("should reject admission when Extra claim expression is not compilable CEL", func() {
349-
g.Skip("functionality not yet implemented")
350-
/*
351-
_, _, err := configureOIDCAuthentication(ctx, oc, func(o *configv1.OIDCProvider) {
352-
o.ClaimMappings.Extra = []configv1.ExtraMapping{
353-
{
354-
Key: "payload/test",
355-
ValueExpression: "!@*&#^!@(*&^",
356-
},
357-
}
358-
})
359-
o.Expect(err).To(o.HaveOccurred(), "should encounter an error configuring OIDC authentication")
360-
*/
343+
_, _, err := configureOIDCAuthentication(ctx, oc, keycloakNamespace, func(o *configv1.OIDCProvider) {
344+
o.ClaimMappings.Extra = []configv1.ExtraMapping{
345+
{
346+
Key: "payload/test",
347+
ValueExpression: "!@*&#^!@(*&^",
348+
},
349+
}
350+
})
351+
o.Expect(err).To(o.HaveOccurred(), "should encounter an error configuring OIDC authentication")
361352
})
362353
})
363354
})

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

Lines changed: 4 additions & 4 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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ spec:
336336
when enabled'
337337
- featureGate: ExternalOIDC
338338
tests:
339-
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
340-
[OCPFeatureGate:ExternalOIDC] external IdP is configured [Skipped] should
341-
remove the OpenShift OAuth stack'
342339
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
343340
[OCPFeatureGate:ExternalOIDC] external IdP is configured should accept authentication
344341
via a certificate-based kubeconfig (break-glass)'
@@ -351,6 +348,9 @@ spec:
351348
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
352349
[OCPFeatureGate:ExternalOIDC] external IdP is configured should not accept
353350
tokens provided by the OAuth server'
351+
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
352+
[OCPFeatureGate:ExternalOIDC] external IdP is configured should remove the
353+
OpenShift OAuth stack'
354354
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
355355
[OCPFeatureGate:ExternalOIDC] reverting to IntegratedOAuth should accept tokens
356356
provided by the OpenShift OAuth server'
@@ -367,12 +367,12 @@ spec:
367367
tests:
368368
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
369369
[OCPFeatureGate:ExternalOIDCWithUIDAndExtraClaimMappings] external IdP is
370-
configured [Skipped] with invalid specified UID or Extra claim mappings should
371-
reject admission when Extra claim expression is not compilable CEL'
370+
configured with invalid specified UID or Extra claim mappings should reject
371+
admission when Extra claim expression is not compilable CEL'
372372
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
373373
[OCPFeatureGate:ExternalOIDCWithUIDAndExtraClaimMappings] external IdP is
374-
configured [Skipped] with invalid specified UID or Extra claim mappings should
375-
reject admission when UID claim expression is not compilable CEL'
374+
configured with invalid specified UID or Extra claim mappings should reject
375+
admission when UID claim expression is not compilable CEL'
376376
- testName: '[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]
377377
[OCPFeatureGate:ExternalOIDCWithUIDAndExtraClaimMappings] external IdP is
378378
configured with valid specified UID or Extra claim mappings checking cluster

0 commit comments

Comments
 (0)