summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>2017-04-03 16:03:08 +0200
committerNikolas Hermanns <nikolas.hermanns@ericsson.com>2017-04-07 08:39:13 +0000
commit6788c3b0ad67b65c41bbf8bf23a6a97561cf6e3a (patch)
tree2d3257011f94ec48508607b312ee296d26c40f82
parent5c28dc19e72ffbbaf652ff6b5c48d7fe72bdd9c4 (diff)
Do not stop tests if exception in testcase
Change-Id: I9e3db350be4b1ca60d6feaf2961034b50b50deb5 Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com> (cherry picked from commit fbe69370c477a7b01032df701fe96ea90ec60341)
-rw-r--r--sdnvpn/test/functest/run_tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sdnvpn/test/functest/run_tests.py b/sdnvpn/test/functest/run_tests.py
index 1130759..6ded2d0 100644
--- a/sdnvpn/test/functest/run_tests.py
+++ b/sdnvpn/test/functest/run_tests.py
@@ -13,6 +13,7 @@ import importlib
import os
import sys
import time
+import traceback
import yaml
import functest.utils.functest_logger as ft_logger
@@ -74,11 +75,17 @@ def main():
logger.info("%s\n" % ("=" * len(title)))
t = importlib.import_module(testcase, package=None)
start_time = time.time()
- result = t.main()
+ try:
+ result = t.main()
+ except Exception as ex:
+ result = -1
+ logger.info("Caught Exception in %s: %s Trace: %s" %
+ (test_name, ex, traceback.format_exc()))
end_time = time.time()
if result < 0:
status = "FAIL"
overall_status = "FAIL"
+ logger.info("Testcase %s failed" % test_name)
else:
status = result.get("status")
details = result.get("details")