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.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 6aa39ea9..67b52796 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -14,9 +14,10 @@ import shutil
import opnfv.utils.constants as releng_constants
+from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
-from functest.utils.constants import CONST
+
IMAGE_ID_ALT = None
FLAVOR_ID_ALT = None
@@ -43,16 +44,17 @@ def configure_tempest(logger, deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
"""
Add/update needed parameters into tempest.conf file generated by Rally
"""
- tempest_conf_file = deployment_dir + "/tempest.conf"
+ tempest_conf_file = os.path.join(deployment_dir, "tempest.conf")
if os.path.isfile(tempest_conf_file):
- logger.debug("Deleting old tempest.conf file...")
- os.remove(tempest_conf_file)
-
- logger.debug("Generating new tempest.conf file...")
- cmd = "rally verify genconfig"
+ logger.debug("Verifier is already configured.")
+ logger.debug("Reconfiguring the current verifier...")
+ cmd = "rally verify configure-verifier --reconfigure"
+ else:
+ logger.info("Configuring the verifier...")
+ cmd = "rally verify configure-verifier"
ft_utils.execute_command(cmd)
- logger.debug("Finding tempest.conf file...")
+ logger.debug("Looking for tempest.conf file...")
if not os.path.isfile(tempest_conf_file):
logger.error("Tempest configuration file %s NOT found."
% tempest_conf_file)
@@ -100,8 +102,8 @@ def configure_tempest(logger, deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
config.write(config_file)
# Copy tempest.conf to /home/opnfv/functest/results/tempest/
- shutil.copyfile(
- tempest_conf_file, TEMPEST_RESULTS_DIR + '/tempest.conf')
+ shutil.copyfile(tempest_conf_file,
+ os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
return releng_constants.EXIT_OK
@@ -114,7 +116,7 @@ def configure_tempest_multisite(logger, deployment_dir):
configure_tempest(logger, deployment_dir)
logger.debug("Finding tempest.conf file...")
- tempest_conf_old = os.path.join(deployment_dir, '/tempest.conf')
+ tempest_conf_old = os.path.join(deployment_dir, 'tempest.conf')
if not os.path.isfile(tempest_conf_old):
logger.error("Tempest configuration file %s NOT found."
% tempest_conf_old)
@@ -122,7 +124,7 @@ def configure_tempest_multisite(logger, deployment_dir):
# Copy tempest.conf to /home/opnfv/functest/results/tempest/
cur_path = os.path.split(os.path.realpath(__file__))[0]
- tempest_conf_file = os.path.join(cur_path, '/tempest_multisite.conf')
+ tempest_conf_file = os.path.join(cur_path, 'tempest_multisite.conf')
shutil.copyfile(tempest_conf_old, tempest_conf_file)
logger.debug("Updating selected tempest.conf parameters...")