diff options
Diffstat (limited to 'tools/pkt_gen/xena/xena.py')
-rwxr-xr-x | tools/pkt_gen/xena/xena.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py index 194de343..17161165 100755 --- a/tools/pkt_gen/xena/xena.py +++ b/tools/pkt_gen/xena/xena.py @@ -30,6 +30,8 @@ import sys from time import sleep import xml.etree.ElementTree as ET from collections import OrderedDict +# scapy imports +import scapy.layers.inet as inet # VSPerf imports from conf import settings @@ -48,10 +50,6 @@ from tools.pkt_gen.xena.XenaDriver import ( XenaManager, ) -# scapy imports -import scapy.layers.inet as inet - - class Xena(ITrafficGenerator): """ Xena Traffic generator wrapper class @@ -288,14 +286,23 @@ class Xena(ITrafficGenerator): 1, settings.getValue("TRAFFICGEN_XENA_PORT1_IP"), settings.getValue("TRAFFICGEN_XENA_PORT1_CIDR"), settings.getValue("TRAFFICGEN_XENA_PORT1_GATEWAY")) - j_file.set_test_options( - packet_sizes=self._params['traffic']['l2']['framesize'], - iterations=trials, loss_rate=loss_rate, - duration=self._duration, micro_tpld=True if self._params[ - 'traffic']['l2']['framesize'] == 64 else False) + if testtype == '2544_throughput': + j_file.set_test_options_tput( + packet_sizes=self._params['traffic']['l2']['framesize'], + iterations=trials, loss_rate=loss_rate, + duration=self._duration, micro_tpld=True if self._params[ + 'traffic']['l2']['framesize'] == 64 else False) j_file.enable_throughput_test() + elif testtype == '2544_b2b': + j_file.set_test_options_back2back( + packet_sizes=self._params['traffic']['l2']['framesize'], + iterations=trials, duration=self._duration, + startvalue=self._params['traffic']['frame_rate'], + endvalue=self._params['traffic']['frame_rate'], + micro_tpld=True if self._params[ + 'traffic']['l2']['framesize'] == 64 else False) j_file.enable_back2back_test() j_file.set_header_layer2( |