From: liyin Date: Thu, 9 Feb 2017 09:59:09 +0000 (+0800) Subject: Bug fix: yardstick result return no content X-Git-Tag: danube.1.RC1~20^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=bottlenecks.git;a=commitdiff_plain;h=78e069921d27d6ee916e8a037118c4e318ea8081 Bug fix: yardstick result return no content JIRA:BOTTLENECK-130 this patch will fix this bug: we try to expect this error, And we try to run it again. if failed, then yardstick RestAPI or have some error. Change-Id: I9fa63da637456a16c151f4fe7c566b3f5ff0e01d Signed-off-by: liyin --- diff --git a/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py b/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py index aebfa962..488f36d5 100644 --- a/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py +++ b/testsuites/posca/testcase_script/posca_factor_system_bandwidth.py @@ -42,7 +42,11 @@ 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']['yardstick_testcase']][0] + try: + test_date =\ + Data_Reply[con_dic['runner_config']['yardstick_testcase']][0] + except IndexError: + test_date = do_test(test_config, con_dic) return test_date