-
-
-def posca_run(con_dic):
- print("========== run posca system bandwidth ===========")
- test_con_id = 0
- file_config = {}
- data = {}
- rx_pkt_s_a = con_dic['rx_pkt_sizes'].split(',')
- tx_pkt_s_a = con_dic['tx_pkt_sizes'].split(',')
- time_new = time.strftime('%H_%M', time.localtime(time.time()))
- file_config["file_path"] = "/home/opnfv/bottlenecks/testsuites/posca/\
-test_result/factor_system_system_bandwidth_%s.json" % (time_new)
- file_config["test_type"] = "system_bandwidth_biggest"
- data["rx_pkt_sizes"] = rx_pkt_s_a
- data["tx_pkt_sizes"] = tx_pkt_s_a
- print("######test package begin######")
- pkt_reply = system_pkt_bandwidth(
- test_con_id, data, file_config, con_dic)
-
- print("######find system bandwidth######")
- print("rx_msg_size:%d tx_msg_size:%d\n" %
- (pkt_reply["rx_msg_size"], pkt_reply["tx_msg_size"]))
- date_tran = common_script.posca_tran_data(
- con_dic['ES_ip'], file_config["file_path"])
- return True
-
-
-def main():
- if not (args.conf):
- logger.error("Configuration files do not exist for \
- the specified testcases")
- os.exit(-1)
- else:
- testcase_cfg = args.conf
-
- con_str = [
- 'test_ip', 'tool', 'test_time', 'protocol',
- 'tx_pkt_sizes', 'rx_pkt_sizes', 'cpu_load',
- 'latency', 'ES_ip', 'dashboard'
- ]
- starttime = datetime.datetime.now()
- config = ConfigParser.ConfigParser()
- con_dic = common_script.posca_config_read(testcase_cfg, con_str, config)
- posca_env_check()
- posca_run(con_dic)
- endtime = datetime.datetime.now()
- if con_dic["dashboard"] == "y":
- cmd = '/home/opnfv/bottlenecks/testsuites/posca/testcase_dashboard/\
-system_bandwidth.py'
- pargs = [INTERPRETER, cmd]
- print("Begin to establish dashboard, False means already exist.\n")
- sub_result = subprocess.Popen(pargs)
- sub_result.wait()
- print("System Bandwidth testing time : %s" %(endtime - starttime))
- time.sleep(5)
-
-if __name__ == '__main__':
- main()
-