Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Porting of Fail operator cert test if operator is not certified #95 (#…
Browse files Browse the repository at this point in the history
…661)

Porting of Fail operator cert test if operator is not certified
  • Loading branch information
edcdavid authored Mar 31, 2022
1 parent e982e8b commit d2f531a
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions test-network-function/certification/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,25 @@ func testAllOperatorCertified(env *configpkg.TestEnvironment) {
testFailed := false
for _, op := range operatorsToQuery {
ocpversion := GetOcpVersion()
majorDotMinorVersion := ""
if ocpversion != "" {
// Converts major.minor.patch version format to major.minor
const majorMinorPatchCount = 3
splitVersion := strings.SplitN(ocpversion, ".", majorMinorPatchCount)
majorDotMinorVersion = splitVersion[0] + "." + splitVersion[1]
}
pack := op.Name
org := op.Org
if org == CertifiedOperator {
isCertified := waitForCertificationRequestToSuccess(getOperatorCertificationRequestFunction(org, pack, ocpversion), apiRequestTimeout).(bool)
if !isCertified {
testFailed = true
log.Info(fmt.Sprintf("Operator %s (organization %s) not certified for Openshift %s .", pack, org, ocpversion))
tnf.ClaimFilePrintf("Operator %s (organization %s) failed to be certified for Openshift %s", pack, org, ocpversion)
} else {
log.Info(fmt.Sprintf("Operator %s (organization %s) certified OK.", pack, org))
}
} else {
isCertified := waitForCertificationRequestToSuccess(getOperatorCertificationRequestFunction(CertifiedOperator, pack, majorDotMinorVersion), apiRequestTimeout).(bool)
if !isCertified {
testFailed = true
tnf.ClaimFilePrintf("Operator %s is not certified (needs to be part of the operator-certified organization in the catalog)", op.Packag)
log.Info(fmt.Sprintf("Operator %s not certified for OpenShift %s .", pack, majorDotMinorVersion))
tnf.ClaimFilePrintf("Operator %s failed to be certified for OpenShift %s", pack, majorDotMinorVersion)
} else {
log.Info(fmt.Sprintf("Operator %s certified OK.", pack))
}
}
if testFailed {
ginkgo.Skip("At least one operator was not certified to run on this version of Openshift. Check Claim.json file for details.")
ginkgo.Fail("At least one operator was not certified to run on this version of OpenShift. Check Claim.json file for details.")
}
})
}
Expand Down

0 comments on commit d2f531a

Please sign in to comment.