diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-02-14 13:44:42 +0200 |
---|---|---|
committer | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-02-15 12:28:11 +0200 |
commit | f9a6e37b970ff3974ad9e3f0027354d04bbf3ce7 (patch) | |
tree | db1af81b1c7c40e5535159a30e821ef254d78a7f /sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | |
parent | 306daf5219a2ba7975c2cc22096e41fd39f91918 (diff) |
Refactor utils using installer adapters
JIRA: SFC-65
JIRA: SFC-71
Use the new library in releng to talk to fuel.
This allows for correct configuration of the compute hosts to resolve
SFC-71
Also since https://gerrit.opnfv.org/gerrit/#/c/28281/ was merged it
allows to run in multienv deployments so it resolves SFC-65
Change-Id: I5e6beb90d9c5108c21acb8d898f07cd2f4ae34f3
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py')
-rw-r--r-- | sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py index e112e07b..58959530 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -20,6 +20,7 @@ import opnfv.utils.ovs_logger as ovs_log import sfc.lib.config as sfc_config import sfc.lib.utils as test_utils from sfc.lib.results import Results +from opnfv.deployment.factory import Factory as DeploymentFactory """ logging configuration """ @@ -32,6 +33,22 @@ TESTCASE_CONFIG = sfc_config.TestcaseConfig('sfc_two_chains_SSH_and_HTTP') def main(): + deploymentHandler = DeploymentFactory.get_handler( + COMMON_CONFIG.installer_type, + COMMON_CONFIG.installer_ip, + COMMON_CONFIG.installer_user, + installer_pwd=COMMON_CONFIG.installer_password) + + cluster = COMMON_CONFIG.installer_cluster + openstack_nodes = (deploymentHandler.get_nodes({'cluster': cluster}) + if cluster is not None + else deploymentHandler.get_nodes()) + + controller_nodes = [node for node in openstack_nodes + if node.is_controller()] + compute_nodes = [node for node in openstack_nodes + if node.is_compute()] + results = Results(COMMON_CONFIG.line_length) results.add_to_summary(0, "=") results.add_to_summary(2, "STATUS", "SUBTEST") @@ -51,8 +68,9 @@ def main(): '\033[91mexport INSTALLER_IP=<ip>\033[0m') sys.exit(1) - test_utils.setup_compute_node(TESTCASE_CONFIG.subnet_cidr) - test_utils.configure_iptables() + test_utils.setup_compute_node(TESTCASE_CONFIG.subnet_cidr, compute_nodes) + test_utils.configure_iptables(controller_nodes) + test_utils.download_image(COMMON_CONFIG.url, COMMON_CONFIG.image_path) _, custom_flv_id = os_utils.get_or_create_flavor( @@ -69,10 +87,8 @@ def main(): nova_client = os_utils.get_nova_client() tacker_client = os_tacker.get_tacker_client() - controller_clients = test_utils.get_ssh_clients("controller", - COMMON_CONFIG.fuel_proxy) - compute_clients = test_utils.get_ssh_clients("compute", - COMMON_CONFIG.fuel_proxy) + controller_clients = test_utils.get_ssh_clients(controller_nodes) + compute_clients = test_utils.get_ssh_clients(compute_nodes) ovs_logger = ovs_log.OVSLogger( os.path.join(COMMON_CONFIG.sfc_test_dir, 'ovs-logs'), |