diff options
author | Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> | 2017-10-11 13:14:09 +0200 |
---|---|---|
committer | Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> | 2017-10-16 11:00:34 +0200 |
commit | 6c878a213164dc895841046170869a50e41c9e7a (patch) | |
tree | 93621a2c7d2e2f9b0bd9775a4bd6975e9b3c8aee /sdnvpn/test/functest/testcase_10.py | |
parent | e7693b748e16f6013b5dddf6eb5ebcf9d0bb0a3d (diff) |
SDNVPN-184: resources are not cleaned if tc fails
* moved the cleanup code inside the finally block in each test case
Change-Id: Ifc0fee58451923117c54040c716dad6827fbc7fa
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'sdnvpn/test/functest/testcase_10.py')
-rw-r--r-- | sdnvpn/test/functest/testcase_10.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sdnvpn/test/functest/testcase_10.py b/sdnvpn/test/functest/testcase_10.py index 5c0e99b..cbad82d 100644 --- a/sdnvpn/test/functest/testcase_10.py +++ b/sdnvpn/test/functest/testcase_10.py @@ -13,7 +13,6 @@ import logging import re import sys import time -import traceback from functest.utils import openstack_utils as os_utils from multiprocessing import Process, Manager, Lock @@ -249,10 +248,9 @@ def main(): else: results.add_failure(monitor_err_msg) - except: - logging.exception("======== EXCEPTION =========") - exc_type, exc_value, exc_tb = sys.exc_info() - traceback.print_exception(exc_type, exc_value, exc_tb) + except Exception as e: + logger.error("exception occurred while executing testcase_10: %s", e) + raise finally: # Give a stop signal to all threads logging.info("Sending stop signal to monitor thread") @@ -262,10 +260,10 @@ def main(): for thread in threads: thread.join() - test_utils.cleanup_nova(nova_client, instance_ids, image_ids) - test_utils.cleanup_neutron(neutron_client, floatingip_ids, bgpvpn_ids, - interfaces, subnet_ids, router_ids, - network_ids) + test_utils.cleanup_nova(nova_client, instance_ids, image_ids) + test_utils.cleanup_neutron(neutron_client, floatingip_ids, bgpvpn_ids, + interfaces, subnet_ids, router_ids, + network_ids) return results.compile_summary() |