aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/conf_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py93
1 files changed, 0 insertions, 93 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 7c88fc5d..975f2bdc 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -11,7 +11,6 @@ import ConfigParser
import logging
import os
import pkg_resources
-import re
import shutil
import subprocess
@@ -231,8 +230,6 @@ def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None,
conf_file = configure_verifier(deployment_dir)
configure_tempest_update_params(conf_file,
IMAGE_ID, FLAVOR_ID)
- if MODE == 'feature_multisite':
- configure_tempest_multisite_params(conf_file)
def configure_tempest_defcore(deployment_dir, img_flavor_dict):
@@ -373,93 +370,3 @@ def configure_verifier(deployment_dir):
% tempest_conf_file)
else:
return tempest_conf_file
-
-
-def configure_tempest_multisite_params(tempest_conf_file):
- """
- Add/update multisite parameters into tempest.conf file generated by Rally
- """
- logger.debug("Updating multisite tempest.conf parameters...")
- config = ConfigParser.RawConfigParser()
- config.read(tempest_conf_file)
-
- config.set('service_available', 'kingbird', 'true')
- # cmd = ("openstack endpoint show kingbird | grep publicurl |"
- # "awk '{print $4}' | awk -F '/' '{print $4}'")
- # kingbird_api_version = os.popen(cmd).read()
- # kingbird_api_version = os_utils.get_endpoint(service_type='multisite')
-
- if CI_INSTALLER_TYPE == 'fuel':
- # For MOS based setup, the service is accessible
- # via bind host
- kingbird_conf_path = "/etc/kingbird/kingbird.conf"
- installer_type = CI_INSTALLER_TYPE
- installer_ip = CI_INSTALLER_IP
- installer_username = CONST.__getattribute__(
- 'multisite_{}_installer_username'.format(installer_type))
- installer_password = CONST.__getattribute__(
- 'multisite_{}_installer_password'.format(installer_type))
-
- ssh_options = ("-o UserKnownHostsFile=/dev/null -o "
- "StrictHostKeyChecking=no")
-
- # Get the controller IP from the fuel node
- cmd = ('sshpass -p %s ssh 2>/dev/null %s %s@%s '
- '\'fuel node --env 1| grep controller | grep "True\| 1" '
- '| awk -F\| "{print \$5}"\'' % (installer_password,
- ssh_options,
- installer_username,
- installer_ip))
- multisite_controller_ip = "".join(os.popen(cmd).read().split())
-
- # Login to controller and get bind host details
- cmd = ('sshpass -p %s ssh 2>/dev/null %s %s@%s "ssh %s \\" '
- 'grep -e "^bind_" %s \\""' % (installer_password,
- ssh_options,
- installer_username,
- installer_ip,
- multisite_controller_ip,
- kingbird_conf_path))
- bind_details = os.popen(cmd).read()
- bind_details = "".join(bind_details.split())
- # Extract port number from the bind details
- bind_port = re.findall(r"\D(\d{4})", bind_details)[0]
- # Extract ip address from the bind details
- bind_host = re.findall(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}",
- bind_details)[0]
- kingbird_endpoint_url = "http://%s:%s/" % (bind_host, bind_port)
- else:
- # cmd = "openstack endpoint show kingbird | grep publicurl |\
- # awk '{print $4}' | awk -F '/' '{print $3}'"
- # kingbird_endpoint_url = os.popen(cmd).read()
- kingbird_endpoint_url = os_utils.get_endpoint(service_type='kingbird')
-
- try:
- config.add_section("kingbird")
- except Exception:
- logger.info('kingbird section exist')
-
- # set the domain id
- config.set('auth', 'admin_domain_name', 'default')
-
- config.set('kingbird', 'endpoint_type', 'publicURL')
- config.set('kingbird', 'TIME_TO_SYNC', '120')
- config.set('kingbird', 'endpoint_url', kingbird_endpoint_url)
- config.set('kingbird', 'api_version', 'v1.0')
- with open(tempest_conf_file, 'wb') as config_file:
- config.write(config_file)
-
- backup_tempest_config(tempest_conf_file)
-
-
-def install_verifier_ext(path):
- """
- Install extension to active verifier
- """
- logger.info("Installing verifier from existing repo...")
- tag = get_repo_tag(path)
- cmd = ("rally verify add-verifier-ext --source {0} "
- "--version {1}"
- .format(path, tag))
- error_msg = ("Problem while adding verifier extension from %s" % path)
- ft_utils.execute_command_raise(cmd, error_msg=error_msg)