From 3607b9622497fa9d49b2074d4d6717e03d6734f4 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Wed, 1 Jun 2016 09:56:03 +0200 Subject: bug fix: pb when pushing bgpvpn results when no failed failed field is empty (not equal to 0) JIRA: FUNCTEST-234 Change-Id: Ic243e1e23615d585a735266d9012fc4c52d67ba3 Signed-off-by: Morgan Richomme --- testcases/features/bgpvpn.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'testcases/features') diff --git a/testcases/features/bgpvpn.py b/testcases/features/bgpvpn.py index 11554ab1a..e3db9209d 100644 --- a/testcases/features/bgpvpn.py +++ b/testcases/features/bgpvpn.py @@ -82,8 +82,7 @@ def main(): tests = m.group(1) # Look for tests failed m = re.search('Failed:(.*)', output) - if m is not None: - failed = m.group(1) + failed = m.group(1) except: logger.error("Impossible to parse the result file") @@ -94,6 +93,16 @@ def main(): "errors": error_logs} logger.info("Results: " + str(json_results)) + criteria = "failed" + # criteria = success rate = 100% (i.e all tests passed) + criteria_run = int(tests) + if not failed: + criteria_failed = 0 + else: + criteria_failed = int(failed) + + if criteria_run > 0 and criteria_failed < 1: + criteria = "passed" # Push results in payload of testcase if args.report: @@ -103,9 +112,6 @@ def main(): version = ft_utils.get_version(logger) pod_name = ft_utils.get_pod_name(logger) build_tag = ft_utils.get_build_tag(logger) - criteria = "failed" - if int(tests) > 0 and int(failed) < 1: - criteria = "passed" ft_utils.push_results_to_db(url, "sdnvpn", "bgpvpn_api", logger, pod_name, version, scenario, criteria, -- cgit 1.2.3-korg