Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 45 additions & 27 deletions openshift/tests-extension/test/qe/specs/olmv1_cc.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,11 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif

g.It("PolarionID:73289-[OTP][Skipped:Disconnected]Check the deprecation conditions and messages", func() {
var (
caseID = "73289"
labelValue = caseID
baseDir = exutil.FixturePath("testdata", "olm")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension.yaml")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog-withlabel.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension-withselectorlabel.yaml")
saClusterRoleBindingTemplate = filepath.Join(baseDir, "sa-admin.yaml")
ns = "ns-73289"
sa = "sa73289"
Expand All @@ -659,9 +661,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Template: saClusterRoleBindingTemplate,
}
clustercatalog = olmv1util.ClusterCatalogDescription{
Name: "clustercatalog-73289",
Imageref: "quay.io/olmqe/olmtest-operator-index:nginxolm73289",
Template: clustercatalogTemplate,
Name: "clustercatalog-73289",
Imageref: "quay.io/olmqe/olmtest-operator-index:nginxolm73289",
LabelValue: labelValue,
Template: clustercatalogTemplate,
}
clusterextension = olmv1util.ClusterExtensionDescription{
Name: "clusterextension-73289",
Expand All @@ -670,6 +673,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Channel: "candidate-v1.0",
Version: "1.0.1",
SaName: sa,
LabelValue: labelValue,
Template: clusterextensionTemplate,
}
)
Expand Down Expand Up @@ -783,9 +787,11 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif

g.It("PolarionID:74948-[OTP][Skipped:Disconnected]catalog offer the operator content through https server", func() {
var (
caseID = "74948"
labelValue = caseID
baseDir = exutil.FixturePath("testdata", "olm")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension.yaml")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog-withlabel.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension-withselectorlabel.yaml")
saClusterRoleBindingTemplate = filepath.Join(baseDir, "sa-admin.yaml")
ns = "ns-74948"
sa = "sa74948"
Expand All @@ -795,9 +801,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Template: saClusterRoleBindingTemplate,
}
clustercatalog = olmv1util.ClusterCatalogDescription{
Name: "clustercatalog-74948",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm74948",
Template: clustercatalogTemplate,
Name: "clustercatalog-74948",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm74948",
LabelValue: labelValue,
Template: clustercatalogTemplate,
}
clusterextension = olmv1util.ClusterExtensionDescription{
Name: "clusterextension-74948",
Expand All @@ -806,6 +813,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Channel: "candidate-v1.0",
Version: "1.0.3",
SaName: sa,
LabelValue: labelValue,
Template: clusterextensionTemplate,
}
)
Expand Down Expand Up @@ -858,9 +866,11 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif

g.It("PolarionID:74978-[OTP][Level0][Skipped:Disconnected]CRD upgrade will be prevented if the Scope is switched between Namespaced and Cluster", func() {
var (
caseID = "74978"
labelValue = caseID
baseDir = exutil.FixturePath("testdata", "olm")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension.yaml")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog-withlabel.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension-withselectorlabel.yaml")
saClusterRoleBindingTemplate = filepath.Join(baseDir, "sa-admin.yaml")
ns = "ns-74978"
sa = "sa74978"
Expand All @@ -870,9 +880,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Template: saClusterRoleBindingTemplate,
}
clustercatalog = olmv1util.ClusterCatalogDescription{
Name: "clustercatalog-74978",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm74978",
Template: clustercatalogTemplate,
Name: "clustercatalog-74978",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm74978",
LabelValue: labelValue,
Template: clustercatalogTemplate,
}
clusterextension = olmv1util.ClusterExtensionDescription{
Name: "clusterextension-74978",
Expand All @@ -881,6 +892,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Channel: "candidate-v1.0",
Version: "1.0.1",
SaName: sa,
LabelValue: labelValue,
Template: clusterextensionTemplate,
}
)
Expand Down Expand Up @@ -929,9 +941,11 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif

