summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconf/01_testcases.conf7
-rw-r--r--core/traffic_controller_rfc2544.py13
-rw-r--r--testcases/testcase.py3
-rwxr-xr-xtools/pkt_gen/ixnet/ixnet.py28
4 files changed, 27 insertions, 24 deletions
diff --git a/conf/01_testcases.conf b/conf/01_testcases.conf
index 42090df4..32c51e70 100755
--- a/conf/01_testcases.conf
+++ b/conf/01_testcases.conf
@@ -37,4 +37,11 @@ PERFORMANCE_TESTS = [
"Deployment": "p2p",
"Description": "RFC2544 Throughput Phy2Phy Loopback",
},
+ {
+ "Name": "back2back",
+ "Traffic Type": "back2back",
+ "Collector": "cpu",
+ "Deployment": "p2p",
+ "Description": "RFC 2544 Back To Back Frames Test",
+ },
]
diff --git a/core/traffic_controller_rfc2544.py b/core/traffic_controller_rfc2544.py
index 003307bf..bcea9568 100644
--- a/core/traffic_controller_rfc2544.py
+++ b/core/traffic_controller_rfc2544.py
@@ -82,10 +82,15 @@ class TrafficControllerRFC2544(ITrafficController, IResults):
for packet_size in self._packet_sizes:
traffic['l2'] = {'framesize': packet_size}
- result = self._traffic_gen_class.send_rfc2544_throughput(
- traffic,
- trials=int(self._trials),
- duration=int(get_test_param('rfc2544_duration', 20)))
+ if traffic['traffic_type'] == 'back2back':
+ result = self._traffic_gen_class.send_rfc2544_back2back(
+ traffic, trials=int(self._trials),
+ duration=int(get_test_param('rfc2544_duration', 20)))
+ else:
+ result = self._traffic_gen_class.send_rfc2544_throughput(
+ traffic, trials=int(self._trials),
+ duration=int(get_test_param('rfc2544_duration', 20)))
+
result = TrafficControllerRFC2544._append_results(result,
packet_size)
self._results.append(result)
diff --git a/testcases/testcase.py b/testcases/testcase.py
index 76758c8f..cc1e6e4a 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -68,8 +68,7 @@ class TestCase(object):
with vswitch_ctl:
if vnf_ctl:
vnf_ctl.start()
- #TODO 'traffic' is placeholder for traffic dict
- traffic = {'test': 'rfc2544'}
+ traffic = {'traffic_type': self._traffic_type}
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 fdea4bfd..5deca8d6 100755
--- a/tools/pkt_gen/ixnet/ixnet.py
+++ b/tools/pkt_gen/ixnet/ixnet.py
@@ -186,8 +186,8 @@ class IxNet(trafficgen.ITrafficGenerator):
'card': settings.getValue('TRAFFICGEN_IXIA_CARD'),
'port1': settings.getValue('TRAFFICGEN_IXIA_PORT1'),
'port2': settings.getValue('TRAFFICGEN_IXIA_PORT2'),
- 'output_dir': settings.getValue(
- 'TRAFFICGEN_IXNET_TESTER_RESULT_DIR'),
+ 'output_dir':
+ settings.getValue('TRAFFICGEN_IXNET_TESTER_RESULT_DIR'),
}
self._logger.debug('IXIA configuration configuration : %s', self._cfg)
@@ -365,7 +365,7 @@ class IxNet(trafficgen.ITrafficGenerator):
results[ResultsConstants.THROUGHPUT_TX_MBPS] = tx_mbps
results[ResultsConstants.THROUGHPUT_RX_MBPS] = row[10]
results[ResultsConstants.THROUGHPUT_TX_PERCENT] = row[7]
- results[ResultsConstants.THROUGHPUT_TX_PERCENT] = row[8]
+ 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]
@@ -468,7 +468,8 @@ class IxNet(trafficgen.ITrafficGenerator):
:returns: Best parsed result from CSV file.
"""
- results = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
+ results = OrderedDict()
+ results[ResultsConstants.B2B_FRAMES] = 0
with open(path, 'r') as in_file:
reader = csv.reader(in_file, delimiter=',')
@@ -477,29 +478,20 @@ class IxNet(trafficgen.ITrafficGenerator):
# if back2back count higher than previously found, store it
# Note: row[N] here refers to the Nth column of a row
if float(row[14]) <= self._params['config']['lossrate']:
- if int(row[12]) > int(results[5]):
- results = [
- float(row[9]), # rx throughput (fps)
- float(row[10]), # rx throughput (mbps)
- float(row[7]), # tx rate (% linerate)
- float(row[8]), # rx rate (% linerate)
- int(row[11]), # tx count (frames)
- int(row[12]), # back2back count (frames)
- int(row[13]), # frame loss (frames)
- float(row[14]), # frame loss (%)
- ]
+ if int(row[12]) > \
+ int(results[ResultsConstants.B2B_FRAMES]):
+ results[ResultsConstants.B2B_FRAMES] = int(row[12])
return results
- self.run_tcl('waitForRfc2544Test')
+ output = self.run_tcl('waitForRfc2544Test')
# the run_tcl function will return a list with one element. We extract
# that one element (a string representation of an IXIA-specific Tcl
# datatype), parse it to find the path of the results file then parse
# the results file
- #TODO implement back2back result via IResult interface.
- #return parse_ixnet_rfc_results(parse_result_string(output[0]))
+ return parse_ixnet_rfc_results(parse_result_string(output[0]))
if __name__ == '__main__':