summaryrefslogtreecommitdiffstats
path: root/dovetail/container.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-03-17 09:23:45 +0000
committerxudan <xudan16@huawei.com>2017-03-21 01:34:24 +0000
commitf7d0d72958b41ea6685457abea6dc4d83f4370c3 (patch)
treeff367071b3f2223724ccbc6e34a4174c9a7d233c /dovetail/container.py
parent3cf37c9ac7b40a388f81fed13cfb0ad606dcd9a1 (diff)
dovetail tool: remove installer and CI related variables
JIRA: DOVETAIL-371 1. remove all the envs in functest_config.yml and yardstick_config.yml 2. remove all relative cmds in cmd_config.yml 3. remove all the envs when running a new functest/yardstick container 4. add some variables just for functest pushing results to db 5. get the external network name for yardstick 6. make --debug/-d just control the log level shown on the screen 7. set requests=2.10.0 since python-openstackclient needs 'requests!=2.12.2,!=2.13.0,>=2.10.0' Change-Id: I9f941e09d067fc95a14c3c9be1374f41df4a9a16 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/container.py')
-rw-r--r--dovetail/container.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/dovetail/container.py b/dovetail/container.py
index 4f6975fc..c90ff387 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -45,7 +45,6 @@ class Container(object):
sshkey = "-v /root/.ssh/id_rsa:/root/.ssh/id_rsa "
dovetail_config = dt_cfg.dovetail_config
docker_image = cls.get_docker_image(type)
- envs = dovetail_config[type]['envs']
opts = dovetail_config[type]['opts']
# credentials file openrc.sh is neccessary
@@ -57,6 +56,27 @@ class Container(object):
cls.logger.error("File %s is not exist", dovetail_config['openrc'])
return None
+ # This is used for showing the debug logs of the upstream projects
+ envs = ' -e CI_DEBUG=true'
+
+ # These are all just used by Functest's function push_results_to_db
+ if type.lower() == "functest":
+ ins_type = " -e INSTALLER_TYPE=vendor-specific"
+ scenario = " -e DEPLOY_SCENARIO=default"
+ node = " -e NODE_NAME=default"
+ tag = " -e BUILD_TAG=daily-master-001"
+
+ envs = "%s %s %s %s %s" % (envs, ins_type, scenario, node, tag)
+
+ if type.lower() == "yardstick":
+ ext_net = dt_utils.get_ext_net_name(dovetail_config['openrc'],
+ cls.logger)
+ if ext_net:
+ envs = "%s%s%s" % (envs, " -e EXTERNAL_NETWORK=", ext_net)
+ else:
+ cls.logger.error("Can't find any external network.")
+ return None
+
result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'],
dovetail_config[type]['result']['dir'])
cmd = 'sudo docker run %s %s %s %s %s %s /bin/bash' % \