X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Finfra_setup%2Frunner%2Fyardstick.py;h=35b89ae8cfd9695c7a36a394510c4059af3ee7f9;hb=1e67766fca7b8535cc84a19c7391dee1afd33d59;hp=7c8cd2551bb170030636e3fb0ff78b9dcb411236;hpb=cb7f830d3e4a2a5665ff95687838c80a353687bf;p=bottlenecks.git diff --git a/utils/infra_setup/runner/yardstick.py b/utils/infra_setup/runner/yardstick.py index 7c8cd255..35b89ae8 100644 --- a/utils/infra_setup/runner/yardstick.py +++ b/utils/infra_setup/runner/yardstick.py @@ -33,7 +33,7 @@ def Get_Reply(test_config, task_id, time_test=1): if reply_data["status"] == 1: return(reply_data["result"]) if reply_data["status"] == 0: - if time_test == 10: + if time_test == 100: LOG.info("yardstick time out") sys.exit() time.sleep(10) @@ -64,11 +64,28 @@ def Create_Incluxdb(con_dic): 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): @@ -77,4 +94,3 @@ def find_condition(con_dic): requests.post( base_url, headers=headers) LOG.info("check for creating InfluxDB") -