diff options
author | Leo wang <grakiss.wanglei@huawei.com> | 2017-07-21 01:18:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-21 01:18:39 +0000 |
commit | 610c7a9669a80b794611a54ff41829a6fe95d8b9 (patch) | |
tree | 64a12b3883eb8a54153d5240b8d8280c2ab9ffa6 | |
parent | 7c786e5f7815dc7d1ba8259e0a9d4acc0981bfd4 (diff) | |
parent | edfeb16010541d7d8b9188991aae4fb97c2d883d (diff) |
Merge "Adapt Yardstick to copy yardstick.conf to /etc/yardstick"
-rw-r--r-- | dovetail/conf/cmd_config.yml | 2 | ||||
-rw-r--r-- | dovetail/conf/yardstick_config.yml | 3 | ||||
-rw-r--r-- | dovetail/container.py | 29 |
3 files changed, 25 insertions, 9 deletions
diff --git a/dovetail/conf/cmd_config.yml b/dovetail/conf/cmd_config.yml index aa27f293..a5b262d1 100644 --- a/dovetail/conf/cmd_config.yml +++ b/dovetail/conf/cmd_config.yml @@ -50,7 +50,7 @@ cli: flags: - '--report' - '-r' - help: 'push results to DB (e.g. --report http://192.168.135.2:8000/api/v1)' + help: 'push results to DB (e.g. --report http://192.168.135.2:8000/api/v1/results)' offline: flags: - '--offline' diff --git a/dovetail/conf/yardstick_config.yml b/dovetail/conf/yardstick_config.yml index 86a768d5..56ad75a5 100644 --- a/dovetail/conf/yardstick_config.yml +++ b/dovetail/conf/yardstick_config.yml @@ -25,3 +25,6 @@ yardstick: file_path: 'yardstick.log' key_path: '/root/.ssh/id_rsa' openrc: '/etc/yardstick/openstack.creds' + yard_conf: + src_file: '/home/opnfv/repos/yardstick/etc/yardstick/yardstick.conf.sample' + dest_file: '/etc/yardstick/yardstick.conf' diff --git a/dovetail/container.py b/dovetail/container.py index 2108cdc1..c8a84eb3 100644 --- a/dovetail/container.py +++ b/dovetail/container.py @@ -76,8 +76,7 @@ class Container(object): if 'sdnvpn' in testcase_name: ins_type = "-e INSTALLER_TYPE=netvirt" scenario = " -e DEPLOY_SCENARIO=bgpvpn" - node = " -e NODE_NAME=master" - envs = "%s %s %s" % (ins_type, scenario, node) + envs = "%s %s" % (ins_type, scenario) dovetail_config = dt_cfg.dovetail_config if dovetail_config['report_dest'].startswith("http"): @@ -103,11 +102,6 @@ class Container(object): cls.logger.error("Can't find any external network.") return None - if dovetail_config['report_dest'].startswith("http"): - envs = envs + " -e DISPATCHER=http" - envs = envs + " -e TARGET=%s" % dovetail_config['report_dest'] - envs = envs + " -e NODE_NAME=master" - log_vol = '-v %s:%s ' % (dovetail_config['result_dir'], dovetail_config["yardstick"]['result']['log']) @@ -141,7 +135,7 @@ class Container(object): # CI_DEBUG is used for showing the debug logs of the upstream projects # BUILD_TAG is the unique id for this test - envs = ' -e CI_DEBUG=true' + envs = ' -e CI_DEBUG=true -e NODE_NAME=master' envs = envs + ' -e BUILD_TAG=%s-%s' % (dovetail_config['build_tag'], testcase_name) @@ -212,6 +206,10 @@ class Container(object): src_path = os.path.join(prefix_path, 'pre_config', file_name) dest_path = '/home/opnfv/functest/images' Container.pre_copy(container_id, src_path, dest_path) + + if type.lower() == 'yardstick': + cls.set_yardstick_conf_file(container_id) + return container_id @classmethod @@ -306,3 +304,18 @@ class Container(object): return (1, 'src_path or dest_path is empty') cmd = 'cp %s %s' % (src_path, dest_path) return cls.exec_cmd(container_id, cmd, exit_on_error) + + @classmethod + def set_yardstick_conf_file(cls, container_id): + valid_type = 'yardstick' + src = dt_cfg.dovetail_config[valid_type]['yard_conf']['src_file'] + dest = dt_cfg.dovetail_config[valid_type]['yard_conf']['dest_file'] + cls.pre_copy(container_id, src, dest) + url = dt_cfg.dovetail_config['report_dest'] + if url.startswith("http"): + cmd = ("sed -i '16s#http://127.0.0.1:8000/results#{}#g' {}" + .format(url, dest)) + cls.exec_cmd(container_id, cmd) + if url.lower() == 'file': + cmd = ("sed -i '12s/http/file/g' {}".format(dest)) + cls.exec_cmd(container_id, cmd) |