Commit 73c453f
CNTRLPLANE-2589: Migrate test/e2e-oidc to OTE + fix Keycloak token expiration and PSA violations
This PR migrates test/e2e-oidc to OpenShift Tests Extension (OTE) framework with Ginkgo v2
integration and includes critical bug fixes from PR #859.
## OTE Migration Changes:
1. **Dual-Mode Pattern Implementation**
- test/e2e-oidc/external_oidc.go: New Ginkgo test registration with complete OIDC test implementation
- test/e2e-oidc/external_oidc_test.go: Simplified Go test wrapper for backward compatibility
- cmd/cluster-authentication-operator-tests-ext/main.go: Add e2e-oidc import and fix serial suite qualifier
2. **Complete OIDC Authentication Test Workflow**
- Implements full OIDC authentication test (not just preconditions)
- OAuth/OIDC state validation
- auth-config.json checks
- JWT/JWKS verification with kube-apiserver authentication confirmation
3. **OTE Tags**
- [OIDC][Serial][Disruptive] TestExternalOIDCWithKeycloak [Timeout:3h]
## Bug Fixes from PR #859:
1. **Keycloak Token Expiration (test/e2e/keycloak.go)**
- Problem: Test discarded kcClient with 30-minute token, created new client with 5-minute token
- Result: 401 errors in long-running tests
- Fix: Reuse kcClient from AddKeycloakIDP() with extended token lifetime
- Impact: Eliminates intermittent TestKeycloakAsOIDCPasswordGrantCheckAndGroupSync failures
2. **PSA Audit Violations (test/library/client.go)**
- Problem: WithPSaEnforcement() only set enforce label
- Result: PSA audit/warn violations logged
- Fix: Set all three PSA labels (enforce, audit, warn) for consistent behavior
- Impact: Prevents Pod Security Admission audit log violations
## Library Enhancements:
- test/library/imagestream.go: ImportImageToImageStream() for importing external images
- test/library/idpdeployment.go: Configurable security context, deployPodWithImageStream()
- test/library/keycloakidp.go: ImageStream integration, restricted security context
- test/library/gitlabidp.go: ImageStream integration
- test/library/waits.go: Enhanced wait utilities accepting testing.TB
- test/library/client.go: TestNamespaceBuilder with PSA enforcement methods
## Vendor Dependencies:
- Added github.com/openshift/client-go/image/* for ImageStream client support
Co-Authored-By: Rohit Patil <ropatil@redhat.com>1 parent cc6815a commit 73c453f
44 files changed
Lines changed: 4934 additions & 1202 deletions
File tree
- cmd/cluster-authentication-operator-tests-ext
- test
- e2e-oidc
- e2e
- library
- vendor
- github.com/openshift/client-go/image
- applyconfigurations
- image/v1
- internal
- clientset/versioned
- scheme
- typed/image/v1
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | | - | |
82 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | | - | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
0 commit comments