g.It("PolarionID:75218-[OTP][Skipped:Disconnected]Disabling the CRD Upgrade Safety preflight checks", func() {
var (
caseID = "75218"
labelValue = caseID
baseDir = exutil.FixturePath("testdata", "olm")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension.yaml")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog-withlabel.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension-withselectorlabel.yaml")
saClusterRoleBindingTemplate = filepath.Join(baseDir, "sa-admin.yaml")
ns = "ns-75218"
sa = "sa75218"
Expand All @@ -941,9 +955,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Template: saClusterRoleBindingTemplate,
}
clustercatalog = olmv1util.ClusterCatalogDescription{
Name: "clustercatalog-75218",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm75218",
Template: clustercatalogTemplate,
Name: "clustercatalog-75218",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm75218",
LabelValue: labelValue,
Template: clustercatalogTemplate,
}
clusterextension = olmv1util.ClusterExtensionDescription{
Name: "clusterextension-75218",
Expand All @@ -952,6 +967,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
Channel: "candidate-v1.0",
Version: "1.0.1",
SaName: sa,
LabelValue: labelValue,
Template: clusterextensionTemplate,
}
)
Expand Down Expand Up @@ -1091,13 +1107,15 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clustercatalog", g.Label("NonHyperShif
g.By("upgrade will be allowed if A new version of the CRD is added with no modifications to existing versions")
err = oc.AsAdmin().Run("patch").Args("clusterextension", clusterextension.Name, "-p", `{"spec":{"source":{"catalog":{"version":"1.0.3","upgradeConstraintPolicy":"SelfCertified"}}}}`, "--type=merge").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
clusterextension.CheckClusterExtensionCondition(oc, "Progressing", "reason", "Succeeded", 3, 150, 0)
clusterextension.WaitClusterExtensionCondition(oc, "Installed", "True", 0)
clusterextension.GetBundleResource(oc)
o.Expect(clusterextension.InstalledBundle).To(o.ContainSubstring("v1.0.3"))

clusterextension.CheckClusterExtensionCondition(oc, "Installed", "message",
"Installed bundle quay.io/openshifttest/nginxolm-operator-bundle:v1.0.3-nginxolm75122 successfully", 10, 60, 0)
errWait := wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 150*time.Second, false, func(ctx context.Context) (bool, error) {
clusterextension.GetBundleResource(oc)
if strings.Contains(clusterextension.InstalledBundle, "1.0.3") {
e2e.Logf("InstalledBundle is %s", clusterextension.InstalledBundle)
return true, nil
}
return false, nil
})
exutil.AssertWaitPollNoErr(errWait, "nginx75122 1.0.3 is not installed")

g.By("upgrade will be prevented if An existing served version of the CRD is removed")
err = oc.AsAdmin().Run("patch").Args("clusterextension", clusterextension.Name, "-p", `{"spec":{"source":{"catalog":{"version":"1.0.6","upgradeConstraintPolicy":"SelfCertified"}}}}`, "--type=merge").Execute()
Expand Down
56 changes: 28 additions & 28 deletions openshift/tests-extension/test/qe/specs/olmv1_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,21 +343,24 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
g.It("PolarionID:70723-[OTP][Skipped:Disconnected]olmv1 downgrade version", func() {
olmv1util.ValidateAccessEnvironment(oc)
var (
caseID = "70723"
labelValue = caseID
ns = "ns-70723"
sa = "sa70723"
baseDir = exutil.FixturePath("testdata", "olm")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension.yaml")
clustercatalogTemplate = filepath.Join(baseDir, "clustercatalog-withlabel.yaml")
clusterextensionTemplate = filepath.Join(baseDir, "clusterextension-withselectorlabel.yaml")
saClusterRoleBindingTemplate = filepath.Join(baseDir, "sa-admin.yaml")
saCrb = olmv1util.SaCLusterRolebindingDescription{
Name: sa,
Namespace: ns,
Template: saClusterRoleBindingTemplate,
}
clustercatalog = olmv1util.ClusterCatalogDescription{
Name: "clustercatalog-70723",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm70723",
Template: clustercatalogTemplate,
Name: "clustercatalog-70723",
Imageref: "quay.io/openshifttest/nginxolm-operator-index:nginxolm70723",
LabelValue: labelValue,
Template: clustercatalogTemplate,
}
clusterextension = olmv1util.ClusterExtensionDescription{
Name: "clusterextension-70723",
Expand All @@ -366,6 +369,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
Channel: "candidate-v2",
Version: "2.2.1",
SaName: sa,
LabelValue: labelValue,
Template: clusterextensionTemplate,
}
)
Expand Down Expand Up @@ -1860,9 +1864,6 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
_, _ = olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension.Name, "-o=jsonpath-as-json={.status}")
exutil.AssertWaitPollNoErr(errWait, "clusterextension resolvedBundle is not v1.0.2")
}
conditions, _ := olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension.Name, "-o", "jsonpath={.status.conditions}")
o.Expect(strings.ToLower(conditions)).To(o.ContainSubstring("desired state reached"))
o.Expect(conditions).NotTo(o.ContainSubstring("error"))

