diff options
author | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-11-08 17:35:50 -0500 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-12-02 13:47:36 +0000 |
commit | 0c292cdcf82ca1d5a71a93c1e1f91cb061a2c6f2 (patch) | |
tree | 988973cdfaa43f705856d31157967fab9afb178d /tools/pkt_gen/ixia | |
parent | 0606ef6290ac1e41468f57b0ef2ff1d0571aee3e (diff) |
pkt_gen: add duration to all send functions
Allow a configurable duration for all send functions.
JIRA: VSPERF-125
Change-Id: I7c6f5d136a7d7100e3990f7fdc00121b07081a80
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com>
Reviewed-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com>
Reviewed-by: Radek Zetik <radekx.zetik@intel.com>
Diffstat (limited to 'tools/pkt_gen/ixia')
-rwxr-xr-x | tools/pkt_gen/ixia/ixia.py | 10 | ||||
-rwxr-xr-x | tools/pkt_gen/ixia/pass_fail.tcl | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/pkt_gen/ixia/ixia.py b/tools/pkt_gen/ixia/ixia.py index 3a4f8442..0bf21414 100755 --- a/tools/pkt_gen/ixia/ixia.py +++ b/tools/pkt_gen/ixia/ixia.py @@ -211,12 +211,12 @@ class Ixia(trafficgen.ITrafficGenerator): return result - def send_burst_traffic(self, traffic=None, numpkts=100, time=20): + def send_burst_traffic(self, traffic=None, numpkts=100, duration=20): """See ITrafficGenerator for description """ flow = { 'numpkts': numpkts, - 'time': time, + 'duration': duration, 'type': 'stopStream', 'framerate': traffic['frame_rate'], } @@ -227,12 +227,12 @@ class Ixia(trafficgen.ITrafficGenerator): #TODO - implement Burst results setting via TrafficgenResults. - def send_cont_traffic(self, traffic=None, time=20, multistream=False): + def send_cont_traffic(self, traffic=None, duration=30, multistream=False): """See ITrafficGenerator for description """ flow = { 'numpkts': 100, - 'time': time, + 'duration': duration, 'type': 'contPacket', 'framerate': traffic['frame_rate'], 'multipleStreams': traffic['multistream'], @@ -242,7 +242,7 @@ class Ixia(trafficgen.ITrafficGenerator): return Ixia._create_result(result) - def start_cont_traffic(self, traffic=None, time=20): + def start_cont_traffic(self, traffic=None, duration=30): """See ITrafficGenerator for description """ return self.send_cont_traffic(traffic, 0) diff --git a/tools/pkt_gen/ixia/pass_fail.tcl b/tools/pkt_gen/ixia/pass_fail.tcl index 63d4d914..e10b393c 100755 --- a/tools/pkt_gen/ixia/pass_fail.tcl +++ b/tools/pkt_gen/ixia/pass_fail.tcl @@ -213,14 +213,14 @@ proc sendTraffic { flowSpec trafficSpec } { # Parameters: # flowSpec - a dict detailing how the packet should be sent. Should be # of format: - # {type, numpkts, time, framerate} + # {type, numpkts, duration, framerate} # trafficSpec - a dict describing the packet to be sent. Should be # of format: # { l2, vlan, l3} # where each item is in turn a dict detailing the configuration of each # layer of the packet # Returns: - # Output from Rx end of Ixia if time != 0, else 0 + # Output from Rx end of Ixia if duration != 0, else 0 ################################################## ################# Initialisation ################# @@ -238,7 +238,7 @@ proc sendTraffic { flowSpec trafficSpec } { set streamType [dict get $flowSpec type] set numPkts [dict get $flowSpec numpkts] - set time [expr {[dict get $flowSpec time] * 1000}] + set duration [expr {[dict get $flowSpec duration] * 1000}] set frameRate [dict get $flowSpec framerate] # traffic spec @@ -427,18 +427,18 @@ proc sendTraffic { flowSpec trafficSpec } { logMsg "Starting transmit on port $::port1" ixStartPortTransmit $::chassis $::card $::port1 - # If time=0 is passed, exit after starting transmit + # If duration=0 is passed, exit after starting transmit - if {$time == 0} { + if {$duration == 0} { logMsg "Sending traffic until interrupted" return } - logMsg "Waiting for $time ms" + logMsg "Waiting for $duration ms" - # Wait for time - 1 second to get traffic rate + # Wait for duration - 1 second to get traffic rate - after [expr "$time - 1"] + after [expr "$duration - 1"] # Get result @@ -668,7 +668,7 @@ proc rfcThroughputTest { testSpec trafficSpec } { for {set i 0} {$i < 20} {incr i} { dict set flowSpec type "contPacket" dict set flowSpec numpkts 100 ;# this can be bypassed - dict set flowSpec time $duration + dict set flowSpec duration $duration dict set flowSpec framerate $percentRate set flowStats [sendTraffic $flowSpec $trafficSpec] |