X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=testsuites%2Fposca%2Ftestcase_script%2Fposca_factor_system_bandwidth.py;h=54e2970b407485ffdabadd69cd99d59ce64f0b38;hb=9038727dee2e67f8facd75f8b498ca20a1e066c9;hp=ed4de180018157a4dfdbd7ea69647bac9308cee0;hpb=cb7f830d3e4a2a5665ff95687838c80a353687bf;p=bottlenecks.git diff --git a/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py b/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py index ed4de180..54e2970b 100644 --- a/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py +++ b/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py @@ -16,10 +16,11 @@ import os import time import utils.logger as log import utils.infra_setup.runner.yardstick as Runner +from utils.parser import Parser as conf_parser # -------------------------------------------------- # logging configuration # -------------------------------------------------- -LOG = log.Logger(__name__) +LOG = log.Logger(__name__).getLogger() test_dict = { "action": "runTestCase", @@ -32,8 +33,8 @@ test_dict = { } -def env_pre(): - Runner.Create_Incluxdb() +def env_pre(con_dic): + Runner.Create_Incluxdb(con_dic['runner_config']) def do_test(test_config, con_dic): @@ -41,7 +42,7 @@ def do_test(test_config, con_dic): Task_id = Runner.Send_Data(test_dict, con_dic['runner_config']) time.sleep(con_dic['test_config']['test_time']) Data_Reply = Runner.Get_Reply(con_dic['runner_config'], Task_id) - test_date = Data_Reply[con_dic['runner_config']['testcase']][0] + test_date = Data_Reply[con_dic['runner_config']['yardstick_testcase']][0] return test_date @@ -60,6 +61,10 @@ def run(con_dic): data_return = {} data_max = {} data_return["throughput"] = 1 + if con_dic["runner_config"]["yardstick_test_ip"] is None: + con_dic["runner_config"]["yardstick_test_ip"] =\ + conf_parser.ip_parser("yardstick_test_ip") + env_pre(con_dic) for test_x in data["tx_pkt_sizes"]: data_max["throughput"] = 1 bandwidth_tmp = 1 @@ -88,12 +93,3 @@ def run(con_dic): pre_role_result = cur_role_result print("date_id is %d,id return success\n" % date_id) return data_return - - -def main(): - run(con_dic) - - -if __name__ == '__main__': - main() -