summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2017-03-22 09:18:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-22 09:18:57 +0000
commit9d86d3b50a9617b6042cc8bf3f900c9b0573d888 (patch)
tree88a8e9abbeb2fa4bfd60e1baed128f61353eedc6
parentf7d0d72958b41ea6685457abea6dc4d83f4370c3 (diff)
parenta2ea88b923adba8f6fa0fc5ad92e6ce5e72db775 (diff)
Merge "dovetail tool: Bugfix about the prepare_env of yardstick and get the yardstick.log"
-rw-r--r--dovetail/conf/yardstick_config.yml14
-rw-r--r--dovetail/container.py7
2 files changed, 12 insertions, 9 deletions
diff --git a/dovetail/conf/yardstick_config.yml b/dovetail/conf/yardstick_config.yml
index a70749d9..934cdbdc 100644
--- a/dovetail/conf/yardstick_config.yml
+++ b/dovetail/conf/yardstick_config.yml
@@ -4,20 +4,20 @@ yardstick:
docker_tag: latest
opts: '-id --privileged=true'
pre_condition:
- - 'source /home/opnfv/repos/yardstick/tests/ci/prepare_env.sh &&
- source /home/opnfv/repos/yardstick/tests/ci/clean_images.sh && cleanup'
- - 'source /home/opnfv/repos/yardstick/tests/ci/prepare_env.sh &&
- cd /home/opnfv/repos/yardstick && source tests/ci/load_images.sh'
+ - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
+ source tests/ci/clean_images.sh && cleanup'
+ - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
+ source tests/ci/load_images.sh'
cmds:
- 'mkdir -p /home/opnfv/yardstick/results/'
- 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
- yardstick task start tests/opnfv/test_cases/{{validate_testcase}}.yaml
- --output-file /home/opnfv/yardstick/results/{{validate_testcase}}.out &>
- /home/opnfv/yardstick/results/yardstick.log'
+ yardstick -d task start tests/opnfv/test_cases/{{validate_testcase}}.yaml
+ --output-file /home/opnfv/yardstick/results/{{validate_testcase}}.out'
post_condition:
- ''
result:
dir: '/home/opnfv/yardstick/results'
+ log: '/tmp/yardstick'
store_type: 'file'
file_path: 'yardstick.log'
db_url: 'http://testresults.opnfv.org/test/api/v1/results?case=%s&last=1'
diff --git a/dovetail/container.py b/dovetail/container.py
index c90ff387..6d5a8d4f 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -79,8 +79,11 @@ class Container(object):
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' % \
- (opts, envs, sshkey, openrc, result_volume, docker_image)
+ log_volume = ' -v %s:%s ' % (dovetail_config['result_dir'],
+ dovetail_config[type]['result']['log'])
+ cmd = 'sudo docker run %s %s %s %s %s %s %s /bin/bash' % \
+ (opts, envs, sshkey, openrc, result_volume,
+ log_volume, docker_image)
dt_utils.exec_cmd(cmd, cls.logger)
ret, container_id = \
dt_utils.exec_cmd("sudo docker ps | grep " + docker_image +