From 6c878a213164dc895841046170869a50e41c9e7a Mon Sep 17 00:00:00 2001 From: Periyasamy Palanisamy Date: Wed, 11 Oct 2017 13:14:09 +0200 Subject: 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 --- sdnvpn/test/functest/testcase_10.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sdnvpn/test/functest/testcase_10.py') 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() -- cgit 1.2.3-korg