aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/traffic_profile/http_ixload.py
diff options
context:
space:
mode:
authorMyron Sosyak <myronx.sosyak@intel.com>2018-09-19 14:10:57 +0100
committerTaras Chornyi <tarasx.chornyi@intel.com>2018-11-12 09:00:53 +0000
commitd99cfd9eaac88851d7efbb95292c2752755ae070 (patch)
treef20460834e9e1b5c11335c32dd982304b254defd /yardstick/network_services/traffic_profile/http_ixload.py
parent3fec49e7a3926ddf4f9303ee47a33d109421a573 (diff)
Implement functionality for updating http client
Implemented functionality for updating http client configuration. Extended http_ixload.py with functions for update page object and count of simulated users in http client on netTraffic. JIRA: YARDSTICK-1435 Change-Id: I9a0be226d4201d861d3a764864b42e5d87a4a305 Signed-off-by: Myron Sosyak <myronx.sosyak@intel.com> Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile/http_ixload.py')
-rw-r--r--yardstick/network_services/traffic_profile/http_ixload.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/yardstick/network_services/traffic_profile/http_ixload.py b/yardstick/network_services/traffic_profile/http_ixload.py
index 9210f3c6d..c64e7511f 100644
--- a/yardstick/network_services/traffic_profile/http_ixload.py
+++ b/yardstick/network_services/traffic_profile/http_ixload.py
@@ -264,6 +264,57 @@ class IXLOADHttpTest(object):
continue
self.update_network_param(net_traffic, param["ip"])
+ if "uplink" in name:
+ self.update_http_client_param(net_traffic, param["http_client"])
+
+ def update_http_client_param(self, net_traffic, param):
+ """Update http client object in net_traffic
+
+ Update http client object in net_traffic by parameters
+ specified in param.
+ Do not return anything.
+
+ :param net_traffic: (IxLoadObjectProxy) proxy obj to tcl net_traffic object
+ :param param: (dict) http_client section from traffic profile
+ :return:
+ """
+ self.update_page_size(net_traffic, param["page_object"])
+ self.update_user_count(net_traffic, param["simulated_users"])
+
+ def update_page_size(self, net_traffic, page_object):
+ """Update page_object field in http client object in net_traffic
+
+ This function update field which configure page_object
+ which will be loaded from server
+ Do not return anything.
+
+ :param net_traffic: (IxLoadObjectProxy) proxy obj to tcl net_traffic object
+ :param page_object: (str) path to object on server e.g. "/4k.html"
+ :return:
+ """
+ try:
+ activity = net_traffic.activityList[0]
+ ix_http_command = activity.agent.actionList[0]
+ ix_http_command.config(pageObject=page_object)
+ except Exception:
+ raise exceptions.InvalidRxfFile
+
+ def update_user_count(self, net_traffic, user_count):
+ """Update userObjectiveValue field in activity object in net_traffic
+
+ This function update field which configure users count
+ which will be simulated by client.
+ Do not return anything.
+
+ :param net_traffic: (IxLoadObjectProxy) proxy obj to tcl net_traffic object
+ :param user_count: (int) number of simulated users
+ :return:
+ """
+ try:
+ activity = net_traffic.activityList[0]
+ activity.config(userObjectiveValue=user_count)
+ except Exception:
+ raise exceptions.InvalidRxfFile
def start_http_test(self):
self.ix_load = IxLoad()