Bug fix: yardstick result return no content 57/28357/1
authorliyin <liyin11@huawei.com>
Thu, 9 Feb 2017 09:59:09 +0000 (17:59 +0800)
committerliyin <liyin11@huawei.com>
Thu, 9 Feb 2017 10:11:03 +0000 (18:11 +0800)
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 <liyin11@huawei.com>
testsuites/posca/testcase_script/posca_factor_system_bandwidth.py

index aebfa96..488f36d 100644 (file)
@@ -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