diff options
author | Myron Sosyak <myronx.sosyak@intel.com> | 2018-09-19 14:10:57 +0100 |
---|---|---|
committer | Taras Chornyi <tarasx.chornyi@intel.com> | 2018-11-12 09:00:53 +0000 |
commit | d99cfd9eaac88851d7efbb95292c2752755ae070 (patch) | |
tree | f20460834e9e1b5c11335c32dd982304b254defd /yardstick/benchmark/scenarios | |
parent | 3fec49e7a3926ddf4f9303ee47a33d109421a573 (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/benchmark/scenarios')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/vnf_generic.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py index d8f062522..5ac51cdfc 100644 --- a/yardstick/benchmark/scenarios/networking/vnf_generic.py +++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py @@ -151,6 +151,26 @@ class NetworkServiceTestCase(scenario_base.Scenario): return options.get('duration', tprofile_base.TrafficProfileConfig.DEFAULT_DURATION) + def _key_list_to_dict(self, key, value_list): + value_dict = {} + try: + for index, count in enumerate(value_list[key]): + value_dict["{}_{}".format(key, index)] = count + except KeyError: + value_dict = {} + + return value_dict + + def _get_simulated_users(self): + users = self.scenario_cfg.get("options", {}).get("simulated_users", {}) + simulated_users = self._key_list_to_dict("uplink", users) + return {"simulated_users": simulated_users} + + def _get_page_object(self): + objects = self.scenario_cfg.get("options", {}).get("page_object", {}) + page_object = self._key_list_to_dict("uplink", objects) + return {"page_object": page_object} + def _fill_traffic_profile(self): tprofile = self._get_traffic_profile() extra_args = self.scenario_cfg.get('extra_args', {}) @@ -160,8 +180,9 @@ class NetworkServiceTestCase(scenario_base.Scenario): tprofile_base.TrafficProfile.UPLINK: {}, tprofile_base.TrafficProfile.DOWNLINK: {}, 'extra_args': extra_args, - 'duration': self._get_duration()} - + 'duration': self._get_duration(), + 'page_object': self._get_page_object(), + 'simulated_users': self._get_simulated_users()} traffic_vnfd = vnfdgen.generate_vnfd(tprofile, tprofile_data) traffic_config = \ |