summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/runner/yardstick.py
diff options
context:
space:
mode:
authorYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>2018-03-12 02:51:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-12 02:51:26 +0000
commit75bf3ebba105798ce450b321a5d770fcee985896 (patch)
treef06384343e86d96e6b25bf99df07eea14d280c1e /utils/infra_setup/runner/yardstick.py
parent952db3aa4d1fe889c524d1d70bde0479e638f53e (diff)
parentadf6a02bae295455f584ebab762592dd57e2422c (diff)
Merge "bottlenecks offiline support"
Diffstat (limited to 'utils/infra_setup/runner/yardstick.py')
-rw-r--r--utils/infra_setup/runner/yardstick.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/infra_setup/runner/yardstick.py b/utils/infra_setup/runner/yardstick.py
index 559b9c10..616bcc52 100644
--- a/utils/infra_setup/runner/yardstick.py
+++ b/utils/infra_setup/runner/yardstick.py
@@ -15,15 +15,27 @@ At present, This file contain the following function:
4.how the process of task.'''
import sys
+import os
import time
import requests
import json
+import urllib
import utils.logger as logger
+from utils.parser import Parser as config
+import utils.env_prepare.stack_prepare as env
headers = {"Content-Type": "application/json"}
LOG = logger.Logger(__name__).getLogger()
+def yardstick_image_prepare():
+ if not os.path.exists(config.bottlenecks_config["yardstick_image_dir"]):
+ urllib.urlretrieve(config.bottlenecks_config["image_url"],
+ config.bottlenecks_config["yardstick_image_dir"])
+ env.prepare_image(config.bottlenecks_config["yardstick_image_name"],
+ config.bottlenecks_config["yardstick_image_dir"])
+
+
def yardstick_command_parser(debug, cidr, outfile, parameter):
cmd = "yardstick"
if debug:
@@ -31,6 +43,9 @@ def yardstick_command_parser(debug, cidr, outfile, parameter):
cmd += " task start "
cmd += str(cidr)
cmd += " --output-file " + outfile
+ image_name = config.bottlenecks_config["yardstick_image_name"]
+ parameter["image_name"] = image_name
+ print parameter
if parameter is not None:
cmd += " --task-args " + '"' + str(parameter) + '"'
return cmd