summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test/functest/testcase_10.py
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-10-11 13:14:09 +0200
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-10-16 15:28:17 +0000
commit13cb94010d4c40f4472c1bcbc7e2462ba9f8838b (patch)
tree44f1394639d3e192b7168fbe28569cecfb170a03 /sdnvpn/test/functest/testcase_10.py
parent963ad969487d9896f126afadc8222c48460b81b2 (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> (cherry picked from commit 6c878a213164dc895841046170869a50e41c9e7a)
Diffstat (limited to 'sdnvpn/test/functest/testcase_10.py')
-rw-r--r--sdnvpn/test/functest/testcase_10.py16
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()