From a81278b11de6393390816c8b3b675a313cd0ce9f Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Mon, 7 Mar 2016 09:52:22 +0000 Subject: bugfix: Cleanup of traffic gen api and default traffic values Both documentation and traffic generator API are updated to match current code logic. Additional default values are added into TRAFFIC_DEFAULTS dictionary. Constructor of TestCase class uses default values from TRAFFIC_DEFAULTS instead of magic numbers. Change-Id: Id2f4983945e4b123adddbc9a2a832f4a735b27f6 JIRA: VSPERF-253 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Christian Trautman --- testcases/testcase.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'testcases') diff --git a/testcases/testcase.py b/testcases/testcase.py index c79e4d0f..b6726dc4 100644 --- a/testcases/testcase.py +++ b/testcases/testcase.py @@ -52,13 +52,13 @@ class TestCase(object): self.name = cfg['Name'] self.desc = cfg.get('Description', 'No description given.') - bidirectional = cfg.get('biDirectional', False) + bidirectional = cfg.get('biDirectional', TRAFFIC_DEFAULTS['bidir']) bidirectional = get_test_param('bidirectional', bidirectional) - traffic_type = cfg.get('Traffic Type', 'rfc2544') + traffic_type = cfg.get('Traffic Type', TRAFFIC_DEFAULTS['traffic_type']) traffic_type = get_test_param('traffic_type', traffic_type) - framerate = cfg.get('iLoad', 100) + framerate = cfg.get('iLoad', TRAFFIC_DEFAULTS['frame_rate']) framerate = get_test_param('iload', framerate) self.deployment = cfg['Deployment'] @@ -91,11 +91,11 @@ class TestCase(object): # read configuration of streams; CLI parameter takes precedence to # testcase definition - multistream = cfg.get('MultiStream', 0) + multistream = cfg.get('MultiStream', TRAFFIC_DEFAULTS['multistream']) multistream = get_test_param('multistream', multistream) - stream_type = cfg.get('Stream Type', 'L4') + stream_type = cfg.get('Stream Type', TRAFFIC_DEFAULTS['stream_type']) stream_type = get_test_param('stream_type', stream_type) - pre_installed_flows = cfg.get('Pre-installed Flows', 'No') + pre_installed_flows = cfg.get('Pre-installed Flows', TRAFFIC_DEFAULTS['pre_installed_flows']) pre_installed_flows = get_test_param('pre-installed_flows', pre_installed_flows) # check if test requires background load and which generator it uses @@ -113,7 +113,7 @@ class TestCase(object): # set traffic details, so they can be passed to vswitch and traffic ctls self._traffic = copy.deepcopy(TRAFFIC_DEFAULTS) self._traffic.update({'traffic_type': traffic_type, - 'flow_type': cfg.get('Flow Type', 'port'), + 'flow_type': cfg.get('Flow Type', TRAFFIC_DEFAULTS['flow_type']), 'bidir': bidirectional, 'tunnel_type': self._tunnel_type, 'multistream': int(multistream), -- cgit 1.2.3-korg