diff options
Diffstat (limited to 'tools/pkt_gen/ixnet')
-rwxr-xr-x | tools/pkt_gen/ixnet/ixnet.py | 29 | ||||
-rwxr-xr-x | tools/pkt_gen/ixnet/ixnetrfc2544.tcl | 5 |
2 files changed, 21 insertions, 13 deletions
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 \ |