Skip to content

Commit 08f4500

Browse files
Merge pull request #1158 from kuiwang02/stressmigrate
OCPQE-31151:Migrate OLM v0 stress test cases
2 parents a38d192 + ab48261 commit 08f4500

30 files changed

+1064
-59
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,5 +1741,37 @@
17411741
"environmentSelector": {
17421742
"exclude": "topology==\"External\""
17431743
}
1744+
},
1745+
{
1746+
"name": "[sig-operator][Jira:OLM] OLM v0 for stress PolarionID:80299-[OTP][Skipped:Disconnected][OlmStress]create mass operator to see if they all are installed successfully with different ns [Slow][Timeout:180m]",
1747+
"labels": {
1748+
"Extended": {},
1749+
"NonHyperShiftHOST": {},
1750+
"StressTest": {}
1751+
},
1752+
"resources": {
1753+
"isolation": {}
1754+
},
1755+
"source": "openshift:payload:olmv0",
1756+
"lifecycle": "blocking",
1757+
"environmentSelector": {
1758+
"exclude": "topology==\"External\""
1759+
}
1760+
},
1761+
{
1762+
"name": "[sig-operator][Jira:OLM] OLM v0 for stress PolarionID:80413-[OTP][Skipped:Disconnected][OlmStress]install operator repeatedly serially with same ns [Slow][Timeout:180m]",
1763+
"labels": {
1764+
"Extended": {},
1765+
"NonHyperShiftHOST": {},
1766+
"StressTest": {}
1767+
},
1768+
"resources": {
1769+
"isolation": {}
1770+
},
1771+
"source": "openshift:payload:olmv0",
1772+
"lifecycle": "blocking",
1773+
"environmentSelector": {
1774+
"exclude": "topology==\"External\""
1775+
}
17441776
}
17451777
]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within all namespace", func()
2020
defer g.GinkgoRecover()
2121

2222
var (
23-
oc = exutil.NewCLI("olm-all-"+exutil.GetRandomString(), exutil.KubeConfigPath())
24-
23+
oc = exutil.NewCLIWithoutNamespace("default")
2524
dr = make(olmv0util.DescriberResrouce)
2625
)
2726

