diff options
author | DanielMartinBuckley <daniel.m.buckley@intel.com> | 2018-07-12 13:11:00 +0100 |
---|---|---|
committer | Abhijit Sinha <abhijit.sinha@intel.com> | 2018-11-06 11:29:49 +0000 |
commit | 45d25cdd12e3f649a8d0243459b5618fcc771525 (patch) | |
tree | dcd704c9279a986b9ff2d7dec822381aaef9c69f /yardstick/benchmark/scenarios/networking/vnf_generic.py | |
parent | e1c3b2e763d4759865e9732dcae99041422232a1 (diff) |
Test case override of traffic profile settings.
JIRA: YARDSTICK-1298
Allow the test case file e.g. "tc_prox_baremetal_l2fwd-4.yaml"
settings to override the values in the traffic_profile file
e.g. "prox_binsearch.yaml"
This is done by adding the "traffic_config" section to the
"options" section in the "test case file".
See below :-
options:
interface_speed_gbps: 10
traffic_config:
tolerated_loss: 0.001
test_precision: 0.1
packet_sizes: [64]
duration: 30
lower_bound: 0.0
upper_bound: 100.0
vnf__0:
prox_path: /opt/nsb_bin/prox
prox_config: "configs/handle_l2fwd-4.cfg"
prox_args:
"-t": ""
tg__0:
prox_path: /opt/nsb_bin/prox
prox_config: "configs/gen_l2fwd-4.cfg"
prox_args:
"-e": ""
"-t": ""
Precedence of the traffic settings.
1. Values provided in the "traffic_config" section, inside
the "options" section, of the test case file
2. values provided in the "traffic_profile" section of the
traffic_profile file
Change-Id: I6b4e123e865c9dab548f9ad28647f95b53410e8f
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
(cherry picked from commit 383c438cda94a1004bc9552a5993fe3ff3e6da8f)
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/vnf_generic.py')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/vnf_generic.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py index 20fff61ed..d8f062522 100644 --- a/yardstick/benchmark/scenarios/networking/vnf_generic.py +++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py @@ -161,8 +161,17 @@ class NetworkServiceTestCase(scenario_base.Scenario): tprofile_base.TrafficProfile.DOWNLINK: {}, 'extra_args': extra_args, 'duration': self._get_duration()} + traffic_vnfd = vnfdgen.generate_vnfd(tprofile, tprofile_data) - self.traffic_profile = tprofile_base.TrafficProfile.get(traffic_vnfd) + + traffic_config = \ + self.scenario_cfg.get("options", {}).get("traffic_config", {}) + + traffic_vnfd.setdefault("traffic_profile", {}) + traffic_vnfd["traffic_profile"].update(traffic_config) + + self.traffic_profile = \ + tprofile_base.TrafficProfile.get(traffic_vnfd) def _get_topology(self): topology = self.scenario_cfg["topology"] |