- for test_pkt_s_e in test_pkt_s_a:
- print "Package size %s"%(test_pkt_s_e)
- order_excute = os.popen("%s %s http://%s/api/v3/yardstick/tasks/task %s %s %s %s"%(cmd,order_arg,con_dic['test_ip'],con_dic['test_rx_flavor'],con_dic['test_tx_flavor'],test_pkt_s_e,test_pkt_s_e))
- order_result = order_excute.read()
- test_id = order_result.find("task_id")
- time.sleep(con_dic['test_time'])
- cmd_excute = os.popen( "%s http://%s/api/v3/yardstick/testresults?task_id=%s"%(cmd,con_dic['test_ip'],test_id))
- test_result = cmd_excute.read()
- bandwidth = test_result.find("bandwidth")
- cpu_load = test_result.find("cpu_load")
- latency = test_result.find("latency")
- posca_output_result(time_new,test_pkt_s_e,con_dic['test_rx_cache_s'],con_dic['test_tx_cache_s'])
- if (bandwidth < con_dic['test_throughput']) and (latency < con_dic['test_latency']):
- if cpu_load > con_dic['test_cpu_load']:
- return True
- else:
- print "%s,%s,%s"%(bandwidth,latency,cpu_load)
- else:
- print "%s,%s,%s"%(bandwidth,latency,cpu_load)
- return False