diff options
-rw-r--r-- | sfc/lib/utils.py | 25 | ||||
-rw-r--r-- | sfc/tests/functest/sfc.py | 12 | ||||
-rw-r--r-- | sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py | 4 |
3 files changed, 13 insertions, 28 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index 00f98985..8ed5e15b 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -165,14 +165,14 @@ def create_security_groups(neutron_client, secgroup_name, secgroup_descr): def create_instance(nova_client, name, flavor, image_id, network_id, sg_id, secgroup_name=None, fixed_ip=None, - compute_node='', userdata=None, files=None): + av_zone='', userdata=None, files=None): logger.info("Creating instance '%s'..." % name) logger.debug( "Configuration:\n name=%s \n flavor=%s \n image=%s \n" " network=%s\n secgroup=%s \n hypervisor=%s \n" " fixed_ip=%s\n files=%s\n userdata=\n%s\n" % (name, flavor, image_id, network_id, sg_id, - compute_node, fixed_ip, files, userdata)) + av_zone, fixed_ip, files, userdata)) instance = os_utils.create_instance_and_wait_for_active( flavor, image_id, @@ -180,7 +180,7 @@ def create_instance(nova_client, name, flavor, image_id, network_id, sg_id, name, config_drive=True, userdata=userdata, - av_zone=compute_node, + av_zone=av_zone, fixed_ip=fixed_ip, files=files) @@ -316,7 +316,7 @@ def is_http_blocked(srv_prv_ip, client_ip): return True -def capture_err_logs(ovs_logger, controller_clients, compute_clients, error): +def capture_ovs_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, @@ -372,7 +372,7 @@ def ofctl_time_counter(ovs_logger, ssh_conn): @ft_utils.timethis -def capture_time_log(ovs_logger, compute_clients, timeout=200): +def wait_for_classification_rules(ovs_logger, compute_clients, timeout=200): rsps = ofctl_time_counter(ovs_logger, compute_clients[0]) first_RSP = rsps[0] if len(rsps) > 0 else '' while not ((len(rsps) > 1) and @@ -388,21 +388,6 @@ def capture_time_log(ovs_logger, compute_clients, timeout=200): logger.info("classification rules updated") -def get_compute_nodes(nova_client, required_node_number=2): - """Get the compute nodes in the deployment""" - compute_nodes = os_utils.get_hypervisors(nova_client) - - num_compute_nodes = len(compute_nodes) - if num_compute_nodes < 2: - logger.error("There are %s compute nodes in the deployment. " - "Minimum number of nodes to complete the test is 2." - % num_compute_nodes) - return None - - logger.debug("Compute nodes: %s" % compute_nodes) - return compute_nodes - - def setup_compute_node(cidr): logger.info("bringing up br-int iface") run_cmd_on_compute("ifconfig br-int up") diff --git a/sfc/tests/functest/sfc.py b/sfc/tests/functest/sfc.py index a4f5b37f..7bb5a5ac 100644 --- a/sfc/tests/functest/sfc.py +++ b/sfc/tests/functest/sfc.py @@ -162,7 +162,7 @@ def main(): logger.info(test_utils.run_cmd('tacker sfc-classifier-list')) # Start measuring the time it takes to implement the classification rules - t1 = threading.Thread(target=test_utils.capture_time_log, + t1 = threading.Thread(target=test_utils.wait_for_classification_rules, args=(ovs_logger, compute_clients,)) try: t1.start() @@ -196,7 +196,7 @@ def main(): else: error = ('\033[91mTEST 1 [FAILED] ==> SSH NOT BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "SSH Blocked") @@ -206,7 +206,7 @@ def main(): else: error = ('\033[91mTEST 2 [FAILED] ==> HTTP BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "HTTP works") @@ -233,7 +233,7 @@ def main(): logger.info(test_utils.run_cmd('tacker sfc-classifier-list')) # Start measuring the time it takes to implement the classification rules - t2 = threading.Thread(target=test_utils.capture_time_log, + t2 = threading.Thread(target=test_utils.wait_for_classification_rules, args=(ovs_logger, compute_clients,)) try: t2.start() @@ -249,7 +249,7 @@ def main(): else: error = ('\033[91mTEST 3 [FAILED] ==> HTTP WORKS\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "HTTP Blocked") @@ -259,7 +259,7 @@ def main(): else: error = ('\033[91mTEST 4 [FAILED] ==> SSH BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) results.add_to_summary(2, "FAIL", "SSH works") diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py b/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py index 63edd7e6..9661ee09 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py @@ -224,7 +224,7 @@ def main(): else: error = ('\033[91mTEST 1 [FAILED] ==> HTTP BLOCKED\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 1: HTTP works", "Failed") @@ -241,7 +241,7 @@ def main(): else: error = ('\033[91mTEST 2 [FAILED] ==> HTTP WORKS\033[0m') logger.error(error) - test_utils.capture_err_logs( + test_utils.capture_ovs_logs( ovs_logger, controller_clients, compute_clients, error) update_json_results("Test 2: HTTP Blocked", "Failed") |