diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-01 09:56:03 +0200 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-01 09:57:06 +0200 |
commit | 3607b9622497fa9d49b2074d4d6717e03d6734f4 (patch) | |
tree | 27e7d8ee1ad5bb9a1632b5b0659bdd5159efbb93 /testcases | |
parent | d20dd9c32d3154aca1cea723c53eaa7418e0b5c5 (diff) |
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 <morgan.richomme@orange.com>
Diffstat (limited to 'testcases')
-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, |