diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-09-10 17:59:25 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-09-10 18:03:21 +0200 |
commit | 88312528fba6b602d2701fb77e252d2e9f26e71b (patch) | |
tree | 51bc2aa1bbd468c165565386d7f774849951acf1 /functest_kubernetes | |
parent | cc15df5266e689a7d32d226c6cbeaee81506c230 (diff) |
Fallback to item calculation
There is no final result if simple tag is called.
Change-Id: If86c5115e917e5790799fac4308cf08d57e87905
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit e2f255aaaddeb0b7bebd7a158b535aa0ecdf55e0)
Diffstat (limited to 'functest_kubernetes')
-rw-r--r-- | functest_kubernetes/cnf_conformance/conformance.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/functest_kubernetes/cnf_conformance/conformance.py b/functest_kubernetes/cnf_conformance/conformance.py index 13268e24..71b697cb 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( |