From 6c9279502beeeee90205488398001640103a522d Mon Sep 17 00:00:00 2001 From: Christian Trautman Date: Sun, 26 Jun 2016 15:13:38 -0400 Subject: xena_burst: Add Xena Burst traffic Add Xena burst traffic functionality. JIRA: VSPERF-263 Change-Id: I6336e5fcb33c0f66ee87f0f14f1b795937e3d00d Signed-off-by: Christian Trautman --- tools/pkt_gen/xena/xena.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'tools/pkt_gen/xena') diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py index 194de343..1cb843d4 100755 --- a/tools/pkt_gen/xena/xena.py +++ b/tools/pkt_gen/xena/xena.py @@ -485,22 +485,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. -- cgit 1.2.3-korg