aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/conf_utils.py
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2017-03-08 15:39:49 +0200
committerJuha Kosonen <juha.kosonen@nokia.com>2017-03-09 06:51:53 +0000
commit961aa0b046824b21c73a2ef7386c78e3425325bb (patch)
tree28e9db40134ed9664121e66fa18df99009d36748 /functest/opnfv_tests/openstack/tempest/conf_utils.py
parent68dbfb326dbfa6086ebfd36736250021b20ed5f7 (diff)
Install kingbird verifier extension for tempest
JIRA: FUNCTEST-742 Change-Id: I5de8ed22932250c542751e38eae3185c4a263cd0 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 893fff8c..2c113367 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -106,6 +106,17 @@ def get_verifier_deployment_dir(verifier_id, deployment_id):
'for-deployment-{}'.format(deployment_id))
+def get_repo_tag(repo):
+ """
+ Returns last tag of current branch
+ """
+ cmd = ("git -C {0} describe --abbrev=0 HEAD".format(repo))
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+ tag = p.stdout.readline().rstrip()
+
+ return str(tag)
+
+
def backup_tempest_config(conf_file):
"""
Copy config file to tempest results directory
@@ -276,3 +287,16 @@ def configure_tempest_multisite_params(tempest_conf_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)