From 85aa735678433c40f8369781fba29af4dbbbd416 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Fri, 15 Sep 2017 11:54:12 +0200 Subject: Sync both test cases and move checks to the start There are some checks in sfc_two... which do not exist in sfc_one. Those checks should be done at the beginning of the test Change-Id: I44c612c7dfe6bb4329bc49478f3342cda555229c Signed-off-by: Manuel Buil --- .../sfc_one_chain_two_service_functions.py | 17 ++++++++++++ sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | 31 ++++++++++++---------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions.py b/sfc/tests/functest/sfc_one_chain_two_service_functions.py index 13ac418d..0f4d6aa9 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py @@ -41,6 +41,23 @@ def main(): COMMON_CONFIG.installer_password, COMMON_CONFIG.installer_key_file) + installer_type = os.environ.get("INSTALLER_TYPE") + + supported_installers = ['fuel', 'apex', 'OSA'] + + if installer_type not in supported_installers: + logger.error( + '\033[91mYour installer is not supported yet\033[0m') + sys.exit(1) + + installer_ip = os.environ.get("INSTALLER_IP") + if not installer_ip: + logger.error( + '\033[91minstaller ip is not set\033[0m') + logger.error( + '\033[91mexport INSTALLER_IP=\033[0m') + sys.exit(1) + cluster = COMMON_CONFIG.installer_cluster openstack_nodes = (deploymentHandler.get_nodes({'cluster': cluster}) 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 ff343761..22249c25 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -40,6 +40,23 @@ def main(): COMMON_CONFIG.installer_password, COMMON_CONFIG.installer_key_file) + installer_type = os.environ.get("INSTALLER_TYPE") + + supported_installers = ['fuel', 'apex', 'OSA'] + + if installer_type not in supported_installers: + logger.error( + '\033[91mYour installer is not supported yet\033[0m') + sys.exit(1) + + installer_ip = os.environ.get("INSTALLER_IP") + if not installer_ip: + logger.error( + '\033[91minstaller ip is not set\033[0m') + logger.error( + '\033[91mexport INSTALLER_IP=\033[0m') + sys.exit(1) + cluster = COMMON_CONFIG.installer_cluster openstack_nodes = (deploymentHandler.get_nodes({'cluster': cluster}) if cluster is not None @@ -60,20 +77,6 @@ def main(): results.add_to_summary(2, "STATUS", "SUBTEST") results.add_to_summary(0, "=") - installer_type = os.environ.get("INSTALLER_TYPE") - if installer_type != "fuel" and installer_type != "apex": - logger.error( - '\033[91mCurrently supported only Fuel and Apex\033[0m') - sys.exit(1) - - installer_ip = os.environ.get("INSTALLER_IP") - if not installer_ip: - logger.error( - '\033[91minstaller ip is not set\033[0m') - logger.error( - '\033[91mexport INSTALLER_IP=\033[0m') - sys.exit(1) - test_utils.download_image(COMMON_CONFIG.url, COMMON_CONFIG.image_path) _, custom_flv_id = os_utils.get_or_create_flavor( -- cgit 1.2.3-korg