diff options
Diffstat (limited to 'tests/functest/odl-sfc/sfc.py')
-rwxr-xr-x | tests/functest/odl-sfc/sfc.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/functest/odl-sfc/sfc.py b/tests/functest/odl-sfc/sfc.py index 3dba62f9..fe9d3e5f 100755 --- a/tests/functest/odl-sfc/sfc.py +++ b/tests/functest/odl-sfc/sfc.py @@ -7,8 +7,10 @@ import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils import functest.utils.openstack_tacker as os_tacker import threading +import ovs_utils import utils as test_utils + parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", @@ -91,6 +93,10 @@ def main(): controller_clients = test_utils.get_ssh_clients("controller", PROXY) compute_clients = test_utils.get_ssh_clients("compute", PROXY) + ovs_logger = ovs_utils.OVSLogger( + os.path.join(SFC_TEST_DIR, 'ovs-logs'), + FUNCTEST_RESULTS_DIR) + image_id = os_utils.create_glance_image(glance_client, IMAGE_NAME, IMAGE_PATH, @@ -159,7 +165,7 @@ def main(): # Start measuring the time it takes to implement the classification rules t1 = threading.Thread(target=test_utils.capture_time_log, - args=(compute_clients,)) + args=(ovs_logger, compute_clients,)) try: t1.start() except Exception, e: @@ -193,7 +199,8 @@ def main(): else: error = ('\033[91mTEST 1 [FAILED] ==> SSH NOT BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs(controller_clients, compute_clients, error) + test_utils.capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 1: SSH Blocked", "Failed") logger.info("Test HTTP") @@ -203,7 +210,8 @@ def main(): else: error = ('\033[91mTEST 2 [FAILED] ==> HTTP BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs(controller_clients, compute_clients, error) + test_utils.capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 2: HTTP works", "Failed") logger.info("Changing the classification") @@ -230,7 +238,7 @@ def main(): # Start measuring the time it takes to implement the classification rules t2 = threading.Thread(target=test_utils.capture_time_log, - args=(compute_clients,)) + args=(ovs_logger, compute_clients,)) try: t2.start() except Exception, e: @@ -246,7 +254,8 @@ def main(): else: error = ('\033[91mTEST 3 [FAILED] ==> HTTP WORKS\033[0m') logger.error(error) - test_utils.capture_err_logs(controller_clients, compute_clients, error) + test_utils.capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 3: HTTP Blocked", "Failed") logger.info("Test SSH") @@ -256,7 +265,8 @@ def main(): else: error = ('\033[91mTEST 4 [FAILED] ==> SSH BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs(controller_clients, compute_clients, error) + test_utils.capture_err_logs( + ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 4: SSH Works", "Failed") if json_results["failures"]: @@ -273,6 +283,7 @@ def main(): stop_time, status, json_results) + ovs_logger.create_artifact_archive() if status == "PASS": logger.info('\033[92mSFC ALL TESTS: %s :)\033[0m' % status) |