diff options
author | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-07-30 13:44:36 +0100 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-08-26 08:16:32 +0000 |
commit | f426da4469d88fc520fa7aa96576b7ca8096e4d0 (patch) | |
tree | 910033827982f8d5e576ecc6b7aaf5ea48e3d087 /core | |
parent | 753bce9a5fd3a4d1ae2e2c7268f689bd81b970bd (diff) |
bug_fix: process pkt_size/duration from cli
Refactor rfc25444_duration to duration and update the --test-params help
to show the type of parameters that can be set from the cli. Also
configure pkt_sizes so that it can be modified from the CLI. Also fixes
the tcl script to configure framesize properly (to the value selected
and not the default 64b).
JIRA: VSPERF-27
Change-Id: I76dcd824977a5f940cf7476090d2d2a3acca8160
Signed-off-by: Billy O'Mahony<billy.o.mahony@intel.com>
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Dino Madarang <dino.simeonx.madarang@intel.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/traffic_controller_rfc2544.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/traffic_controller_rfc2544.py b/core/traffic_controller_rfc2544.py index aae3ef81..e8f1e2a0 100644 --- a/core/traffic_controller_rfc2544.py +++ b/core/traffic_controller_rfc2544.py @@ -39,10 +39,20 @@ class TrafficControllerRFC2544(ITrafficController, IResults): self._traffic_gen_class = traffic_gen_class() self._traffic_started = False self._traffic_started_call_count = 0 - self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES') self._trials = get_test_param('rfc2544_trials', 1) + self._duration = get_test_param('duration', 30) self._results = [] + # If set, comma separated packet_sizes value from --test_params + # on cli takes precedence over value in settings file. + self._packet_sizes = None + packet_sizes_cli = get_test_param('pkt_sizes') + if packet_sizes_cli: + self._packet_sizes = [int(x.strip()) + for x in packet_sizes_cli.split(',')] + else: + self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES') + def __enter__(self): """Call initialisation function. """ @@ -85,14 +95,14 @@ class TrafficControllerRFC2544(ITrafficController, IResults): if traffic['traffic_type'] == 'back2back': result = self._traffic_gen_class.send_rfc2544_back2back( traffic, trials=int(self._trials), - duration=int(get_test_param('rfc2544_duration', 20))) + duration=self._duration) elif traffic['traffic_type'] == 'continuous': result = self._traffic_gen_class.send_cont_traffic( traffic, time=int(get_test_param('rfc2544_duration', 30))) else: result = self._traffic_gen_class.send_rfc2544_throughput( traffic, trials=int(self._trials), - duration=int(get_test_param('rfc2544_duration', 20))) + duration=self._duration) result = TrafficControllerRFC2544._append_results(result, packet_size) @@ -109,7 +119,7 @@ class TrafficControllerRFC2544(ITrafficController, IResults): self._traffic_gen_class.start_rfc2544_throughput( traffic, trials=int(self._trials), - duration=int(get_test_param('rfc2544_duration', 20))) + duration=self._duration) self._traffic_started = True if len(function['args']) > 0: function['function'](function['args']) |