Merge "Bug fix: yardstick result return no content"
authorYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>
Mon, 13 Feb 2017 07:05:05 +0000 (07:05 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 13 Feb 2017 07:05:05 +0000 (07:05 +0000)
1  2 
testsuites/posca/testcase_script/posca_factor_system_bandwidth.py

@@@ -33,8 -33,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):
      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
  
  
@@@ -64,7 -68,6 +68,7 @@@ def run(con_dic)
      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