g.By("update channel to be candidate-v1.1")
clusterextension.Patch(oc, `{"spec":{"source":{"catalog":{"channels": ["candidate-v1.1"]}}}}`)
Expand Down Expand Up @@ -2238,13 +2239,15 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
_ = clusterextension2.CreateWithoutCheck(oc)
errWait := wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 150*time.Second, false, func(ctx context.Context) (bool, error) {
message, _ := olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension2.Name, "-o", "jsonpath={.status.conditions[*].message}")
if !strings.Contains(message, "already exists in namespace") {
if strings.Contains(message, "already exists") || strings.Contains(message, "Conflicting") {
e2e.Logf("status is %s", message)
return false, nil
return true, nil
}
return true, nil
e2e.Logf("status is %s", message)
return false, nil
})
exutil.AssertWaitPollNoErr(errWait, "clusterextension2 should not be installed")

clusterextension2.Delete(oc)
clusterextension1.Delete(oc)
errWait = wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 30*time.Second, false, func(ctx context.Context) (bool, error) {
Expand Down Expand Up @@ -2274,15 +2277,8 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
exutil.AssertWaitPollNoErr(errWait, "crd nginxolm74923s.cache.example.com is not deleted")

_ = clusterextension1.CreateWithoutCheck(oc)
errWait = wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 150*time.Second, false, func(ctx context.Context) (bool, error) {
message, _ := olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension1.Name, "-o", "jsonpath={.status.conditions[*].message}")
if !strings.Contains(message, "already exists in namespace") {
e2e.Logf("status is %s", message)
return false, nil
}
return true, nil
})
exutil.AssertWaitPollNoErr(errWait, "clusterextension1 should not be installed")
clusterextension1.CheckClusterExtensionCondition(oc, "Installed", "reason", "Failed", 3, 150, 0)
clusterextension1.WaitClusterExtensionCondition(oc, "Installed", "False", 0)

})

Expand Down Expand Up @@ -2835,11 +2831,11 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
_ = clusterextension.CreateWithoutCheck(oc)
errWait := wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 150*time.Second, false, func(ctx context.Context) (bool, error) {
message, _ := olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension.Name, "-o", "jsonpath={.status.conditions[*].message}")
if !strings.Contains(message, "failed to create resource") {
if strings.Contains(message, "failed to create resource") || strings.Contains(message, "ns-80117-watch") {
e2e.Logf("status is %s", message)
return false, nil
return true, nil
}
return true, nil
return false, nil
})
exutil.AssertWaitPollNoErr(errWait, "status is not correct")
clusterextension.Delete(oc)
Expand Down Expand Up @@ -2948,7 +2944,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
InstallNamespace: ns2,
PackageName: "nginx80117",
SaName: sa2,
Version: "1.0.1",
Version: "2.0.0",
WatchNamespace: nsWatch2,
LabelKey: "olmv1-test",
LabelValue: labelValue,
Expand All @@ -2958,11 +2954,12 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
_ = clusterextension2.CreateWithoutCheck(oc)
errWait = wait.PollUntilContextTimeout(context.TODO(), 3*time.Second, 150*time.Second, false, func(ctx context.Context) (bool, error) {
message, _ := olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension2.Name, "-o", "jsonpath={.status.conditions[*].message}")
if !strings.Contains(message, "already exists") {
if strings.Contains(message, "already exists") || strings.Contains(message, "Conflicting") {
e2e.Logf("status is %s", message)
return false, nil
return true, nil
}
return true, nil
e2e.Logf("status is %s", message)
return false, nil
})
exutil.AssertWaitPollNoErr(errWait, "status is not correct")

Expand Down Expand Up @@ -3235,7 +3232,10 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
}
return false, nil
})
exutil.AssertWaitPollNoErr(errWait, "nginx82136 2.2.0 is not installed")
if errWait != nil {
_, _ = olmv1util.GetNoEmpty(oc, "clusterextension", clusterextension.Name, "-o=jsonpath-as-json={.status}")
exutil.AssertWaitPollNoErr(errWait, "nginx82136 2.2.0 is not installed")
}
networkpolicies, err = oc.WithoutNamespace().AsAdmin().Run("get").Args("networkpolicy", "-n", ns).Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(networkpolicies).To(o.ContainSubstring("No resources found"))
Expand Down