def do_test(con_dic): out_file = ("/tmp/yardstick_" + str(uuid.uuid4()) + ".out") parameter_info = dict(test_time=con_dic["scenarios"]["vim_pair_ttl"]) yardstick_container = docker_env.yardstick_info['container'] cmd = runner_yardstick.yardstick_command_parser(debug=runner_DEBUG, cidr=cidr, outfile=out_file, parameter=parameter_info) stdout = docker_env.docker_exec_cmd(yardstick_container, cmd) LOG.info(stdout) out_value = 0 loop_value = 0 while loop_value < 60: time.sleep(2) loop_value = loop_value + 1 with open(out_file) as f: data = json.load(f) if data["result"]["criteria"] == "PASS": LOG.info("Success run yardstick netperf_soak test!") out_value = 1 break elif data["result"]["criteria"] == "FAIL": LOG.error("Failed run yardstick netperf_soak test!") out_value = 0 break q.put((out_value, data["result"]["testcases"])) return out_value
def do_test(): func_name = sys._getframe().f_code.co_name out_file = ("/tmp/yardstick_" + str(uuid.uuid4()) + ".out") parameter_info = {} yardstick_container = docker_env.yardstick_info['container'] cmd = runner_yardstick.yardstick_command_parser(debug=runner_DEBUG, cidr=cidr, outfile=out_file, parameter=parameter_info) stdout = docker_env.docker_exec_cmd(yardstick_container, cmd) LOG.info(stdout) out_value = 0 loop_value = 0 while loop_value < 60: time.sleep(2) loop_value = loop_value + 1 with open(out_file) as f: data = json.load(f) if data["result"]["criteria"] == "PASS": LOG.info("yardstick run success") out_value = 1 break else: LOG.error("yardstick error exit") out_value = 0 break q.put((out_value, func_name)) return out_value
def testcase_parser(runner_conf, out_file="yardstick.out", **parameter_info): cidr = "/home/opnfv/repos/yardstick/" + \ runner_conf["yardstick_test_dir"] + "/" + \ runner_conf["yardstick_testcase"] + ".yaml" cmd = yardstick_task.yardstick_command_parser(debug=runner_DEBUG, cidr=cidr, outfile=out_file, parameter=parameter_info) return cmd
def testcase_parser(out_file="yardstick.out", **parameter_info): cmd = yardstick_task.yardstick_command_parser(debug=runner_DEBUG, cidr=cidr, outfile=out_file, parameter=parameter_info) return cmd