-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c57cb00
commit ead109b
Showing
4 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package operator | ||
|
||
import ( | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
"github.com/operator-framework/api/pkg/operators/v1alpha1" | ||
"github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/globalhelper" | ||
"github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/globalparameters" | ||
tshelper "github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/operator/helper" | ||
tsparams "github.com/redhat-best-practices-for-k8s/certsuite-qe/tests/operator/parameters" | ||
) | ||
|
||
var _ = Describe("Operator bundle count,", Serial, func() { | ||
var randomNamespace string | ||
var randomReportDir string | ||
var randomCertsuiteConfigDir string | ||
|
||
BeforeEach(func() { | ||
|
||
// Create random namespace and keep original report and certsuite config directories | ||
randomNamespace, randomReportDir, randomCertsuiteConfigDir = | ||
globalhelper.BeforeEachSetupWithRandomNamespace( | ||
tsparams.OperatorNamespace) | ||
|
||
By("Define certsuite config file") | ||
err := globalhelper.DefineCertsuiteConfig( | ||
[]string{randomNamespace}, | ||
[]string{tsparams.TestPodLabel}, | ||
[]string{}, | ||
[]string{}, | ||
tsparams.CertsuiteTargetCrdFilters, randomCertsuiteConfigDir) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
AfterEach(func() { | ||
globalhelper.AfterEachCleanupWithRandomNamespace(randomNamespace, | ||
randomReportDir, randomCertsuiteConfigDir, tsparams.Timeout) | ||
}) | ||
|
||
It("CatalogSource with less than 1000 bundle images", func() { | ||
By("Create custom-operator catalog source") | ||
err := globalhelper.DeployCustomOperatorSource("quay.io/deliedit/test:catalog-index-test") | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
DeferCleanup(func() { | ||
err := globalhelper.DeleteCustomOperatorSource() | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
By("Deploy operator group for namespace " + randomNamespace) | ||
err = tshelper.DeployTestOperatorGroup(randomNamespace, false) | ||
Expect(err).ToNot(HaveOccurred(), "Error deploying operator group") | ||
|
||
By(fmt.Sprintf("Deploy first operator (nginx-ingress-operator) for testing - channel %s", "new")) | ||
err = tshelper.DeployOperatorSubscription( | ||
"operator1", | ||
tsparams.CertifiedOperatorPrefixNginx, | ||
"new", | ||
randomNamespace, | ||
"custom-catalog", | ||
tsparams.OperatorSourceNamespace, | ||
tsparams.CertifiedOperatorPrefixNginx+".v2.4.0", | ||
v1alpha1.ApprovalAutomatic, | ||
) | ||
Expect(err).ToNot(HaveOccurred(), ErrorDeployOperatorStr+ | ||
tsparams.CertifiedOperatorPrefixNginx) | ||
|
||
By("Wait until operator is ready") | ||
err = tshelper.WaitUntilOperatorIsReady(tsparams.CertifiedOperatorPrefixNginx, randomNamespace) | ||
Expect(err).ToNot(HaveOccurred(), "Operator "+tsparams.CertifiedOperatorPrefixNginx+ | ||
" is not ready") | ||
|
||
By("Label operator") | ||
Eventually(func() error { | ||
return tshelper.AddLabelToInstalledCSV( | ||
tsparams.CertifiedOperatorPrefixNginx, | ||
randomNamespace, | ||
tsparams.OperatorLabel) | ||
}, tsparams.TimeoutLabelCsv, tsparams.PollingInterval).Should(Not(HaveOccurred()), | ||
ErrorLabelingOperatorStr+tsparams.CertifiedOperatorPrefixNginx) | ||
|
||
By("Start test") | ||
err = globalhelper.LaunchTests( | ||
tsparams.CertsuiteOperatorBundleCount, | ||
globalhelper.ConvertSpecNameToFileName(CurrentSpecReport().FullText()), | ||
randomReportDir, | ||
randomCertsuiteConfigDir) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
By("Verify test case status in Claim report") | ||
err = globalhelper.ValidateIfReportsAreValid( | ||
tsparams.CertsuiteOperatorBundleCount, | ||
globalparameters.TestCasePassed, randomReportDir) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters