aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-05-27 12:54:57 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-05-27 12:54:57 +0000
commit7c7e82c2fbd4b08c4d0c322aa8c1379926db4d00 (patch)
tree1edcae8b1d338291589f7b6cfbd498f15e5ee1a0
parent37539fcf867c3ca06b220e3a4b766950ca710a74 (diff)
parent9290fed4a7503367dc1eda024d2cdeabd50157d4 (diff)
Merge "bug fix: if all tests passed failed could be empty"
-rw-r--r--testcases/features/bgpvpn.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/testcases/features/bgpvpn.py b/testcases/features/bgpvpn.py
index 03aecbb32..11554ab1a 100644
--- a/testcases/features/bgpvpn.py
+++ b/testcases/features/bgpvpn.py
@@ -82,7 +82,8 @@ def main():
tests = m.group(1)
# Look for tests failed
m = re.search('Failed:(.*)', output)
- failed = m.group(1)
+ if m is not None:
+ failed = m.group(1)
except:
logger.error("Impossible to parse the result file")
@@ -93,9 +94,7 @@ def main():
"errors": error_logs}
logger.info("Results: " + str(json_results))
- criteria = "failed"
- if int(tests) > 0 and int(failed) < 1:
- criteria = "passed"
+
# Push results in payload of testcase
if args.report:
logger.debug("Push result into DB")
@@ -104,6 +103,9 @@ 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,