summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/env_prepare/stack_prepare.py2
-rw-r--r--utils/infra_setup/runner/docker_env.py3
-rw-r--r--utils/infra_setup/runner/yardstick.py12
-rw-r--r--utils/parser.py9
4 files changed, 23 insertions, 3 deletions
diff --git a/utils/env_prepare/stack_prepare.py b/utils/env_prepare/stack_prepare.py
index c7dae390..5de6218f 100644
--- a/utils/env_prepare/stack_prepare.py
+++ b/utils/env_prepare/stack_prepare.py
@@ -44,7 +44,7 @@ def _prepare_env_daemon(test_yardstick):
file_after)
docker_env.docker_exec_cmd(yardstick_contain,
cmd)
- cmd = "sed -i '12s/http/file/g' /etc/yardstick/yardstick.conf"
+ cmd = "sed -i '13s/http/file/g' /etc/yardstick/yardstick.conf"
docker_env.docker_exec_cmd(yardstick_contain,
cmd)
diff --git a/utils/infra_setup/runner/docker_env.py b/utils/infra_setup/runner/docker_env.py
index 64d049ba..6e9c78a0 100644
--- a/utils/infra_setup/runner/docker_env.py
+++ b/utils/infra_setup/runner/docker_env.py
@@ -46,8 +46,7 @@ def env_yardstick(docker_name):
yardstick_tag = os.getenv("Yardstick_TAG")
if yardstick_tag is None:
yardstick_tag = "danube.3.1"
- env_docker = client.containers.run(image="opnfv/yardstick:%s"
- % yardstick_tag,
+ env_docker = client.containers.run(image="yardstick_pmd",
privileged=True,
tty=True,
detach=True,
diff --git a/utils/infra_setup/runner/yardstick.py b/utils/infra_setup/runner/yardstick.py
index 35b89ae8..559b9c10 100644
--- a/utils/infra_setup/runner/yardstick.py
+++ b/utils/infra_setup/runner/yardstick.py
@@ -24,6 +24,18 @@ headers = {"Content-Type": "application/json"}
LOG = logger.Logger(__name__).getLogger()
+def yardstick_command_parser(debug, cidr, outfile, parameter):
+ cmd = "yardstick"
+ if debug:
+ cmd += " -d"
+ cmd += " task start "
+ cmd += str(cidr)
+ cmd += " --output-file " + outfile
+ if parameter is not None:
+ cmd += " --task-args " + '"' + str(parameter) + '"'
+ return cmd
+
+
def Get_Reply(test_config, task_id, time_test=1):
reply_url = ("http://%s/yardstick/results?task_id=%s"
% (test_config['yardstick_test_ip'], task_id))
diff --git a/utils/parser.py b/utils/parser.py
index ecd6badd..b46a3b91 100644
--- a/utils/parser.py
+++ b/utils/parser.py
@@ -127,6 +127,15 @@ class Parser():
f.write(json.dumps(data, f))
f.write("\n")
+ @staticmethod
+ def str_to_list(str_org):
+ try:
+ data = str_org.split(',')
+ except AttributeError:
+ data = []
+ data.append(str_org)
+ return data
+
class HeatTemplate_Parser():
"""parser a Heat template and a method to deploy template to a stack"""