Skip to content

Commit 2cb0ba7

Browse files
Xia-Zhao-rhci-robot
authored andcommitted
UPSTREAM: <carry>: enhance ocp-79770
1 parent 6eca1ee commit 2cb0ba7

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] cluster-olm-operator", g.Label("NonHyp
139139

140140
g.By("2) check metrics are collected")
141141
queryUrl := "http://localhost:9090/api/v1/query"
142-
query1 := `query=catalogd_http_request_duration_seconds_count{code="200"}`
142+
query1 := `query=rest_client_requests_total{namespace="openshift-catalogd"}`
143143
queryResult1, _ := oc.AsAdmin().WithoutNamespace().Run("exec").Args("-n", "openshift-monitoring", k8sPodname, "--", "curl", "-G", "--data-urlencode", query1, queryUrl).Output()
144-
e2e.Logf("query result 1: %s", queryResult1)
144+
e2e.Logf("catalogd rest_client_requests_total query result: %s", queryResult1)
145145
o.Expect(queryResult1).To(o.ContainSubstring("value"))
146146

147-
query2 := `query=controller_runtime_reconcile_total{controller="controller-operator-cluster-extension-controller",result="success"}`
147+
query2 := `query=rest_client_requests_total{namespace="openshift-operator-controller"}`
148148
queryResult2, _ := oc.AsAdmin().WithoutNamespace().Run("exec").Args("-n", "openshift-monitoring", k8sPodname, "--", "curl", "-G", "--data-urlencode", query2, queryUrl).Output()
149-
e2e.Logf("query result 2: %s", queryResult2)
149+
e2e.Logf("operator-controller rest_client_requests_total query result: %s", queryResult2)
150150
o.Expect(queryResult2).To(o.ContainSubstring("value"))
151151

152152
g.By("3) test SUCCESS")

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

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,8 +2398,16 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
23982398
clusterextension.Create(oc)
23992399
o.Expect(clusterextension.InstalledBundle).To(o.ContainSubstring("v0.0.1"))
24002400
status, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2401+
if !strings.Contains(status, "True") {
2402+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2403+
e2e.Logf("Expected status to be True, but got: %s. Full status: %s", status, fullStatus)
2404+
}
24012405
o.Expect(status).To(o.ContainSubstring("True"))
24022406
message, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].message}`)
2407+
if !strings.Contains(message, "All is well") {
2408+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2409+
e2e.Logf("Expected message to contain 'All is well', but got: %s. Full status: %s", message, fullStatus)
2410+
}
24032411
o.Expect(message).To(o.ContainSubstring("All is well"))
24042412

24052413
g.By("3) upgrade clusterextension to 1.1.0, olm.maxOpenShiftVersion is 4.19")
@@ -2413,9 +2421,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
24132421
return false, nil
24142422
})
24152423
status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2424+
if !strings.Contains(status, "False") {
2425+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2426+
e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus)
2427+
}
24162428
o.Expect(status).To(o.ContainSubstring("False"))
24172429
if errWait != nil {
2418-
_, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}")
2430+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2431+
e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus)
24192432
}
24202433
exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct")
24212434

@@ -2430,9 +2443,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
24302443
return false, nil
24312444
})
24322445
status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2446+
if !strings.Contains(status, "False") {
2447+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2448+
e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus)
2449+
}
24332450
o.Expect(status).To(o.ContainSubstring("False"))
24342451
if errWait != nil {
2435-
_, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}")
2452+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2453+
e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus)
24362454
}
24372455
exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct")
24382456
})
@@ -2490,8 +2508,16 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
24902508
clusterextension.Create(oc)
24912509
o.Expect(clusterextension.InstalledBundle).To(o.ContainSubstring("v0.0.1"))
24922510
status, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2511+
if !strings.Contains(status, "True") {
2512+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2513+
e2e.Logf("Expected status to be True, but got: %s. Full status: %s", status, fullStatus)
2514+
}
24932515
o.Expect(status).To(o.ContainSubstring("True"))
24942516
message, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].message}`)
2517+
if !strings.Contains(message, "All is well") {
2518+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2519+
e2e.Logf("Expected message to contain 'All is well', but got: %s. Full status: %s", message, fullStatus)
2520+
}
24952521
o.Expect(message).To(o.ContainSubstring("All is well"))
24962522

24972523
g.By("3) upgrade clusterextension to 1.2.0, olm.maxOpenShiftVersion is 4.20")
@@ -2505,9 +2531,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
25052531
return false, nil
25062532
})
25072533
status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2534+
if !strings.Contains(status, "False") {
2535+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2536+
e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus)
2537+
}
25082538
o.Expect(status).To(o.ContainSubstring("False"))
25092539
if errWait != nil {
2510-
_, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}")
2540+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2541+
e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus)
25112542
}
25122543
exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct")
25132544

@@ -2522,9 +2553,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
25222553
return false, nil
25232554
})
25242555
status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`)
2556+
if !strings.Contains(status, "False") {
2557+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2558+
e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus)
2559+
}
25252560
o.Expect(status).To(o.ContainSubstring("False"))
25262561
if errWait != nil {
2527-
_, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}")
2562+
fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}")
2563+
e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus)
25282564
}
25292565
exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct")
25302566

0 commit comments

Comments
 (0)