diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2016-11-18 16:38:16 +0200 |
---|---|---|
committer | George Paraskevopoulos <geopar@intracom-telecom.com> | 2016-11-18 16:45:34 +0200 |
commit | f7d3a01b0018c2fa1a6e15f2cdd6358fa6307ccf (patch) | |
tree | 0362106d94b753a9518da91ca273dd60f6b6af3d | |
parent | 5adc0df39c58ad2f44aa538c906fdc2fafff2450 (diff) |
Create ovs log artifact on odl-sfc fail
Move the ovs logs from failed tests in functest artifacts
Change-Id: Icb537684ee2aa40d9bd182ba67a028e72496efa4
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
-rwxr-xr-x | testcases/features/sfc/sfc.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/testcases/features/sfc/sfc.py b/testcases/features/sfc/sfc.py index 376083555..90b37b3cf 100755 --- a/testcases/features/sfc/sfc.py +++ b/testcases/features/sfc/sfc.py @@ -352,11 +352,8 @@ def is_http_blocked(srv_prv_ip, client_ip): return True -def capture_err_logs(controller_clients, compute_clients, error): - ovs_logger = ovs_utils.OVSLogger( - os.path.join(os.getcwd(), 'ovs-logs'), - FUNCTEST_RESULTS_DIR) - +def capture_err_logs(ovs_logger, controller_clients, + compute_clients, error): timestamp = time.strftime("%Y%m%d-%H%M%S") ovs_logger.dump_ovs_logs(controller_clients, compute_clients, @@ -405,10 +402,7 @@ def check_ssh(ips, retries=100): # Measure the time it takes to update the classification rules -def capture_time_log(compute_clients): - ovs_logger = ovs_utils.OVSLogger( - os.path.join(os.getcwd(), 'ovs-logs'), - "test") +def capture_time_log(ovs_logger, compute_clients): i = 0 first_RSP = "" start_time = time.time() @@ -465,6 +459,10 @@ def main(): controller_clients = get_ssh_clients("controller") compute_clients = get_ssh_clients("compute") + ovs_logger = ovs_utils.OVSLogger( + os.path.join(os.getcwd(), 'ovs-logs'), + FUNCTEST_RESULTS_DIR) + image_id = setup_glance(glance_client) network_id = setup_neutron(neutron_client) sg_id = setup_security_groups(neutron_client) @@ -478,7 +476,8 @@ def main(): # Start measuring the time it takes to implement the classification rules try: - thread.start_new_thread(capture_time_log, (compute_clients,)) + thread.start_new_thread(capture_time_log, + (ovs_logger, compute_clients,)) except Exception, e: logger.error("Unable to start the thread that counts time %s" % e) @@ -510,7 +509,8 @@ def main(): else: error = ('\033[91mTEST 1 [FAILED] ==> SSH NOT BLOCKED\033[0m') logger.error(error) - capture_err_logs(controller_clients, compute_clients, error) + capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 1: SSH Blocked", "Failed") logger.info("Test HTTP") @@ -520,7 +520,8 @@ def main(): else: error = ('\033[91mTEST 2 [FAILED] ==> HTTP BLOCKED\033[0m') logger.error(error) - capture_err_logs(controller_clients, compute_clients, error) + capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 2: HTTP works", "Failed") logger.info("Changing the classification") @@ -528,7 +529,8 @@ def main(): # Start measuring the time it takes to implement the classification rules try: - thread.start_new_thread(capture_time_log, (compute_clients,)) + thread.start_new_thread(capture_time_log, + (ovs_logger, compute_clients,)) except Exception, e: logger.error("Unable to start the thread that counts time %s" % e) @@ -560,6 +562,8 @@ def main(): logger.error('\033[91mSFC TESTS: %s :( FOUND %s FAIL \033[0m' % ( status, json_results["failures"])) + ovs_logger.create_artifact_archive() + if args.report: stop_time = time.time() logger.debug("Promise Results json: " + str(json_results)) |