aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/traffic_profile/base.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-05-24 14:02:03 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-18 13:51:21 +0100
commit340be73be5fd20067c23a7ddce9073639e355d3a (patch)
tree87c02e70ee75fff473e6b8916ed43e039c4da1f3 /yardstick/network_services/traffic_profile/base.py
parent1517319fd210d71db72c5e4bfa00fc49ae4fa877 (diff)
Refactor RFC2455 TRex traffic profile injection
The TRex RFC2455 traffic profile configures the duration of the traffic injection. Once the traffic is started, the traffic profile should poll the traffic injector client for the injection status. When the injection is finished, the traffic execution should end. Instead of this, the traffic profile waits a fixed time (using time.sleep method) and then stops the traffic. This approach is not accurate and may cause shorter injection periods. JIRA: YARDSTICK-1197 Change-Id: I5090df81ef4ec7945ff6c1aff070656b48e0fe77 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile/base.py')
-rw-r--r--yardstick/network_services/traffic_profile/base.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/yardstick/network_services/traffic_profile/base.py b/yardstick/network_services/traffic_profile/base.py
index 4c3b29754..f4b5b178c 100644
--- a/yardstick/network_services/traffic_profile/base.py
+++ b/yardstick/network_services/traffic_profile/base.py
@@ -21,16 +21,21 @@ class TrafficProfileConfig(object):
This object will parse and validate the traffic profile information.
"""
+
+ DEFAULT_SCHEMA = 'nsb:traffic_profile:0.1'
+ DEFAULT_FRAME_RATE = 100
+ DEFAULT_DURATION = 30
+
def __init__(self, tp_config):
- self.schema = tp_config.get('schema', 'nsb:traffic_profile:0.1')
+ self.schema = tp_config.get('schema', self.DEFAULT_SCHEMA)
self.name = tp_config.get('name')
self.description = tp_config.get('description')
tprofile = tp_config['traffic_profile']
self.traffic_type = tprofile.get('traffic_type')
- self.frame_rate = tprofile.get('frame_rate')
+ self.frame_rate = tprofile.get('frame_rate', self.DEFAULT_FRAME_RATE)
self.test_precision = tprofile.get('test_precision')
self.packet_sizes = tprofile.get('packet_sizes')
- self.duration = tprofile.get('duration')
+ self.duration = tprofile.get('duration', self.DEFAULT_DURATION)
self.lower_bound = tprofile.get('lower_bound')
self.upper_bound = tprofile.get('upper_bound')
self.step_interval = tprofile.get('step_interval')
@@ -43,7 +48,6 @@ class TrafficProfile(object):
"""
UPLINK = "uplink"
DOWNLINK = "downlink"
- DEFAULT_DURATION = 30
@staticmethod
def get(tp_config):