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))
test_dict = {
"action": "createInfluxDBContainer",
}
- requests.post(
+ responce = requests.post(
base_url, data=json.dumps(test_dict), headers=headers)
+ ask_data = json.loads(responce.text)
+ task_id = ask_data["result"]["task_id"]
LOG.info("waiting for creating InfluxDB")
time.sleep(30)
- LOG.info("Done, creating InflxDB Container")
+ return task_id
+
+
+def yardstick_env_prepare(con_dic):
+ base_url = ("http://%s/yardstick/env/action"
+ % (con_dic['yardstick_test_ip']))
+ test_dict = {
+ "action": "prepareYardstickEnv",
+ }
+ LOG.info("waiting for yardstick environment prepare")
+ reponse = requests.post(
+ base_url, data=json.dumps(test_dict), headers=headers)
+ ask_data = json.loads(reponse.text)
+ task_id = ask_data["result"]["task_id"]
+ LOG.info("Done, yardstick environment prepare complete!")
+ return task_id
def find_condition(con_dic):