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 17:59:25 +0200 |
commit | e2f255aaaddeb0b7bebd7a158b535aa0ecdf55e0 (patch) | |
tree | c129942464df305869692f4f7bc42e004110d31f /functest_kubernetes/cnf_conformance | |
parent | fbd14c587ba477b7c9e3dcadabb295edbcc6ffbb (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>
Diffstat (limited to 'functest_kubernetes/cnf_conformance')
-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 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( |