aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/traffic_profile
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-05-23 09:16:39 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-18 13:50:27 +0100
commit1517319fd210d71db72c5e4bfa00fc49ae4fa877 (patch)
treefa7e0c6563b64ef4413be3c79912741f22712c5c /yardstick/network_services/traffic_profile
parent772d13797e7c84cbc0f8b7ac9005c97b8111cfa8 (diff)
Add "duration" parameter to test case definition
Add "duration" parameter to test case definition, in scenario:options section. This parameter will be rendered in the traffic profile. If the parameter is not present in the test case scenario options, the default time written in the traffic profile options will be 30 seconds (TrafficProfile.DEFAULT_DURATION = 30). If the traffic profile injection time is not defined, the default injection time will be 30 seconds. testcase:scenario:options:duration (default = 30) render --> traffic_profile:duration parse --> TrafficProfile.duration (default = 30) Target traffic profiles (RFC2544): - RFC2544Profile - IXIARFC2544Profile JIRA: YARDSTICK-1194 Change-Id: I968922e6bb882d7ee15aa1c4db4037face7a3492 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile')
-rw-r--r--yardstick/network_services/traffic_profile/base.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/yardstick/network_services/traffic_profile/base.py b/yardstick/network_services/traffic_profile/base.py
index 9eba550aa..4c3b29754 100644
--- a/yardstick/network_services/traffic_profile/base.py
+++ b/yardstick/network_services/traffic_profile/base.py
@@ -16,6 +16,26 @@ from yardstick.common import exceptions
from yardstick.common import utils
+class TrafficProfileConfig(object):
+ """Class to contain the TrafficProfile class information
+
+ This object will parse and validate the traffic profile information.
+ """
+ def __init__(self, tp_config):
+ self.schema = tp_config.get('schema', 'nsb:traffic_profile:0.1')
+ 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.test_precision = tprofile.get('test_precision')
+ self.packet_sizes = tprofile.get('packet_sizes')
+ self.duration = tprofile.get('duration')
+ self.lower_bound = tprofile.get('lower_bound')
+ self.upper_bound = tprofile.get('upper_bound')
+ self.step_interval = tprofile.get('step_interval')
+
+
class TrafficProfile(object):
"""
This class defines the behavior
@@ -23,6 +43,7 @@ class TrafficProfile(object):
"""
UPLINK = "uplink"
DOWNLINK = "downlink"
+ DEFAULT_DURATION = 30
@staticmethod
def get(tp_config):
@@ -43,6 +64,7 @@ class TrafficProfile(object):
# e.g. RFC2544 start_ip, stop_ip, drop_rate,
# IMIX = {"10K": 0.1, "100M": 0.5}
self.params = tp_config
+ self.config = TrafficProfileConfig(tp_config)
def execute_traffic(self, traffic_generator, **kawrgs):
""" This methods defines the behavior of the traffic generator.