summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pkt_gen/dummy/dummy.py7
-rwxr-xr-xtools/pkt_gen/ixia/ixia.py15
-rwxr-xr-xtools/pkt_gen/ixnet/ixnet.py10
-rwxr-xr-xtools/pkt_gen/trafficgen/trafficgen.py13
4 files changed, 20 insertions, 25 deletions
diff --git a/tools/pkt_gen/dummy/dummy.py b/tools/pkt_gen/dummy/dummy.py
index f9ad1c8c..bf5a8f3c 100755
--- a/tools/pkt_gen/dummy/dummy.py
+++ b/tools/pkt_gen/dummy/dummy.py
@@ -104,7 +104,7 @@ class Dummy(trafficgen.ITrafficGenerator):
"""
pass
- def send_burst_traffic(self, traffic=None, numpkts=100, time=20, framerate=100):
+ def send_burst_traffic(self, traffic=None, numpkts=100, time=20):
"""
Send a burst of traffic.
"""
@@ -133,8 +133,7 @@ class Dummy(trafficgen.ITrafficGenerator):
return trafficgen.BurstResult(*results)
- def send_cont_traffic(self, traffic=None, time=20, framerate=0,
- multistream=False):
+ def send_cont_traffic(self, traffic=None, time=20, multistream=False):
"""
Send a continuous flow of traffic.
"""
@@ -146,7 +145,7 @@ class Dummy(trafficgen.ITrafficGenerator):
results = get_user_traffic(
'continuous',
- '%dmS, %dmpps, multistream %s' % (time, framerate,
+ '%dmS, %dmpps, multistream %s' % (time, traffic['frame_rate'],
multistream), traffic_,
('frames tx', 'frames rx', 'min latency', 'max latency',
'avg latency'))
diff --git a/tools/pkt_gen/ixia/ixia.py b/tools/pkt_gen/ixia/ixia.py
index 992aff32..3a4f8442 100755
--- a/tools/pkt_gen/ixia/ixia.py
+++ b/tools/pkt_gen/ixia/ixia.py
@@ -211,15 +211,14 @@ class Ixia(trafficgen.ITrafficGenerator):
return result
- def send_burst_traffic(self, traffic=None, numpkts=100, time=20,
- framerate=100):
+ def send_burst_traffic(self, traffic=None, numpkts=100, time=20):
"""See ITrafficGenerator for description
"""
flow = {
'numpkts': numpkts,
'time': time,
'type': 'stopStream',
- 'framerate': framerate,
+ 'framerate': traffic['frame_rate'],
}
result = self._send_traffic(flow, traffic)
@@ -228,14 +227,14 @@ class Ixia(trafficgen.ITrafficGenerator):
#TODO - implement Burst results setting via TrafficgenResults.
- def send_cont_traffic(self, traffic=None, time=20, framerate=100):
+ def send_cont_traffic(self, traffic=None, time=20, multistream=False):
"""See ITrafficGenerator for description
"""
flow = {
'numpkts': 100,
'time': time,
'type': 'contPacket',
- 'framerate': framerate,
+ 'framerate': traffic['frame_rate'],
'multipleStreams': traffic['multistream'],
}
@@ -243,10 +242,10 @@ class Ixia(trafficgen.ITrafficGenerator):
return Ixia._create_result(result)
- def start_cont_traffic(self, traffic=None, time=20, framerate=100):
+ def start_cont_traffic(self, traffic=None, time=20):
"""See ITrafficGenerator for description
"""
- return self.send_cont_traffic(traffic, 0, framerate)
+ return self.send_cont_traffic(traffic, 0)
def stop_cont_traffic(self):
"""See ITrafficGenerator for description
@@ -254,7 +253,7 @@ class Ixia(trafficgen.ITrafficGenerator):
return self.run_tcl('stopTraffic')
def send_rfc2544_throughput(self, traffic=None, trials=3, duration=20,
- lossrate=0.0):
+ lossrate=0.0, multistream=False):
"""See ITrafficGenerator for description
"""
params = {}
diff --git a/tools/pkt_gen/ixnet/ixnet.py b/tools/pkt_gen/ixnet/ixnet.py
index 866a803e..52300b1e 100755
--- a/tools/pkt_gen/ixnet/ixnet.py
+++ b/tools/pkt_gen/ixnet/ixnet.py
@@ -200,14 +200,14 @@ class IxNet(trafficgen.ITrafficGenerator):
"""
pass
- def send_cont_traffic(self, traffic=None, time=30, framerate=100):
+ def send_cont_traffic(self, traffic=None, time=30, multistream=False):
"""See ITrafficGenerator for description
"""
- self.start_cont_traffic(traffic, time, framerate)
+ self.start_cont_traffic(traffic, time)
return self.stop_cont_traffic()
- def start_cont_traffic(self, traffic=None, time=30, framerate=100):
+ def start_cont_traffic(self, traffic=None, time=30):
"""Start transmission.
"""
self._bidir = traffic['bidir']
@@ -216,7 +216,7 @@ class IxNet(trafficgen.ITrafficGenerator):
self._params['config'] = {
'binary': False, # don't do binary search and send one stream
'time': time,
- 'framerate': framerate,
+ 'framerate': traffic['frame_rate'],
'multipleStreams': traffic['multistream'],
'rfc2544TestType': 'throughput',
}
@@ -251,7 +251,7 @@ class IxNet(trafficgen.ITrafficGenerator):
return self._wait_result()
def send_rfc2544_throughput(self, traffic=None, trials=3, duration=20,
- lossrate=0.0):
+ lossrate=0.0, multistream=False):
"""See ITrafficGenerator for description
"""
self.start_rfc2544_throughput(traffic, trials, duration, lossrate)
diff --git a/tools/pkt_gen/trafficgen/trafficgen.py b/tools/pkt_gen/trafficgen/trafficgen.py
index 37f6c095..ff4aca0a 100755
--- a/tools/pkt_gen/trafficgen/trafficgen.py
+++ b/tools/pkt_gen/trafficgen/trafficgen.py
@@ -79,8 +79,7 @@ class ITrafficGenerator(object):
"""
raise NotImplementedError('Please call an implementation.')
- def send_burst_traffic(self, traffic=None, numpkts=100,
- time=20, framerate=100):
+ def send_burst_traffic(self, traffic=None, numpkts=100, time=20):
"""Send a burst of traffic.
Send a ``numpkts`` packets of traffic, using ``traffic``
@@ -89,7 +88,6 @@ class ITrafficGenerator(object):
Attributes:
:param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
:param numpkts: Number of packets to send
- :param framerate: Expected framerate
:param time: Time to wait to receive packets
:returns: dictionary of strings with following data:
@@ -101,15 +99,14 @@ class ITrafficGenerator(object):
"""
raise NotImplementedError('Please call an implementation.')
- def send_cont_traffic(self, traffic=None, time=20, framerate=0):
+ def send_cont_traffic(self, traffic=None, time=20, multistream=False):
"""Send a continuous flow of traffic.
- Send packets at ``framerate``, using ``traffic`` configuration,
+ Send packets at given framerate, using ``traffic`` configuration,
until timeout ``time`` occurs.
:param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
:param time: Time to wait to receive packets (secs)
- :param framerate: Expected framerate
:param multistream: Enable multistream output by overriding the
UDP port number in ``traffic`` with values
from 1 to 64,000
@@ -126,7 +123,7 @@ class ITrafficGenerator(object):
"""
raise NotImplementedError('Please call an implementation.')
- def start_cont_traffic(self, traffic=None, time=20, framerate=0):
+ def start_cont_traffic(self, traffic=None, time=20):
"""Non-blocking version of 'send_cont_traffic'.
Start transmission and immediately return. Do not wait for
@@ -140,7 +137,7 @@ class ITrafficGenerator(object):
raise NotImplementedError('Please call an implementation.')
def send_rfc2544_throughput(self, traffic=None, trials=3, duration=20,
- lossrate=0.0):
+ lossrate=0.0, multistream=False):
"""Send traffic per RFC2544 throughput test specifications.
Send packets at a variable rate, using ``traffic``