2827
g.BeforeEach(func() {
2928
exutil.SkipMicroshift(oc)
29+
oc.SetupProject()
3030
exutil.SkipNoOLMCore(oc)
3131
itName := g.CurrentSpecReport().FullText()
3232
dr.AddIr(itName)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 should", func() {
2828
defer g.GinkgoRecover()
2929

3030
var (
31-
oc = exutil.NewCLI("olm-common-"+exutil.GetRandomString(), exutil.KubeConfigPath())
31+
oc = exutil.NewCLIWithoutNamespace("default")
3232

3333
dr = make(olmv0util.DescriberResrouce)
3434
)
3535

3636
g.BeforeEach(func() {
3737
exutil.SkipMicroshift(oc)
38+
oc.SetupProject()
3839
exutil.SkipNoOLMCore(oc)
3940
itName := g.CurrentSpecReport().FullText()
4041
dr.AddIr(itName)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 optional should", func() {
3333
defer g.GinkgoRecover()
3434

3535
var (
36-
oc = exutil.NewCLI("default-"+exutil.GetRandomString(), exutil.KubeConfigPath())
36+
oc = exutil.NewCLIWithoutNamespace("default")
3737
)
3838

3939
g.BeforeEach(func() {
4040
exutil.SkipMicroshift(oc)
41+
oc.SetupProject()
4142
exutil.SkipNoOLMCore(oc)
4243
})
4344

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 on hypershift mgmt", g.Label(
1818
defer g.GinkgoRecover()
1919

2020
var (
21-
oc = exutil.NewCLIForKubeOpenShift("hypershiftmgmt-" + exutil.GetRandomString())
21+
oc = exutil.NewCLIWithoutNamespace("default")
2222
guestClusterName, guestClusterKube, hostedClusterNS string
2323
isAKS bool
2424
errIsAKS error
2525
)
2626

2727
g.BeforeEach(func() {
2828
exutil.SkipMicroshift(oc)
29+
oc.SetupProject()
2930
if !exutil.IsHypershiftMgmtCluster(oc) {
3031
g.Skip("this is not a hypershift management cluster, skip test run")
3132
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 with multi ns", func() {
1919
defer g.GinkgoRecover()
2020

2121
var (
22-
oc = exutil.NewCLI("olm-multi-"+exutil.GetRandomString(), exutil.KubeConfigPath())
22+
oc = exutil.NewCLIWithoutNamespace("default")
2323

2424
dr = make(olmv0util.DescriberResrouce)
2525
)
2626

2727
g.BeforeEach(func() {
2828
exutil.SkipMicroshift(oc)
29+
oc.SetupProject()
2930

3031
exutil.SkipNoOLMCore(oc)
3132
itName := g.CurrentSpecReport().FullText()

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
2626
defer g.GinkgoRecover()
2727

2828
var (
29-
oc = exutil.NewCLI("olm-a-"+exutil.GetRandomString(), exutil.KubeConfigPath())
29+
oc = exutil.NewCLIWithoutNamespace("default")
3030

3131
dr = make(olmv0util.DescriberResrouce)
3232
)
3333

3434
g.BeforeEach(func() {
3535
exutil.SkipMicroshift(oc)
36+
oc.SetupProject()
3637
exutil.SkipNoOLMCore(oc)
3738
itName := g.CurrentSpecReport().FullText()
3839
dr.AddIr(itName)
@@ -1108,7 +1109,22 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
11081109
g.By("Delete sa of csv")
11091110
sa.GetDefinition(oc)
11101111
sa.Delete(oc)
1111-
olmv0util.NewCheck("expect", exutil.AsUser, exutil.WithNamespace, exutil.Compare, "RequirementsNotMet", exutil.Ok, []string{"csv", sub.InstalledCSV, "-o=jsonpath={.status.reason}"}).Check(oc)
1112+
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) {
1115+
output, err = oc.WithoutNamespace().Run("get").Args("csv", sub.InstalledCSV, "-n", sub.Namespace, "-o=jsonpath={.status.reason}").Output()
1116+
if err != nil {
1117+
return false, err
1118+
}
1119+
if strings.Contains(output, "RequirementsNotMet") {
1120+
return true, nil
1121+
}
1122+
return false, nil
1123+
})
1124+
if strings.Contains(output, "InstallWaiting") {
1125+
g.Skip("skip because of slow installation")
1126+
}
1127+
exutil.AssertWaitPollNoErr(errCsv, fmt.Sprintf("csv status %v is not expected", output))
11121128

11131129
g.By("Recovery sa of csv")
11141130
sa.Reapply(oc)
@@ -1835,6 +1851,8 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 within a namespace", func() {
18351851

18361852
g.By("install operator")
18371853
sub.Create(oc, itName, dr)
1854+
defer sub.DeleteCSV(itName, dr)
1855+
defer sub.Delete(itName, dr)
18381856

18391857
g.By("check if dependent operator is installed")
18401858
olmv0util.NewCheck("expect", exutil.AsAdmin, exutil.WithoutNamespace, exutil.Compare, "Succeeded", exutil.Ok, []string{"csv", sub.InstalledCSV, "-n", sub.Namespace, "-o=jsonpath={.status.phase}"}).Check(oc)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 opm should", g.Label("NonHype
1919
defer g.GinkgoRecover()
2020

2121
var (
22-
oc = exutil.NewCLIForKubeOpenShift("opm-" + exutil.GetRandomString())
22+
oc = exutil.NewCLIWithoutNamespace("default")
2323
opmCLI = opmcli.NewOpmCLI()
2424
)
2525

2626
g.BeforeEach(func() {
2727
exutil.SkipMicroshift(oc)
2828

29+
oc.SetupProject()
2930
err := opmcli.EnsureOPMBinary()
3031
if err != nil {
3132
g.Skip("Failed to setup opm binary: " + err.Error())
@@ -500,6 +501,8 @@ var _ = g.Describe("[sig-operator][Jira:OLM] OLMv0 opm should", g.Label("NonHype
500501
if os.Getenv("HTTP_PROXY") != "" || os.Getenv("http_proxy") != "" {
501502
g.Skip("HTTP_PROXY is not empty - skipping test ...")
502503
}
504+
errPolicy := opmcli.EnsureContainerPolicy()
505+
o.Expect(errPolicy).NotTo(o.HaveOccurred())
503506
opmBaseDir := exutil.FixturePath("testdata", "opm", "53871")
504507
opmCLI.ExecCommandPath = opmBaseDir
505508

0 commit comments

Comments
 (0)