From 0a29e9ec59e21dc46db0497187cc9d0de0844b05 Mon Sep 17 00:00:00 2001 From: liyin Date: Tue, 7 Feb 2017 15:29:50 +0800 Subject: Log_dir bug fix&Add function of test_ip init JIRA:BOTTLENECK-129 This patch fix the error of log_dir can't be found. And change several thing: 1.Add if config don't have test_ip, it will use local:8888 as test ip. 2.Fix the bug in setup.py. 3.Add parser init to logger file. Change-Id: I808c69e2b2ff3c04f271cc7f3e14e1ab406a4d1b Signed-off-by: liyin --- testsuites/posca/__init__.py | 1 - testsuites/posca/run_posca.py | 11 ++--------- .../testcase_script/posca_factor_system_bandwidth.py | 17 ++++++----------- 3 files changed, 8 insertions(+), 21 deletions(-) (limited to 'testsuites') diff --git a/testsuites/posca/__init__.py b/testsuites/posca/__init__.py index efcda782..b124dfa9 100644 --- a/testsuites/posca/__init__.py +++ b/testsuites/posca/__init__.py @@ -6,4 +6,3 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - diff --git a/testsuites/posca/run_posca.py b/testsuites/posca/run_posca.py index fcf35d5b..a687e00e 100755 --- a/testsuites/posca/run_posca.py +++ b/testsuites/posca/run_posca.py @@ -39,15 +39,9 @@ def posca_run(test_level, test_name): elif test_level == "teststory": config = conf_parser.Parser.story_read("posca", test_name) for testcase in config: - print(config[testcase]) + LOG.info("Begin to run %s testcase in POSCA testsuite", testcase) posca_testcase_run(testcase, config[testcase]) - if con_dic["dashboard"] == "y": - cmd = '/home/opnfv/bottlenecks/testsuites/posca/testcase_dashboard/\ -system_bandwidth.py' - pargs = [INTERPRETER, cmd] - LOG.info("\nBegin to establish dashboard.") - sub_result = subprocess.Popen(pargs) - sub_result.wait() + LOG.info("End of %s testcase in POSCA testsuite", testcase) def main(): @@ -58,4 +52,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py b/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py index ed4de180..aebfa962 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", @@ -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,9 @@ 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") for test_x in data["tx_pkt_sizes"]: data_max["throughput"] = 1 bandwidth_tmp = 1 @@ -88,12 +92,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() - -- cgit 1.2.3-korg