From f426da4469d88fc520fa7aa96576b7ca8096e4d0 Mon Sep 17 00:00:00 2001 From: Maryam Tahhan Date: Thu, 30 Jul 2015 13:44:36 +0100 Subject: 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 Signed-off-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Dino Madarang --- core/traffic_controller_rfc2544.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'core/traffic_controller_rfc2544.py') 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']) -- cgit 1.2.3-korg