Skip to content

Commit 6f5a157

Browse files
kuiwang02ci-robot
authored andcommitted
UPSTREAM: <carry>: add disconnected environment support with custom prow job for migrated qe cases
1 parent 86790b0 commit 6f5a157

File tree

4 files changed

+199
-17
lines changed

4 files changed

+199
-17
lines changed

openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
},
3737
{
38-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68936-[OTP][Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand",
38+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68936-[OTP]cluster extension can not be installed with insufficient permission sa for operand",
3939
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68936-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand",
4040
"labels": {
4141
"Extended": {},
@@ -52,7 +52,7 @@
5252
}
5353
},
5454
{
55-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68937-[OTP][Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand rbac object",
55+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68937-[OTP]cluster extension can not be installed with insufficient permission sa for operand rbac object",
5656
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:68937-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand rbac object",
5757
"labels": {
5858
"Extended": {},
@@ -69,7 +69,7 @@
6969
}
7070
},
7171
{
72-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75492-[OTP][Level0][Skipped:Disconnected]cluster extension can not be installed with wrong sa or insufficient permission sa",
72+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75492-[OTP][Level0]cluster extension can not be installed with wrong sa or insufficient permission sa",
7373
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75492-[Skipped:Disconnected]cluster extension can not be installed with wrong sa or insufficient permission sa",
7474
"labels": {
7575
"Extended": {},
@@ -86,7 +86,7 @@
8686
}
8787
},
8888
{
89-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75493-[OTP][Level0][Skipped:Disconnected]cluster extension can be installed with enough permission sa",
89+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75493-[OTP][Level0]cluster extension can be installed with enough permission sa",
9090
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:75493-[Skipped:Disconnected]cluster extension can be installed with enough permission sa",
9191
"labels": {
9292
"Extended": {},
@@ -103,7 +103,7 @@
103103
}
104104
},
105105
{
106-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81538-[OTP][Skipped:Disconnected]preflight check on permission on allns mode",
106+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81538-[OTP]preflight check on permission on allns mode",
107107
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81538-[Skipped:Disconnected]preflight check on permission on allns mode",
108108
"labels": {
109109
"Extended": {},
@@ -120,7 +120,7 @@
120120
}
121121
},
122122
{
123-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81664-[OTP][Skipped:Disconnected]preflight check on permission on own ns mode",
123+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81664-[OTP]preflight check on permission on own ns mode",
124124
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81664-[Skipped:Disconnected]preflight check on permission on own ns mode",
125125
"labels": {
126126
"Extended": {},
@@ -137,7 +137,7 @@
137137
}
138138
},
139139
{
140-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81696-[OTP][Skipped:Disconnected]preflight check on permission on single ns mode",
140+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81696-[OTP]preflight check on permission on single ns mode",
141141
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:81696-[Skipped:Disconnected]preflight check on permission on single ns mode",
142142
"labels": {
143143
"Extended": {},
@@ -154,7 +154,7 @@
154154
}
155155
},
156156
{
157-
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:74618-[OTP][Skipped:Disconnected]ClusterExtension supports simple registry vzero bundles only",
157+
"name": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:74618-[OTP]ClusterExtension supports simple registry vzero bundles only",
158158
"originalName": "[sig-olmv1][Jira:OLM] clusterextension PolarionID:74618-[Skipped:Disconnected]ClusterExtension supports simple registry vzero bundles only",
159159
"labels": {
160160
"Extended": {},

openshift/tests-extension/test/qe/README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,39 @@ All migrated test case code needs the following changes to run in the new test f
227227
- Do NOT add `[OCPFeatureGate:xxxx]` label
228228
20. **Exclusive**: change to `Serial`
229229
230+
## Disconnected Environment Support for Migrated QE cases
231+
232+
**IMPORTANT**: With IDMS/ITMS mirror configuration in place, disconnected environments work exactly like connected environments.
233+
234+
**What this means:**
235+
- Write test cases the same way you would for connected environments
236+
- Create ClusterCatalogs directly - no environment detection needed
237+
- IDMS/ITMS automatically redirects image pulls to mirror registry
238+
- No special helper functions or conditional logic required
239+
240+
**Image Requirements for Migrated QE Cases:**
241+
- All operator images (bundle, base, index) must be hosted under `quay.io/openshifttest` or `quay.io/olmqe`
242+
- This ensures images are mirrored to disconnected environments via IDMS/ITMS configuration
243+
- Images from other registries will not be available in disconnected clusters
244+
245+
**Environment Validation for Disconnected-Supporting Migrated Test Cases:**
246+
247+
If your test case supports disconnected environments, you MUST call `ValidateAccessEnvironment` at the beginning of the test:
248+
249+
```go
250+
g.It("test case supporting disconnected", func() {
251+
olmv1util.ValidateAccessEnvironment(oc)
252+
// rest of test code
253+
})
254+
```
255+
256+
**What ValidateAccessEnvironment does:**
257+
- **Proxy clusters**: Returns immediately (no validation needed, proxy provides external access)
258+
- **Connected clusters**: Returns immediately after quick network check (no validation needed)
259+
- **Disconnected clusters**: Validates that ImageTagMirrorSet `image-policy-aosqe` is configured
260+
- If ITMS is configured: Test proceeds normally
261+
- If ITMS is missing: Test is skipped with clear message explaining what's missing
262+
230263
## Test Automation Code Requirements
231264
232265
Consider these requirements when writing and reviewing code:
@@ -276,6 +309,10 @@ Consider these requirements when writing and reviewing code:
276309
277310
## Local Development Workflow
278311
312+
### Environment Configuration for Migrated QE cases
313+
314+
**IMPORTANT**: With IDMS/ITMS in place, tests work the same in both connected and disconnected environments. No special configuration is needed.
315+
279316
### Before Submitting PR
280317
281318
1. **Build and compile**:
@@ -288,7 +325,7 @@ Consider these requirements when writing and reviewing code:
288325
```bash
289326
# List all test names and search for your test using a keyword
290327
./bin/olmv1-tests-ext list -o names | grep "keyword_from_your_test_name"
291-
328+
292329
# Example: If your test is about "catalog installation", search for:
293330
./bin/olmv1-tests-ext list -o names | grep "catalog"
294331
# This will show the full test name like:

openshift/tests-extension/test/qe/specs/olmv1_ce.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
159159

160160
})
161161

162-
g.It("PolarionID:68936-[OTP][Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:68936-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand"), func() {
162+
g.It("PolarionID:68936-[OTP]cluster extension can not be installed with insufficient permission sa for operand", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:68936-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand"), func() {
163163
e2e.Logf("Testing ClusterExtension installation failure when ServiceAccount lacks sufficient permissions for operand resources. Originally case 75492, using 68936 for faster execution.")
164164
exutil.SkipForSNOCluster(oc)
165+
olmv1util.ValidateAccessEnvironment(oc)
165166
var (
166167
ns = "ns-68936"
167168
sa = "68936"
@@ -227,9 +228,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
227228

228229
})
229230

230-
g.It("PolarionID:68937-[OTP][Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand rbac object", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:68937-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand rbac object"), func() {
231+
g.It("PolarionID:68937-[OTP]cluster extension can not be installed with insufficient permission sa for operand rbac object", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:68937-[Skipped:Disconnected]cluster extension can not be installed with insufficient permission sa for operand rbac object"), func() {
231232
e2e.Logf("Testing ClusterExtension installation failure when ServiceAccount lacks sufficient permissions for operand RBAC objects. Originally case 75492, using 68937 for faster execution.")
232233
exutil.SkipForSNOCluster(oc)
234+
olmv1util.ValidateAccessEnvironment(oc)
233235
var (
234236
ns = "ns-68937"
235237
sa = "68937"
@@ -295,8 +297,9 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
295297

296298
})
297299

298-
g.It("PolarionID:75492-[OTP][Level0][Skipped:Disconnected]cluster extension can not be installed with wrong sa or insufficient permission sa", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:75492-[Skipped:Disconnected]cluster extension can not be installed with wrong sa or insufficient permission sa"), func() {
300+
g.It("PolarionID:75492-[OTP][Level0]cluster extension can not be installed with wrong sa or insufficient permission sa", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:75492-[Skipped:Disconnected]cluster extension can not be installed with wrong sa or insufficient permission sa"), func() {
299301
exutil.SkipForSNOCluster(oc)
302+
olmv1util.ValidateAccessEnvironment(oc)
300303
var (
301304
caseID = "75492"
302305
ns = "ns-" + caseID
@@ -382,8 +385,9 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
382385
ce75492WrongSa.CheckClusterExtensionCondition(oc, "Installed", "message", "not found", 10, 60, 0)
383386
})
384387

385-
g.It("PolarionID:75493-[OTP][Level0][Skipped:Disconnected]cluster extension can be installed with enough permission sa", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:75493-[Skipped:Disconnected]cluster extension can be installed with enough permission sa"), func() {
388+
g.It("PolarionID:75493-[OTP][Level0]cluster extension can be installed with enough permission sa", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:75493-[Skipped:Disconnected]cluster extension can be installed with enough permission sa"), func() {
386389
exutil.SkipForSNOCluster(oc)
390+
olmv1util.ValidateAccessEnvironment(oc)
387391
var (
388392
caseID = "75493"
389393
ns = "ns-" + caseID
@@ -454,11 +458,12 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
454458
o.Expect(olmv1util.Appearance(oc, exutil.Disappear, "services", "nginx-ok-v3283-75493-controller-manager-metrics-service", "-n", ns)).To(o.BeTrue())
455459
})
456460

457-
g.It("PolarionID:81538-[OTP][Skipped:Disconnected]preflight check on permission on allns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81538-[Skipped:Disconnected]preflight check on permission on allns mode"), func() {
461+
g.It("PolarionID:81538-[OTP]preflight check on permission on allns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81538-[Skipped:Disconnected]preflight check on permission on allns mode"), func() {
458462
if !olmv1util.IsFeaturegateEnabled(oc, "NewOLMPreflightPermissionChecks") {
459463
g.Skip("NewOLMPreflightPermissionChecks feature gate is disabled. This test requires preflight permission validation to be enabled.")
460464
}
461465
exutil.SkipForSNOCluster(oc)
466+
olmv1util.ValidateAccessEnvironment(oc)
462467
var (
463468
caseID = "81538"
464469
ns = "ns-" + caseID
@@ -567,12 +572,13 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
567572
ce.CheckClusterExtensionCondition(oc, "Progressing", "reason", "Succeeded", 10, 600, 0)
568573
})
569574

570-
g.It("PolarionID:81664-[OTP][Skipped:Disconnected]preflight check on permission on own ns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81664-[Skipped:Disconnected]preflight check on permission on own ns mode"), func() {
575+
g.It("PolarionID:81664-[OTP]preflight check on permission on own ns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81664-[Skipped:Disconnected]preflight check on permission on own ns mode"), func() {
571576
if !olmv1util.IsFeaturegateEnabled(oc, "NewOLMPreflightPermissionChecks") ||
572577
!olmv1util.IsFeaturegateEnabled(oc, "NewOLMOwnSingleNamespace") {
573578
g.Skip("Required feature gates are disabled: NewOLMPreflightPermissionChecks and NewOLMOwnSingleNamespace must both be enabled for this test.")
574579
}
575580
exutil.SkipForSNOCluster(oc)
581+
olmv1util.ValidateAccessEnvironment(oc)
576582
var (
577583
caseID = "81664"
578584
ns = "ns-" + caseID
@@ -676,12 +682,13 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
676682
ce.Create(oc)
677683
})
678684

679-
g.It("PolarionID:81696-[OTP][Skipped:Disconnected]preflight check on permission on single ns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81696-[Skipped:Disconnected]preflight check on permission on single ns mode"), func() {
685+
g.It("PolarionID:81696-[OTP]preflight check on permission on single ns mode", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:81696-[Skipped:Disconnected]preflight check on permission on single ns mode"), func() {
680686
if !olmv1util.IsFeaturegateEnabled(oc, "NewOLMPreflightPermissionChecks") ||
681687
!olmv1util.IsFeaturegateEnabled(oc, "NewOLMOwnSingleNamespace") {
682688
g.Skip("Required feature gates are disabled: NewOLMPreflightPermissionChecks and NewOLMOwnSingleNamespace must both be enabled for this test.")
683689
}
684690
exutil.SkipForSNOCluster(oc)
691+
olmv1util.ValidateAccessEnvironment(oc)
685692
var (
686693
caseID = "81696"
687694
ns = "ns-" + caseID
@@ -809,8 +816,9 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
809816
ce.Create(oc)
810817
})
811818

812-
g.It("PolarionID:74618-[OTP][Skipped:Disconnected]ClusterExtension supports simple registry vzero bundles only", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:74618-[Skipped:Disconnected]ClusterExtension supports simple registry vzero bundles only"), func() {
819+
g.It("PolarionID:74618-[OTP]ClusterExtension supports simple registry vzero bundles only", g.Label("original-name:[sig-olmv1][Jira:OLM] clusterextension PolarionID:74618-[Skipped:Disconnected]ClusterExtension supports simple registry vzero bundles only"), func() {
813820
exutil.SkipForSNOCluster(oc)
821+
olmv1util.ValidateAccessEnvironment(oc)
814822
var (
815823
ns = "ns-74618"
816824
sa = "sa74618"

0 commit comments

Comments
 (0)