summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Wang <grakiss.wanglei@huawei.com>2016-12-16 02:19:28 -0500
committerLeo Wang <grakiss.wanglei@huawei.com>2016-12-18 19:54:20 -0500
commit976a73d10622aff8e3b26fb01b43be7a72318856 (patch)
tree6758c336d3c6386901b76d134969ffcf2dd02bca
parent18ed566c5e1a379d5b87d3838dea82a9481ba61b (diff)
[dovetail tool] fetch openstack rc files without installer info
JIRA: DOVETAIL-157 dovetail tool must not depend on any installers or any SUT, so openstack rc files need to be provided to eliminate this dependency. 1. input parameters "SUT_IP"/"SUT_TYPE" must be optional, may be finally will be removed 2. new parameter "creds" to specify the file used to get access to openstack of SUT Change-Id: I877efb2a6abc198c32ed6d52b9418a35597d5867 Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
-rw-r--r--dovetail/conf/cmd_config.yml6
-rw-r--r--dovetail/conf/dovetail_config.yml4
-rw-r--r--dovetail/conf/functest_config.yml1
-rw-r--r--dovetail/conf/yardstick_config.yml1
-rw-r--r--dovetail/container.py6
5 files changed, 16 insertions, 2 deletions
diff --git a/dovetail/conf/cmd_config.yml b/dovetail/conf/cmd_config.yml
index e2159ca7..1c6418cb 100644
--- a/dovetail/conf/cmd_config.yml
+++ b/dovetail/conf/cmd_config.yml
@@ -52,6 +52,12 @@ cli:
path:
- 'functest/docker_tag'
help: 'Overwrite tag for functest docker container (e.g. stable or latest)'
+ creds:
+ flags:
+ - '--creds'
+ path:
+ - 'creds'
+ help: 'Openstack Credential file location'
control:
testsuite:
flags:
diff --git a/dovetail/conf/dovetail_config.yml b/dovetail/conf/dovetail_config.yml
index c01394ed..837f8840 100644
--- a/dovetail/conf/dovetail_config.yml
+++ b/dovetail/conf/dovetail_config.yml
@@ -3,6 +3,10 @@ work_dir: /home/opnfv/dovetail
result_dir: /home/opnfv/dovetail/results
report_file: 'dovetail_report.txt'
cli_file_name: 'cmd_config.yml'
+
+# OPENSTACK Credential file
+creds: '/home/opnfv/dovetail/openstack.creds'
+
# TO DO: once version scheme settled, adjust accordingly
repo: 'https://github.com/opnfv/dovetail/tree/master/'
COMPLIANCE_PATH: ./compliance/
diff --git a/dovetail/conf/functest_config.yml b/dovetail/conf/functest_config.yml
index 682d19bf..ceb894b3 100644
--- a/dovetail/conf/functest_config.yml
+++ b/dovetail/conf/functest_config.yml
@@ -17,3 +17,4 @@ functest:
store_type: 'file'
file_path: 'tempest/tempest.log'
db_url: 'http://testresults.opnfv.org/test/api/v1/results?case=%s&last=1'
+ creds: '/home/opnfv/functest/conf/openstack.creds'
diff --git a/dovetail/conf/yardstick_config.yml b/dovetail/conf/yardstick_config.yml
index d13cf2c6..d971c104 100644
--- a/dovetail/conf/yardstick_config.yml
+++ b/dovetail/conf/yardstick_config.yml
@@ -24,3 +24,4 @@ yardstick:
store_type: 'file'
file_path: 'yardstick.log'
db_url: 'http://testresults.opnfv.org/test/api/v1/results?case=%s&last=1'
+ creds: '/home/opnfv/yardstick/openstack.creds'
diff --git a/dovetail/container.py b/dovetail/container.py
index 87174727..3b960c07 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -46,10 +46,12 @@ class Container:
docker_image = cls.get_docker_image(type)
envs = dovetail_config[type]['envs']
opts = dovetail_config[type]['opts']
+ creds = ' -v %s:%s ' % (dovetail_config['creds'],
+ dovetail_config[type]['creds'])
result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'],
dovetail_config[type]['result']['dir'])
- cmd = 'sudo docker run %s %s %s %s %s /bin/bash' % \
- (opts, envs, sshkey, result_volume, docker_image)
+ cmd = 'sudo docker run %s %s %s %s %s %s /bin/bash' % \
+ (opts, envs, sshkey, creds, result_volume, docker_image)
dt_utils.exec_cmd(cmd, cls.logger)
ret, container_id = \
dt_utils.exec_cmd("sudo docker ps | grep " + docker_image +