posca test suite urls change 99/25299/2
authorliyin <liyin11@huawei.com>
Thu, 1 Dec 2016 04:38:38 +0000 (12:38 +0800)
committerAce Lee <liyin11@huawei.com>
Thu, 1 Dec 2016 06:07:47 +0000 (06:07 +0000)
JIRA: BOTTLENECK-111

This patch add two functions to bottlenecks project:
1.change yardstick urls and some return value.
2.bottlenecks project wait time change.

Change-Id: I1a7f98f69676cda8cb0dc62276704c2cfcf240d8
Signed-off-by: liyin <liyin11@huawei.com>
testsuites/posca/testcase_cfg/posca_factor_system_bandwidth.yaml
testsuites/posca/testcase_script/common_script.py

index 113997c..8235d5b 100755 (executable)
@@ -1,11 +1,11 @@
 [config]\r
-test_ip: 192.168.23.2:8888\r
+test_ip:\r
+dashboard: y\r
+ES_ip:\r
 tool: netperf\r
 protocol: tcp\r
-test_time: 30\r
-tx pkt sizes: 8, 16, 32, 64, 128, 256, 512, 1024\r
-rx pkt sizes: 8, 16, 32, 64, 128, 256, 512, 1024\r
-tx cache sizes: 2304, 4608, 9216, 18432, 32768, 65536\r
-rx cache sizes: 1152, 2304, 4608, 9216, 18432, 32768, 65536, 131072\r
-cpu load: 0.9\r
+test_time: 60\r
+tx_pkt_sizes: 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072\r
+rx_pkt_sizes: 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072\r
+cpu_load: 0.9\r
 latency: 100000\r
index 6d5c893..b9954a7 100644 (file)
@@ -46,7 +46,7 @@ def posca_config_read(config_str, con_str, config):
     with IPDB() as ip:
         GATEWAY_IP = ip.routes['default'].gateway
     if str(con_dic["test_ip"]) is "":
-        con_dic["test_ip"] = GATEWAY_IP+":3333"
+        con_dic["test_ip"] = GATEWAY_IP+":8888"
         print("test_ip is null get local ip is %s" %(con_dic["test_ip"]))
     if con_dic["ES_ip"] is "":
         con_dic["ES_ip"] = GATEWAY_IP+":9200"
@@ -76,7 +76,7 @@ def posca_output_result(file_config, data_reply):
 
 
 def posca_get_reply(con_dic, task_id, time_test=1):
-    reply_url = "http://%s/yardstick/result/action?action=getResult&task_id=%s\
+    reply_url = "http://%s/yardstick/results?action=getResult&task_id=%s\
 &measurement=tc100" % (con_dic["test_ip"], task_id)
     time.sleep(float(con_dic["test_time"]))
     reply_response = requests.get(reply_url)
@@ -85,7 +85,7 @@ def posca_get_reply(con_dic, task_id, time_test=1):
     if reply_data["status"] == 1:
         return(reply_data["result"][0])
     if reply_data["status"] == 0:
-        if time_test == 3:
+        if time_test == 10:
             print("yardstick time out")
             sys.exit()
         posca_get_reply(con_dic, task_id, time_test=time_test+1)
@@ -93,8 +93,9 @@ def posca_get_reply(con_dic, task_id, time_test=1):
         print("yardstick error exit")
         sys.exit()
 
+
 def posca_send_data(con_dic, test_config, file_config):
-    base_url = "http://%s/yardstick/test/action" % (con_dic['test_ip'])
+    base_url = "http://%s/yardstick/testcases/release/action" % (con_dic['test_ip'])
     print(con_dic["test_ip"])
     test_dict = {
             "action":"runTestCase",
@@ -111,11 +112,11 @@ def posca_send_data(con_dic, test_config, file_config):
                  "testcase":"tc100"
             }
     }
-    # print(base_url)
     reponse = requests.post(
                         base_url, data=json.dumps(test_dict), headers=headers)
     ask_data = json.loads(reponse.text)
-    task_id = ask_data["task_id"]
+    task_id = ask_data["result"]
+    print(task_id)
     data_reply = posca_get_reply(con_dic, task_id)
     data_reply.update(test_config)
     posca_output_result(file_config, data_reply)
@@ -129,3 +130,4 @@ def posca_create_incluxdb(con_dic):
     }
     reponse = requests.post(
                         base_url, data=json.dumps(test_dict), headers=headers)
+