[dovetail tool] fetch openstack rc files without installer info 83/26083/3
authorLeo Wang <grakiss.wanglei@huawei.com>
Fri, 16 Dec 2016 07:19:28 +0000 (02:19 -0500)
committerLeo Wang <grakiss.wanglei@huawei.com>
Mon, 19 Dec 2016 00:54:20 +0000 (19:54 -0500)
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>
dovetail/conf/cmd_config.yml
dovetail/conf/dovetail_config.yml
dovetail/conf/functest_config.yml
dovetail/conf/yardstick_config.yml
dovetail/container.py

index e2159ca..1c6418c 100644 (file)
@@ -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:
index c01394e..837f884 100644 (file)
@@ -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/
index 682d19b..ceb894b 100644 (file)
@@ -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'
index d13cf2c..d971c10 100644 (file)
@@ -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'
index 8717472..3b960c0 100644 (file)
@@ -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 +