From e375c24c0938ad7d60e0bd45b90cc1211e112aa2 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 17 Oct 2022 12:50:04 +0200 Subject: Use cnf certifaction criteria MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7362827b600914ab032ba9657ac17e7bb157bdfc Signed-off-by: Cédric Ollivier --- functest_kubernetes/cnf_conformance/conformance.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'functest_kubernetes/cnf_conformance') diff --git a/functest_kubernetes/cnf_conformance/conformance.py b/functest_kubernetes/cnf_conformance/conformance.py index a248928e..bfb0c1bb 100644 --- a/functest_kubernetes/cnf_conformance/conformance.py +++ b/functest_kubernetes/cnf_conformance/conformance.py @@ -87,16 +87,17 @@ class CNFConformance(testcase.TestCase): msg.add_row([item['name'], item['status']]) if item['status'] == "passed": item_criteria += 1 - else: + elif item['status'] == "failed": self.__logger.warning( "%s %s", item['name'], item['status']) self.__logger.info("\n\n%s\n", msg.get_string()) grp = re.search( - r'Final .* score: (\d+) of (\d+)', output.decode("utf-8")) + r'(\d+) of (\d+) essential tests passed', output.decode("utf-8")) if grp: - self.result = int(grp.group(1)) / int(grp.group(2)) * 100 + # https://github.com/cncf/cnf-certification/blob/main/reviewing.md + self.result = int(grp.group(1)) else: - self.result = item_criteria / len(self.details['items']) * 100 + self.result = 0 if not os.path.exists(self.res_dir): os.makedirs(self.res_dir) shutil.copy2( -- cgit 1.2.3-korg