diff --git a/openshift/tests-extension/test/qe/specs/olmv1.go b/openshift/tests-extension/test/qe/specs/olmv1.go index 0b2c7e47e..7f310e9b0 100644 --- a/openshift/tests-extension/test/qe/specs/olmv1.go +++ b/openshift/tests-extension/test/qe/specs/olmv1.go @@ -139,14 +139,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] cluster-olm-operator", g.Label("NonHyp g.By("2) check metrics are collected") queryUrl := "http://localhost:9090/api/v1/query" - query1 := `query=catalogd_http_request_duration_seconds_count{code="200"}` + query1 := `query=rest_client_requests_total{namespace="openshift-catalogd"}` queryResult1, _ := oc.AsAdmin().WithoutNamespace().Run("exec").Args("-n", "openshift-monitoring", k8sPodname, "--", "curl", "-G", "--data-urlencode", query1, queryUrl).Output() - e2e.Logf("query result 1: %s", queryResult1) + e2e.Logf("catalogd rest_client_requests_total query result: %s", queryResult1) o.Expect(queryResult1).To(o.ContainSubstring("value")) - query2 := `query=controller_runtime_reconcile_total{controller="controller-operator-cluster-extension-controller",result="success"}` + query2 := `query=rest_client_requests_total{namespace="openshift-operator-controller"}` queryResult2, _ := oc.AsAdmin().WithoutNamespace().Run("exec").Args("-n", "openshift-monitoring", k8sPodname, "--", "curl", "-G", "--data-urlencode", query2, queryUrl).Output() - e2e.Logf("query result 2: %s", queryResult2) + e2e.Logf("operator-controller rest_client_requests_total query result: %s", queryResult2) o.Expect(queryResult2).To(o.ContainSubstring("value")) g.By("3) test SUCCESS") diff --git a/openshift/tests-extension/test/qe/specs/olmv1_ce.go b/openshift/tests-extension/test/qe/specs/olmv1_ce.go index c80ff2da1..4b7eed41d 100644 --- a/openshift/tests-extension/test/qe/specs/olmv1_ce.go +++ b/openshift/tests-extension/test/qe/specs/olmv1_ce.go @@ -2398,8 +2398,16 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh clusterextension.Create(oc) o.Expect(clusterextension.InstalledBundle).To(o.ContainSubstring("v0.0.1")) status, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "True") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be True, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("True")) message, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].message}`) + if !strings.Contains(message, "All is well") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected message to contain 'All is well', but got: %s. Full status: %s", message, fullStatus) + } o.Expect(message).To(o.ContainSubstring("All is well")) 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 return false, nil }) status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "False") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("False")) if errWait != nil { - _, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}") + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus) } exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct") @@ -2430,9 +2443,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh return false, nil }) status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "False") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("False")) if errWait != nil { - _, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}") + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus) } exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct") }) @@ -2490,8 +2508,16 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh clusterextension.Create(oc) o.Expect(clusterextension.InstalledBundle).To(o.ContainSubstring("v0.0.1")) status, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "True") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be True, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("True")) message, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].message}`) + if !strings.Contains(message, "All is well") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected message to contain 'All is well', but got: %s. Full status: %s", message, fullStatus) + } o.Expect(message).To(o.ContainSubstring("All is well")) 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 return false, nil }) status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "False") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("False")) if errWait != nil { - _, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}") + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus) } exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct") @@ -2522,9 +2553,14 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh return false, nil }) status, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o", `jsonpath={.status.conditions[?(@.type=="Upgradeable")].status}`) + if !strings.Contains(status, "False") { + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Expected status to be False, but got: %s. Full status: %s", status, fullStatus) + } o.Expect(status).To(o.ContainSubstring("False")) if errWait != nil { - _, _ = olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status.conditions}") + fullStatus, _ := olmv1util.GetNoEmpty(oc, "co", "olm", "-o=jsonpath-as-json={.status}") + e2e.Logf("Upgradeable message is not correct. Full status: %s", fullStatus) } exutil.AssertWaitPollNoErr(errWait, "Upgradeable message is not correct")