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

Commit d2f531a

Browse files
authored
Porting of Fail operator cert test if operator is not certified #95 (#661)
Porting of Fail operator cert test if operator is not certified
1 parent e982e8b commit d2f531a

File tree

1 file changed

+14
-13
lines changed
  • test-network-function/certification

1 file changed

+14
-13
lines changed

test-network-function/certification/suite.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,24 +222,25 @@ func testAllOperatorCertified(env *configpkg.TestEnvironment) {
222222
testFailed := false
223223
for _, op := range operatorsToQuery {
224224
ocpversion := GetOcpVersion()
225+
majorDotMinorVersion := ""
226+
if ocpversion != "" {
227+
// Converts major.minor.patch version format to major.minor
228+
const majorMinorPatchCount = 3
229+
splitVersion := strings.SplitN(ocpversion, ".", majorMinorPatchCount)
230+
majorDotMinorVersion = splitVersion[0] + "." + splitVersion[1]
231+
}
225232
pack := op.Name
226-
org := op.Org
227-
if org == CertifiedOperator {
228-
isCertified := waitForCertificationRequestToSuccess(getOperatorCertificationRequestFunction(org, pack, ocpversion), apiRequestTimeout).(bool)
229-
if !isCertified {
230-
testFailed = true
231-
log.Info(fmt.Sprintf("Operator %s (organization %s) not certified for Openshift %s .", pack, org, ocpversion))
232-
tnf.ClaimFilePrintf("Operator %s (organization %s) failed to be certified for Openshift %s", pack, org, ocpversion)
233-
} else {
234-
log.Info(fmt.Sprintf("Operator %s (organization %s) certified OK.", pack, org))
235-
}
236-
} else {
233+
isCertified := waitForCertificationRequestToSuccess(getOperatorCertificationRequestFunction(CertifiedOperator, pack, majorDotMinorVersion), apiRequestTimeout).(bool)
234+
if !isCertified {
237235
testFailed = true
238-
tnf.ClaimFilePrintf("Operator %s is not certified (needs to be part of the operator-certified organization in the catalog)", op.Packag)
236+
log.Info(fmt.Sprintf("Operator %s not certified for OpenShift %s .", pack, majorDotMinorVersion))
237+
tnf.ClaimFilePrintf("Operator %s failed to be certified for OpenShift %s", pack, majorDotMinorVersion)
238+
} else {
239+
log.Info(fmt.Sprintf("Operator %s certified OK.", pack))
239240
}
240241
}
241242
if testFailed {
242-
ginkgo.Skip("At least one operator was not certified to run on this version of Openshift. Check Claim.json file for details.")
243+
ginkgo.Fail("At least one operator was not certified to run on this version of OpenShift. Check Claim.json file for details.")
243244
}
244245
})
245246
}

0 commit comments

Comments
 (0)