aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2021-09-10 17:59:25 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2021-09-10 18:02:16 +0200
commit9dae8dbe3cbfcac3d0fbf4a6b4421fa7eb8b2175 (patch)
tree9b0768f8efdc523e52d3bd57cabd9d1093dd84f7
parent6366a808d246c20f7274eda2cde04704afd97abe (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)
-rw-r--r--functest_kubernetes/cnf_conformance/conformance.py8
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(