summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconf/01_testcases.conf2
-rw-r--r--core/vswitch_controller_p2p.py3
-rw-r--r--testcases/testcase.py3
-rwxr-xr-xtools/pkt_gen/ixnet/ixnet.py29
-rwxr-xr-xtools/pkt_gen/ixnet/ixnetrfc2544.tcl5
5 files changed, 28 insertions, 14 deletions
diff --git a/conf/01_testcases.conf b/conf/01_testcases.conf
index 32c51e70..53d63e78 100755
--- a/conf/01_testcases.conf
+++ b/conf/01_testcases.conf
@@ -36,6 +36,7 @@ PERFORMANCE_TESTS = [
"Collector": "cpu",
"Deployment": "p2p",
"Description": "RFC2544 Throughput Phy2Phy Loopback",
+ "biDirectional": "True",
},
{
"Name": "back2back",
@@ -43,5 +44,6 @@ PERFORMANCE_TESTS = [
"Collector": "cpu",
"Deployment": "p2p",
"Description": "RFC 2544 Back To Back Frames Test",
+ "biDirectional": "True",
},
]
diff --git a/core/vswitch_controller_p2p.py b/core/vswitch_controller_p2p.py
index ceb29aa9..a71f42f5 100644
--- a/core/vswitch_controller_p2p.py
+++ b/core/vswitch_controller_p2p.py
@@ -62,6 +62,9 @@ class VswitchControllerP2P(IVswitchController):
flow = add_ports_to_flow(_FLOW_TEMPLATE, phy1_number, phy2_number)
self._vswitch.add_flow(BRIDGE_NAME, flow)
+ flow = add_ports_to_flow(_FLOW_TEMPLATE, phy2_number, phy1_number)
+ self._vswitch.add_flow(BRIDGE_NAME, flow)
+
except:
self._vswitch.stop()
raise
diff --git a/testcases/testcase.py b/testcases/testcase.py
index cc1e6e4a..5ad91f2a 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -39,6 +39,7 @@ class TestCase(object):
self._traffic_type = cfg['Traffic Type']
self._deployment = cfg['Deployment']
self._collector = cfg['Collector']
+ self._bidir = cfg['biDirectional']
self._results_dir = results_dir
def run(self):
@@ -68,7 +69,7 @@ class TestCase(object):
with vswitch_ctl:
if vnf_ctl:
vnf_ctl.start()
- traffic = {'traffic_type': self._traffic_type}
+ traffic = {'traffic_type': self._traffic_type, 'bidir': self._bidir}
with traffic_ctl:
traffic_ctl.send_traffic(traffic)
diff --git a/tools/pkt_gen/ixnet/ixnet.py b/tools/pkt_gen/ixnet/ixnet.py
index 644a376f..58373a19 100755
--- a/tools/pkt_gen/ixnet/ixnet.py
+++ b/tools/pkt_gen/ixnet/ixnet.py
@@ -158,6 +158,7 @@ class IxNet(trafficgen.ITrafficGenerator):
_cfg = None
_logger = logging.getLogger(__name__)
_params = None
+ _bidir = None
def run_tcl(self, cmd):
"""Run a TCL script using the TCL interpreter found in ``tkinter``.
@@ -211,6 +212,7 @@ class IxNet(trafficgen.ITrafficGenerator):
multistream=False):
"""Start transmission.
"""
+ self._bidir = traffic['bidir']
self._params = {}
self._params['config'] = {
@@ -225,6 +227,7 @@ class IxNet(trafficgen.ITrafficGenerator):
if traffic:
self._params['traffic'] = trafficgen.merge_spec(
self._params['traffic'], traffic)
+ self._cfg['bidir'] = self._bidir
for cmd in _build_set_cmds(self._cfg, prefix='set'):
self.run_tcl(cmd)
@@ -262,6 +265,7 @@ class IxNet(trafficgen.ITrafficGenerator):
lossrate=0.0, multistream=False):
"""Start transmission.
"""
+ self._bidir = traffic['bidir']
self._params = {}
self._params['config'] = {
@@ -277,6 +281,7 @@ class IxNet(trafficgen.ITrafficGenerator):
if traffic:
self._params['traffic'] = trafficgen.merge_spec(
self._params['traffic'], traffic)
+ self._cfg['bidir'] = self._bidir
for cmd in _build_set_cmds(self._cfg, prefix='set'):
self.run_tcl(cmd)
@@ -329,7 +334,7 @@ class IxNet(trafficgen.ITrafficGenerator):
# transform path into someting useful
path = result_path.group(1).replace('\\', '/')
- path = os.path.join(path, 'results.csv')
+ path = os.path.join(path, 'AggregateResults.csv')
path = path.replace(
settings.getValue('TRAFFICGEN_IXNET_TESTER_RESULT_DIR'),
settings.getValue('TRAFFICGEN_IXNET_DUT_RESULT_DIR'))
@@ -349,9 +354,9 @@ class IxNet(trafficgen.ITrafficGenerator):
#Replace null entries added by Ixia with 0s.
row = [entry if len(entry) > 0 else '0' for entry in row]
# calculate tx fps by (rx fps * (tx % / rx %))
- tx_fps = float(row[9]) * (float(row[8]) / float(row[7]))
+ tx_fps = float(row[5]) * (float(row[4]) / float(row[3]))
# calculate tx mbps by (rx mbps * (tx % / rx %))
- tx_mbps = float(row[10]) * (float(row[8]) / float(row[7]))
+ tx_mbps = float(row[6]) * (float(row[4]) / float(row[3]))
if bool(results.get(ResultsConstants.THROUGHPUT_RX_FPS)) \
== False:
@@ -359,16 +364,16 @@ class IxNet(trafficgen.ITrafficGenerator):
else:
prev_percent_rx = \
float(results.get(ResultsConstants.THROUGHPUT_RX_FPS))
- if float(row[9]) >= prev_percent_rx:
+ if float(row[5]) >= prev_percent_rx:
results[ResultsConstants.THROUGHPUT_TX_FPS] = tx_fps
- results[ResultsConstants.THROUGHPUT_RX_FPS] = row[9]
+ results[ResultsConstants.THROUGHPUT_RX_FPS] = row[5]
results[ResultsConstants.THROUGHPUT_TX_MBPS] = tx_mbps
- results[ResultsConstants.THROUGHPUT_RX_MBPS] = row[10]
- results[ResultsConstants.THROUGHPUT_TX_PERCENT] = row[7]
- results[ResultsConstants.THROUGHPUT_RX_PERCENT] = row[8]
- results[ResultsConstants.MIN_LATENCY_NS] = row[15]
- results[ResultsConstants.MAX_LATENCY_NS] = row[16]
- results[ResultsConstants.AVG_LATENCY_NS] = row[17]
+ results[ResultsConstants.THROUGHPUT_RX_MBPS] = row[6]
+ results[ResultsConstants.THROUGHPUT_TX_PERCENT] = row[3]
+ results[ResultsConstants.THROUGHPUT_RX_PERCENT] = row[4]
+ results[ResultsConstants.MIN_LATENCY_NS] = row[11]
+ results[ResultsConstants.MAX_LATENCY_NS] = row[12]
+ results[ResultsConstants.AVG_LATENCY_NS] = row[13]
return results
output = self.run_tcl('waitForRfc2544Test')
@@ -392,6 +397,7 @@ class IxNet(trafficgen.ITrafficGenerator):
lossrate=0.0, multistream=False):
"""Start transmission.
"""
+ self._bidir = traffic['bidir']
self._params = {}
self._params['config'] = {
@@ -407,6 +413,7 @@ class IxNet(trafficgen.ITrafficGenerator):
if traffic:
self._params['traffic'] = trafficgen.merge_spec(
self._params['traffic'], traffic)
+ self._cfg['bidir'] = self._bidir
for cmd in _build_set_cmds(self._cfg, prefix='set'):
self.run_tcl(cmd)
diff --git a/tools/pkt_gen/ixnet/ixnetrfc2544.tcl b/tools/pkt_gen/ixnet/ixnetrfc2544.tcl
index a294e74a..d7472c07 100755
--- a/tools/pkt_gen/ixnet/ixnetrfc2544.tcl
+++ b/tools/pkt_gen/ixnet/ixnetrfc2544.tcl
@@ -43,7 +43,7 @@ lappend auto_path [list $lib_path]
# verify that the IXIA chassis spec is given
-set reqVars [list "machine" "port" "user" "chassis" "card" "port1" "port2" "output_dir"]
+set reqVars [list "machine" "port" "user" "chassis" "card" "port1" "port2" "output_dir" "bidir"]
set rfc2544test ""
foreach var $reqVars {
@@ -58,6 +58,7 @@ foreach var $reqVars {
set ::IxNserver $machine
set ::IxNport $port
+set ::biDirect $bidir
# change to windows path format and append directory
set output_dir [string map {"/" "\\"} $output_dir]
@@ -1235,7 +1236,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
ixNet setMultiAttrs $sg_trafficItem \
-transportRsvpTePreference one \
-trafficItemType l2L3 \
- -biDirectional False \
+ -biDirectional $::biDirect \
-mergeDestinations True \
-hostsPerNetwork 1 \
-transmitMode interleaved \