diff options
Diffstat (limited to 'testcases/features')
-rw-r--r-- | testcases/features/bgpvpn.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/testcases/features/bgpvpn.py b/testcases/features/bgpvpn.py index 11554ab1..e3db9209 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, |