From 9dae8dbe3cbfcac3d0fbf4a6b4421fa7eb8b2175 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 10 Sep 2021 17:59:25 +0200 Subject: Fallback to item calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no final result if simple tag is called. Change-Id: If86c5115e917e5790799fac4308cf08d57e87905 Signed-off-by: Cédric Ollivier (cherry picked from commit e2f255aaaddeb0b7bebd7a158b535aa0ecdf55e0) --- functest_kubernetes/cnf_conformance/conformance.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'functest_kubernetes') diff --git a/functest_kubernetes/cnf_conformance/conformance.py b/functest_kubernetes/cnf_conformance/conformance.py index 8956598a..fa174f1a 100644 --- a/functest_kubernetes/cnf_conformance/conformance.py +++ b/functest_kubernetes/cnf_conformance/conformance.py @@ -81,13 +81,21 @@ class CNFConformance(testcase.TestCase): msg = prettytable.PrettyTable( header_style='upper', padding_width=5, field_names=['name', 'status']) + item_criteria = 0 for item in self.details['items']: msg.add_row([item['name'], item['status']]) + if item['status'] == "passed": + item_criteria += 1 + else: + 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")) if grp: self.result = int(grp.group(1)) / int(grp.group(2)) * 100 + else: + self.result = item_criteria / len(self.details['items']) * 100 if not os.path.exists(self.res_dir): os.makedirs(self.res_dir) shutil.copy2( -- cgit 1.2.3-korg