summaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/xena/xena.py
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-06-29 16:12:19 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-29 16:12:19 +0000
commit10121775eb7ee5eb6675d472b2c2e5e1662aac03 (patch)
treeebdd6d431711e00783a694b28fd7fd382190d7a8 /tools/pkt_gen/xena/xena.py
parente04b1b9a22f93bb1783ff9e82486aec38dcb0efb (diff)
parente79f969b7f40792d0071bb484026097adda7c2b5 (diff)
Merge "Xena: Modify xena_json for back2back options"
Diffstat (limited to 'tools/pkt_gen/xena/xena.py')
-rwxr-xr-xtools/pkt_gen/xena/xena.py25
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(