aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-03-07 09:52:22 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-03-11 10:31:19 +0000
commita81278b11de6393390816c8b3b675a313cd0ce9f (patch)
treea0a741f36a10f9373e49e1c25b51c467633143b0 /testcases/testcase.py
parentf7366919b9d985b2b3d267750ea16667b636cdac (diff)
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 <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'testcases/testcase.py')
-rw-r--r--testcases/testcase.py14
1 files changed, 7 insertions, 7 deletions
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),