From e79f969b7f40792d0071bb484026097adda7c2b5 Mon Sep 17 00:00:00 2001 From: tli Date: Tue, 28 Jun 2016 23:14:03 -0400 Subject: Xena: Modify xena_json for back2back options Add method set_test_options_back2back in code to modify duration, iterations, and flowrate for back2back options in the json file. JIRA: VSPERF-305 Change-Id: I1337318e7519fbd7b5a71bb26a1c62fcd8c2b66c Signed-off-by: tli --- tools/pkt_gen/xena/xena.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'tools/pkt_gen/xena/xena.py') 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( -- cgit 1.2.3-korg