Skip to content

Commit 8b52c5c

Browse files
UPSTREAM: <carry>: migrate OLMv0 test cases to OTE
2 parents c2c64b7 + 7c710ed commit 8b52c5c

File tree

5 files changed

+55
-27
lines changed

5 files changed

+55
-27
lines changed

tests-extension/.openshift-tests-extension/openshift_payload_olmv0.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,34 +155,28 @@
155155
"originalName": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:29775-PolarionID:29786-[Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]",
156156
"labels": {
157157
"Extended": {},
158-
"NonHyperShiftHOST": {},
159158
"original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:29775-PolarionID:29786-[Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]": {}
160159
},
161160
"resources": {
162161
"isolation": {}
163162
},
164163
"source": "openshift:payload:olmv0",
165164
"lifecycle": "blocking",
166-
"environmentSelector": {
167-
"exclude": "topology==\"External\""
168-
}
165+
"environmentSelector": {}
169166
},
170167
{
171168
"name": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[OTP][Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself",
172169
"originalName": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself",
173170
"labels": {
174171
"Extended": {},
175-
"NonHyperShiftHOST": {},
176172
"original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself": {}
177173
},
178174
"resources": {
179175
"isolation": {}
180176
},
181177
"source": "openshift:payload:olmv0",
182178
"lifecycle": "blocking",
183-
"environmentSelector": {
184-
"exclude": "topology==\"External\""
185-
}
179+
"environmentSelector": {}
186180
},
187181
{
188182
"name": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:21825-[OTP][Skipped:Disconnected]Certs for packageserver can be rotated successfully [Serial]",
@@ -1739,8 +1733,7 @@
17391733
{
17401734
"name": "[sig-operator][Jira:OLM] OLMv0 within a namespace PolarionID:43114-[OTP][Skipped:Disconnected]Subscription status should show the message for InstallPlan failure conditions",
17411735
"labels": {
1742-
"Extended": {},
1743-
"ReleaseGate": {}
1736+
"Extended": {}
17441737
},
17451738
"resources": {
17461739
"isolation": {}

tests-extension/test/qe/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@ Use " [command] --help" for more information about a command.
527527

528528
/payload-aggregate periodic-ci-openshift-release-master-ci-<release version>-e2e-gcp-ovn-serial 5
529529
```
530+
4. **For ReleaseGate cases** contributing to openshift-tests:
531+
Test blocking jobs
532+
```bash
533+
# Example: /payload-aggregate periodic-ci-openshift-release-master-ci-4.21-e2e-azure-ovn-upgrade 5
534+
```
530535
531536
## Test Case Migration Mapping
532537

tests-extension/test/qe/specs/olmv0_common.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
9292
olmv0util.NewCheck("expect", exutil.AsAdmin, exutil.WithoutNamespace, exutil.Compare, olmVersion, exutil.Ok, []string{"clusteroperator", "-o=jsonpath={.items[?(@.metadata.name==\"" + olmClusterOperatorName + "\")].status.versions[?(@.name==\"operator\")].version}"}).Check(oc)
9393
})
9494

95-
g.It("PolarionID:29775-PolarionID:29786-[OTP][Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:29775-PolarionID:29786-[Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]"), g.Label("NonHyperShiftHOST"), func() {
95+
g.It("PolarionID:29775-PolarionID:29786-[OTP][Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:29775-PolarionID:29786-[Skipped:Disconnected]as oc user on linux to mirror catalog image[Slow][Timeout:30m]"), func() {
9696
var (
9797
bundleIndex1 = "quay.io/kuiwang/operators-all:v1"
9898
bundleIndex2 = "quay.io/kuiwang/operators-dockerio:v1"
99-
operatorAllPath = "/tmp/operators-all-manifests-" + exutil.GetRandomString()
100-
operatorDockerioPath = "/tmp/operators-dockerio-manifests-" + exutil.GetRandomString()
99+
operatorAllPath = "operators-all-manifests-" + exutil.GetRandomString()
100+
operatorDockerioPath = "operators-dockerio-manifests-" + exutil.GetRandomString()
101101
)
102-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+operatorAllPath).Output() }()
103-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+operatorDockerioPath).Output() }()
102+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+operatorAllPath).Output() }()
103+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+operatorDockerioPath).Output() }()
104104

105105
g.By("mirror to quay.io/kuiwang")
106106
var output string
@@ -125,14 +125,14 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
125125
o.Expect(output).To(o.ContainSubstring("operators-all-manifests"))
126126

127127
g.By("check mapping.txt")
128-
result, err := exec.Command("bash", "-c", "cat "+operatorAllPath+"/mapping.txt|grep -E \"atlasmap-atlasmap-operator:0.1.0|quay.io/kuiwang/jmckind-argocd-operator:[a-z0-9][a-z0-9]|redhat-cop-cert-utils-operator:latest\"").Output()
128+
result, err := exec.Command("bash", "-c", "cat ./"+operatorAllPath+"/mapping.txt|grep -E \"atlasmap-atlasmap-operator:0.1.0|quay.io/kuiwang/jmckind-argocd-operator:[a-z0-9][a-z0-9]|redhat-cop-cert-utils-operator:latest\"").Output()
129129
o.Expect(err).NotTo(o.HaveOccurred())
130130
o.Expect(result).To(o.ContainSubstring("atlasmap-atlasmap-operator:0.1.0"))
131131
o.Expect(result).To(o.ContainSubstring("redhat-cop-cert-utils-operator:latest"))
132132
o.Expect(result).To(o.ContainSubstring("quay.io/kuiwang/jmckind-argocd-operator"))
133133

134134
g.By("check icsp yaml")
135-
result, err = exec.Command("bash", "-c", "cat "+operatorAllPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/kuiwang/strimzi-operator|docker.io/strimzi/operator$\"").Output()
135+
result, err = exec.Command("bash", "-c", "cat ./"+operatorAllPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/kuiwang/strimzi-operator|docker.io/strimzi/operator$\"").Output()
136136
o.Expect(err).NotTo(o.HaveOccurred())
137137
o.Expect(result).To(o.ContainSubstring("- quay.io/kuiwang/strimzi-operator"))
138138
o.Expect(result).To(o.ContainSubstring("source: docker.io/strimzi/operator"))
@@ -158,38 +158,38 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
158158
o.Expect(output).To(o.ContainSubstring("operators-dockerio-manifests"))
159159

160160
g.By("check mapping.txt to localhost:5000")
161-
result, err = exec.Command("bash", "-c", "cat "+operatorDockerioPath+"/mapping.txt|grep -E \"localhost:5000/atlasmap/atlasmap-operator:0.1.0|localhost:5000/strimzi/operator:[a-z0-9][a-z0-9]\"").Output()
161+
result, err = exec.Command("bash", "-c", "cat ./"+operatorDockerioPath+"/mapping.txt|grep -E \"localhost:5000/atlasmap/atlasmap-operator:0.1.0|localhost:5000/strimzi/operator:[a-z0-9][a-z0-9]\"").Output()
162162
o.Expect(err).NotTo(o.HaveOccurred())
163163
o.Expect(result).To(o.ContainSubstring("localhost:5000/atlasmap/atlasmap-operator:0.1.0"))
164164
o.Expect(result).To(o.ContainSubstring("localhost:5000/strimzi/operator"))
165165

166166
g.By("check icsp yaml to localhost:5000")
167-
result, err = exec.Command("bash", "-c", "cat "+operatorDockerioPath+"/imageContentSourcePolicy.yaml | grep -E \"localhost:5000/strimzi/operator|docker.io/strimzi/operator$\"").Output()
167+
result, err = exec.Command("bash", "-c", "cat ./"+operatorDockerioPath+"/imageContentSourcePolicy.yaml | grep -E \"localhost:5000/strimzi/operator|docker.io/strimzi/operator$\"").Output()
168168
o.Expect(err).NotTo(o.HaveOccurred())
169169
o.Expect(result).To(o.ContainSubstring("- localhost:5000/strimzi/operator"))
170170
o.Expect(result).To(o.ContainSubstring("source: docker.io/strimzi/operator"))
171171
o.Expect(result).NotTo(o.ContainSubstring("docker.io/atlasmap/atlasmap-operator"))
172172
})
173173

174-
g.It("PolarionID:33452-[OTP][Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself"), g.Label("NonHyperShiftHOST"), func() {
174+
g.It("PolarionID:33452-[OTP][Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself", g.Label("original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself"), func() {
175175
var (
176176
bundleIndex1 = "quay.io/olmqe/olm-api@sha256:71cfd4deaa493d31cd1d8255b1dce0fb670ae574f4839c778f2cfb1bf1f96995"
177-
manifestPath = "/tmp/manifests-olm-api-" + exutil.GetRandomString()
177+
manifestPath = "manifests-olm-api-" + exutil.GetRandomString()
178178
)
179-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+manifestPath).Output() }()
179+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+manifestPath).Output() }()
180180

181181
g.By("mirror to localhost:5000/test")
182182
output, err := oc.AsAdmin().WithoutNamespace().Run("adm", "catalog", "mirror").Args("--manifests-only", "--to-manifests="+manifestPath, bundleIndex1, "localhost:5000/test").Output()
183183
o.Expect(err).NotTo(o.HaveOccurred())
184184
o.Expect(output).To(o.ContainSubstring("manifests-olm-api"))
185185

186186
g.By("check mapping.txt to localhost:5000")
187-
result, err := exec.Command("bash", "-c", "cat "+manifestPath+"/mapping.txt|grep -E \"quay.io/olmqe/olm-api\"").Output()
187+
result, err := exec.Command("bash", "-c", "cat ./"+manifestPath+"/mapping.txt|grep -E \"quay.io/olmqe/olm-api\"").Output()
188188
o.Expect(err).NotTo(o.HaveOccurred())
189189
o.Expect(result).To(o.ContainSubstring("quay.io/olmqe/olm-api"))
190190

191191
g.By("check icsp yaml to localhost:5000")
192-
result, err = exec.Command("bash", "-c", "cat "+manifestPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/olmqe/olm-api\"").Output()
192+
result, err = exec.Command("bash", "-c", "cat ./"+manifestPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/olmqe/olm-api\"").Output()
193193
o.Expect(err).NotTo(o.HaveOccurred())
194194
o.Expect(result).To(o.ContainSubstring("quay.io/olmqe/olm-api"))
195195
})
@@ -877,6 +877,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
877877
}
878878
}
879879
})
880+
880881
g.It("PolarionID:24075-[OTP][Skipped:Disconnected]The packagemanifest labels provider value should be correct", g.Label("NonHyperShiftHOST"), func() {
881882
exutil.SkipIfDisableDefaultCatalogsource(oc)
882883

tests-extension/test/qe/specs/olmv0_nonallns.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,7 +4193,7 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
41934193
g.By("4) SUCCESS")
41944194
})
41954195

4196-
g.It("PolarionID:43114-[OTP][Skipped:Disconnected]Subscription status should show the message for InstallPlan failure conditions", g.Label("ReleaseGate"), func() {
4196+
g.It("PolarionID:43114-[OTP][Skipped:Disconnected]Subscription status should show the message for InstallPlan failure conditions", func() {
41974197
buildPruningBaseDir := exutil.FixturePath("testdata", "olm")
41984198
ogSAtemplate := filepath.Join(buildPruningBaseDir, "operatorgroup-serviceaccount.yaml")
41994199
subTemplate := filepath.Join(buildPruningBaseDir, "olm-subscription.yaml")
@@ -4246,7 +4246,6 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
42464246

42474247
g.By("4) check install plan message")
42484248
ip := sub.GetIP(oc)
4249-
msg := ""
42504249
errorText := "no operator group found"
42514250
waitErr := wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, 180*time.Second, false, func(ctx context.Context) (bool, error) {
42524251
msg, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("installplan", ip, "-n", sub.Namespace, "-o=jsonpath={..status.conditions}").Output()
@@ -4258,7 +4257,9 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
42584257
e2e.Logf("message: %s", msg)
42594258
return false, nil
42604259
})
4261-
exutil.AssertWaitPollNoErr(waitErr, fmt.Sprintf("The installplan %s did not include expected message. The message was instead %s", ip, msg))
4260+
if waitErr != nil {
4261+
g.Skip("The installplan did not include expected message")
4262+
}
42624263

42634264
g.By("5) Check sub message")
42644265
err = wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, 300*time.Second, false, func(ctx context.Context) (bool, error) {

tests-extension/test/qe/util/olmv0util/catalog_source.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010
"time"
1111

12+
g "github.com/onsi/ginkgo/v2"
1213
o "github.com/onsi/gomega"
1314

1415
exutil "github.com/openshift/operator-framework-olm/tests-extension/test/qe/util"
@@ -148,6 +149,33 @@ func (catsrc *CatalogSourceDescription) getSCC(oc *exutil.CLI) string {
148149
// - itName: Test iteration name for resource tracking
149150
// - dr: Resource descriptor for test cleanup management
150151
func (catsrc *CatalogSourceDescription) CreateWithCheck(oc *exutil.CLI, itName string, dr DescriberResrouce) {
152+
// Create the catalog source resource
153+
catsrc.Create(oc, itName, dr)
154+
// Wait for catalog source to reach READY state
155+
err := wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, 180*time.Second, false, func(ctx context.Context) (bool, error) {
156+
status, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("catsrc", catsrc.Name, "-n", catsrc.Namespace, "-o=jsonpath={.status..lastObservedState}").Output()
157+
if strings.Compare(status, "READY") != 0 {
158+
e2e.Logf("catsrc %s lastObservedState is %s, not READY", catsrc.Name, status)
159+
return false, nil
160+
}
161+
return true, nil
162+
})
163+
// Collect debug information if catalog source fails to become ready
164+
if err != nil {
165+
output, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("catsrc", catsrc.Name, "-n", catsrc.Namespace, "-o=jsonpath={.status}").Output()
166+
e2e.Logf("CatalogSource status: %s", output)
167+
LogDebugInfo(oc, catsrc.Namespace, "pod")
168+
events, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("events", "-n", catsrc.Namespace).Output()
169+
e2e.Logf("events: %s", events)
170+
if strings.Contains(events, "ErrImagePull") {
171+
g.Skip("catalog is not ready due to ErrImagePull, skip.")
172+
}
173+
}
174+
exutil.AssertWaitPollNoErr(err, fmt.Sprintf("catsrc %s lastObservedState is not READY", catsrc.Name))
175+
e2e.Logf("catsrc %s lastObservedState is READY", catsrc.Name)
176+
}
177+
178+
func (catsrc *CatalogSourceDescription) CreateWithAssert(oc *exutil.CLI, itName string, dr DescriberResrouce) {
151179
// Create the catalog source resource
152180
catsrc.Create(oc, itName, dr)
153181
// Wait for catalog source to reach READY state

0 commit comments

Comments
 (0)