Skip to content

Commit 7d2dd62

Browse files
Merge pull request #1167 from kuiwang02/enhancecase1
NO-ISSUE: re-apply enhance oc case to apply for metal step
2 parents 77763c2 + 0e98a0d commit 7d2dd62

File tree

3 files changed

+35
-19
lines changed

3 files changed

+35
-19
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,28 +155,34 @@
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": {},
158159
"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]": {}
159160
},
160161
"resources": {
161162
"isolation": {}
162163
},
163164
"source": "openshift:payload:olmv0",
164165
"lifecycle": "blocking",
165-
"environmentSelector": {}
166+
"environmentSelector": {
167+
"exclude": "topology==\"External\""
168+
}
166169
},
167170
{
168171
"name": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[OTP][Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself",
169172
"originalName": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself",
170173
"labels": {
171174
"Extended": {},
175+
"NonHyperShiftHOST": {},
172176
"original-name:[sig-operator][Jira:OLM] OLMv0 should PolarionID:33452-[Skipped:Disconnected]oc adm catalog mirror does not mirror the index image itself": {}
173177
},
174178
"resources": {
175179
"isolation": {}
176180
},
177181
"source": "openshift:payload:olmv0",
178182
"lifecycle": "blocking",
179-
"environmentSelector": {}
183+
"environmentSelector": {
184+
"exclude": "topology==\"External\""
185+
}
180186
},
181187
{
182188
"name": "[sig-operator][Jira:OLM] OLMv0 should PolarionID:21825-[OTP][Skipped:Disconnected]Certs for packageserver can be rotated successfully [Serial]",

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
9090
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)
9191
})
9292

93-
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() {
93+
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() {
9494
var (
9595
bundleIndex1 = "quay.io/kuiwang/operators-all:v1"
9696
bundleIndex2 = "quay.io/kuiwang/operators-dockerio:v1"
97-
operatorAllPath = "operators-all-manifests-" + exutil.GetRandomString()
98-
operatorDockerioPath = "operators-dockerio-manifests-" + exutil.GetRandomString()
97+
operatorAllPath = "/tmp/operators-all-manifests-" + exutil.GetRandomString()
98+
operatorDockerioPath = "/tmp/operators-dockerio-manifests-" + exutil.GetRandomString()
9999
)
100-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+operatorAllPath).Output() }()
101-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+operatorDockerioPath).Output() }()
100+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+operatorAllPath).Output() }()
101+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+operatorDockerioPath).Output() }()
102102

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

125125
g.By("check mapping.txt")
126-
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()
126+
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()
127127
o.Expect(err).NotTo(o.HaveOccurred())
128128
o.Expect(result).To(o.ContainSubstring("atlasmap-atlasmap-operator:0.1.0"))
129129
o.Expect(result).To(o.ContainSubstring("redhat-cop-cert-utils-operator:latest"))
130130
o.Expect(result).To(o.ContainSubstring("quay.io/kuiwang/jmckind-argocd-operator"))
131131

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

158158
g.By("check mapping.txt to localhost:5000")
159-
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()
159+
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()
160160
o.Expect(err).NotTo(o.HaveOccurred())
161161
o.Expect(result).To(o.ContainSubstring("localhost:5000/atlasmap/atlasmap-operator:0.1.0"))
162162
o.Expect(result).To(o.ContainSubstring("localhost:5000/strimzi/operator"))
163163

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

172-
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() {
172+
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() {
173173
var (
174174
bundleIndex1 = "quay.io/olmqe/olm-api@sha256:71cfd4deaa493d31cd1d8255b1dce0fb670ae574f4839c778f2cfb1bf1f96995"
175-
manifestPath = "manifests-olm-api-" + exutil.GetRandomString()
175+
manifestPath = "/tmp/manifests-olm-api-" + exutil.GetRandomString()
176176
)
177-
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr ./"+manifestPath).Output() }()
177+
defer func() { _, _ = exec.Command("bash", "-c", "rm -fr "+manifestPath).Output() }()
178178

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

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

189189
g.By("check icsp yaml to localhost:5000")
190-
result, err = exec.Command("bash", "-c", "cat ./"+manifestPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/olmqe/olm-api\"").Output()
190+
result, err = exec.Command("bash", "-c", "cat "+manifestPath+"/imageContentSourcePolicy.yaml | grep -E \"quay.io/olmqe/olm-api\"").Output()
191191
o.Expect(err).NotTo(o.HaveOccurred())
192192
o.Expect(result).To(o.ContainSubstring("quay.io/olmqe/olm-api"))
193193
})

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,14 +1104,24 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
11041104

11051105
g.By("Get SA of csv")
11061106
olmv0util.GetResource(oc, exutil.AsUser, exutil.WithNamespace, "csv", sub.InstalledCSV, "-o=json")
1107-
sa := olmv0util.NewSa(strings.Fields(olmv0util.GetResource(oc, exutil.AsUser, exutil.WithNamespace, "csv", sub.InstalledCSV, "-o=jsonpath={.status.requirementStatus[?(@.kind==\"ServiceAccount\")].name}"))[0], sub.Namespace)
1107+
saNames := strings.Fields(olmv0util.GetResource(oc, exutil.AsUser, exutil.WithNamespace, "csv", sub.InstalledCSV, "-o=jsonpath={.status.requirementStatus[?(@.kind==\"ServiceAccount\")].name}"))
1108+
if len(saNames) == 0 {
1109+
g.Skip("skip it because of no sa")
1110+
}
1111+
sa := olmv0util.NewSa(saNames[0], sub.Namespace)
11081112

11091113
g.By("Delete sa of csv")
11101114
sa.GetDefinition(oc)
11111115
sa.Delete(oc)
1116+
1117+
g.By("Trigger OLM reconciliation by annotating CSV")
1118+
_, err := oc.AsAdmin().WithoutNamespace().Run("annotate").Args("csv", sub.InstalledCSV, "-n", sub.Namespace, "test-trigger="+fmt.Sprintf("%d", time.Now().Unix()), "--overwrite").Output()
1119+
if err != nil {
1120+
g.Skip("skip it because of no terst-trigger")
1121+
}
1122+
11121123
var output string
1113-
var err error
1114-
errCsv := wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, 300*time.Second, false, func(ctx context.Context) (bool, error) {
1124+
errCsv := wait.PollUntilContextTimeout(context.TODO(), 10*time.Second, 600*time.Second, false, func(ctx context.Context) (bool, error) {
11151125
output, err = oc.WithoutNamespace().Run("get").Args("csv", sub.InstalledCSV, "-n", sub.Namespace, "-o=jsonpath={.status.reason}").Output()
11161126
if err != nil {
11171127
return false, err

0 commit comments

Comments
 (0)