aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-06-29 18:50:48 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-29 18:50:48 +0000
commit84018f98355f8aeb4eabf6bed02ca3bca03300ec (patch)
tree84ea74df59905a550ee0e7b66c976f8493de2d44
parent10121775eb7ee5eb6675d472b2c2e5e1662aac03 (diff)
parent6c9279502beeeee90205488398001640103a522d (diff)
Merge "xena_burst: Add Xena Burst traffic"
-rwxr-xr-xtools/pkt_gen/xena/xena.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 17161165..e76ebcbf 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -492,22 +492,18 @@ class Xena(ITrafficGenerator):
def send_burst_traffic(self, traffic=None, numpkts=100, duration=20):
"""Send a burst of traffic.
- Send a ``numpkts`` packets of traffic, using ``traffic``
- configuration, with a timeout of ``time``.
-
- Attributes:
- :param traffic: Detailed "traffic" spec, i.e. IP address, VLAN tags
- :param numpkts: Number of packets to send
- :param duration: Time to wait to receive packets
-
- :returns: dictionary of strings with following data:
- - List of Tx Frames,
- - List of Rx Frames,
- - List of Tx Bytes,
- - List of List of Rx Bytes,
- - Payload Errors and Sequence Errors.
+ See ITrafficGenerator for description
"""
- raise NotImplementedError('Xena burst traffic not implemented')
+ self._duration = duration
+
+ self._params.clear()
+ self._params['traffic'] = self.traffic_defaults.copy()
+ if traffic:
+ self._params['traffic'] = merge_spec(self._params['traffic'],
+ traffic)
+
+ self._start_traffic_api(numpkts)
+ return self._stop_api_traffic()
def send_cont_traffic(self, traffic=None, duration=20):
"""Send a continuous flow of traffic.