aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/ixia/ixnetrfc2544.tcl
diff options
context:
space:
mode:
Diffstat (limited to '3rd_party/ixia/ixnetrfc2544.tcl')
-rw-r--r--3rd_party/ixia/ixnetrfc2544.tcl188
1 files changed, 141 insertions, 47 deletions
diff --git a/3rd_party/ixia/ixnetrfc2544.tcl b/3rd_party/ixia/ixnetrfc2544.tcl
index 435f335f..fbc05f95 100644
--- a/3rd_party/ixia/ixnetrfc2544.tcl
+++ b/3rd_party/ixia/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" "bidir"]
+set reqVars [list "machine" "port" "user" "chassis_east" "card_east" "port_east" "chassis_west" "card_west" "port_west" "output_dir" "bidir" "frame_size_list"]
set rfc2544test ""
foreach var $reqVars {
@@ -59,6 +59,7 @@ foreach var $reqVars {
set ::IxNserver $machine
set ::IxNport $port
set ::biDirect $bidir
+set frameSizeList $frame_size_list
# change to windows path format and append directory
set output_dir [string map {"/" "\\"} $output_dir]
@@ -66,14 +67,17 @@ set output_dir "$output_dir\\rfctests"
puts "Output directory is $output_dir"
proc startRfc2544Test { testSpec trafficSpec } {
- # Start RFC2544 quicktest.
+ # Start RFC2544 quickte"$output_dir\\rfctests"st.
# Configure global variables. See documentation on 'global' for more
# information on why this is necessary
# https://www.tcl.tk/man/tcl8.5/tutorial/Tcl13.html
global rfc2544test
+ global qt
+ global frameSizeList
global sg_rfc2544throughput
global sg_rfc2544back2back
+ global output_dir
# Suffix for stack names
# This variable should be incremented after setting sg_stack like:
@@ -90,13 +94,16 @@ proc startRfc2544Test { testSpec trafficSpec } {
set duration [dict get $testSpec duration]
# check if only one tgen port is requested
- if {($::port1 == $::port2)} {
- set twoPorts 0
- set selfDestined True
- } else {
- set twoPorts 1
- set selfDestined False
- }
+ set twoPorts 1
+ set selfDestined False
+ if {($::chassis_east == $::chassis_west)} {
+ if {($::card_east == $::card_west)} {
+ if {($::port_east == $::port_west)} {
+ set twoPorts 0
+ set selfDestined True
+ }}
+ }
+
# RFC2544 to IXIA terminology mapping (it affects Ixia configuration inside this script):
# Test => Trial
@@ -163,30 +170,18 @@ proc startRfc2544Test { testSpec trafficSpec } {
set trafficSpec_vlan [dict get $trafficSpec vlan]
set frameSize [dict get $trafficSpec_l2 framesize]
- set srcMac [dict get $trafficSpec_l2 srcmac]
+ set srcMac [dict get $trafficSpec_l2 srcmac]
set dstMac [dict get $trafficSpec_l2 dstmac]
+ set srcPort [dict get $trafficSpec_l4 srcport]
+ set dstPort [dict get $trafficSpec_l4 dstport]
set proto [dict get $trafficSpec_l3 proto]
set srcIp [dict get $trafficSpec_l3 srcip]
set dstIp [dict get $trafficSpec_l3 dstip]
+ set vlanEnabled [dict get $trafficSpec_vlan enabled]
+ set l3Enabled [dict get $trafficSpec_l3 enabled]
+ set l4Enabled [dict get $trafficSpec_l4 enabled]
- set srcPort [dict get $trafficSpec_l4 srcport]
- set dstPort [dict get $trafficSpec_l4 dstport]
-
- set l3Enabled [dict get $trafficSpec_l3 enabled]
- set l4Enabled [dict get $trafficSpec_l4 enabled]
- set vlanEnabled [dict get $trafficSpec_vlan enabled]
-
- if {$vlanEnabled == 1 } {
- # these keys won't exist if vlan wasn't enabled
- set vlanId [dict get $trafficSpec_vlan id]
- set vlanUserPrio [dict get $trafficSpec_vlan priority]
- set vlanCfi [dict get $trafficSpec_vlan cfi]
- } else {
- set vlanId 0
- set vlanUserPrio 0
- set vlanCfi 0
- }
if {$frameSize < 68 } {
if {$rfc2544TestType == "back2back"} {
@@ -281,7 +276,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-csvLogPollIntervalMultiplier 1 \
-pollInterval 2 \
-guardrailEnabled True \
- -enableCsvLogging False \
+ -enableCsvLogging False\
-dataStorePollingIntervalMultiplier 1 \
-maxNumberOfStatsPerCustomGraph 16 \
-additionalFcoeStat1 fcoeInvalidDelimiter \
@@ -373,7 +368,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-useDefaultRootPath False \
-outputRootPath $::output_dir
sg_commit
- set sg_top [lindex [ixNet remapIds $sg_top] 0]
+ #set sg_top [lindex [ixNet remapIds $sg_top] 0]
set ixNetSG_Stack(0) $sg_top
###
@@ -1154,21 +1149,30 @@ proc startRfc2544Test { testSpec trafficSpec } {
-masterChassis {} \
-sequenceId 1 \
-cableLength 0 \
- -hostname $::chassis
+ -hostname $::chassis_east
+ sg_commit
+ set sg_chassis1 [ixNet add $ixNetSG_Stack(0)/availableHardware chassis]
+ ixNet setMultiAttrs $sg_chassis1 \
+ -masterChassis {} \
+ -sequenceId 2 \
+ -cableLength 0 \
+ -hostname $::chassis_west
sg_commit
set sg_chassis [lindex [ixNet remapIds $sg_chassis] 0]
set ixNetSG_Stack(1) $sg_chassis
+ set sg_chassis1 [lindex [ixNet remapIds $sg_chassis1] 0]
+ set ixNetSG_Stack(4) $sg_chassis1
#
- # configuring the object that corresponds to /availableHardware/chassis/card
+ # configuring the object that corresponds to /availableHardware/chassis/card_east
#
- set sg_card $ixNetSG_Stack(1)/card:$::card
- ixNet setMultiAttrs $sg_card \
+ set sg_card_east $ixNetSG_Stack(1)/card:$::card_east
+ ixNet setMultiAttrs $sg_card_east \
-aggregationMode normal
sg_commit
- set sg_card [lindex [ixNet remapIds $sg_card] 0]
- set ixNetSG_ref(19) $sg_card
- set ixNetSG_Stack(2) $sg_card
+ set sg_card_east [lindex [ixNet remapIds $sg_card_east] 0]
+ set ixNetSG_ref(19) $sg_card_east
+ set ixNetSG_Stack(2) $sg_card_east
#
# configuring the object that corresponds to /availableHardware/chassis/card/aggregation:1
@@ -1206,11 +1210,24 @@ proc startRfc2544Test { testSpec trafficSpec } {
sg_commit
set sg_aggregation [lindex [ixNet remapIds $sg_aggregation] 0]
ixNet setMultiAttrs $ixNetSG_ref(2) \
- -connectedTo $ixNetSG_ref(19)/port:$::port1
+ -connectedTo $ixNetSG_ref(19)/port:$::port_east
sg_commit
+
+ #
+ # configuring the object that corresponds to /availableHardware/chassis/card_west
+ #
+ puts "ixNetSG_Stack(4) is $ixNetSG_Stack(4)"
+ set sg_card_west $ixNetSG_Stack(4)/card:$::card_west
+ ixNet setMultiAttrs $sg_card_west \
+ -aggregationMode normal
+ sg_commit
+ set sg_card_west [lindex [ixNet remapIds $sg_card_west] 0]
+ set ixNetSG_ref(20) $sg_card_west
+ set ixNetSG_Stack(4) $sg_card_west
+
if {$twoPorts} {
ixNet setMultiAttrs $ixNetSG_ref(10) \
- -connectedTo $ixNetSG_ref(19)/port:$::port2
+ -connectedTo $ixNetSG_ref(20)/port:$::port_west
sg_commit
}
sg_commit
@@ -1353,7 +1370,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-destinationMacMode manual
ixNet setMultiAttrs $sg_configElement/frameSize \
-weightedPairs {} \
- -fixedSize 64 \
+ -fixedSize $frameSizeList \
-incrementFrom 64 \
-randomMin 64 \
-randomMax 1518 \
@@ -3080,7 +3097,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
ixNet setMultiAttrs $sg_tracking \
-offset 0 \
-oneToOneMesh False \
- -trackBy {} \
+ -trackBy {trackingenabled0} \
-values {} \
-fieldWidth thirtyTwoBits \
-protocolOffset {Root.0}
@@ -6276,12 +6293,16 @@ proc startRfc2544Test { testSpec trafficSpec } {
#
if {$rfc2544TestType == "throughput"} {
set sg_rfc2544throughput [ixNet add $ixNetSG_Stack(0)/quickTest rfc2544throughput]
+ ixNet commit
ixNet setMultiAttrs $sg_rfc2544throughput \
-name {QuickTest1} \
-mode existingMode \
-inputParameters {{}}
+ ixNet commit
+ set sizes [join $frameSizeList ","]
+ set sg_rfc2544throughput [lindex [ixNet remapIds $sg_rfc2544throughput] 0]
ixNet setMultiAttrs $sg_rfc2544throughput/testConfig \
- -protocolItem {} \
+ -protocolItem [list ] \
-enableMinFrameSize True \
-framesize $frameSize \
-reportTputRateUnit mbps \
@@ -6293,7 +6314,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-tolerance 0 \
-frameLossUnit {0} \
-staggeredStart False \
- -framesizeList $frameSize \
+ -framesizeList $sizes \
-frameSizeMode custom \
-rateSelect percentMaxRate \
-percentMaxRate 100 \
@@ -6318,7 +6339,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-txDelay 2 \
-delayAfterTransmit 2 \
-minRandomFrameSize 64 \
- -maxRandomFrameSize 1518 \
+ -maxRandomFrameSize 128 \
-countRandomFrameSize 1 \
-minIncrementFrameSize 64 \
-stepIncrementFrameSize 64 \
@@ -6415,9 +6436,9 @@ proc startRfc2544Test { testSpec trafficSpec } {
-dataErrorThresholdValue 0 \
-dataErrorThresholdMode average
sg_commit
+ ixNet commit
set sg_rfc2544throughput [lindex [ixNet remapIds $sg_rfc2544throughput] 0]
set ixNetSG_Stack(1) $sg_rfc2544throughput
-
#
# configuring the object that corresponds to /quickTest/rfc2544throughput:1/protocols
#
@@ -6438,6 +6459,12 @@ proc startRfc2544Test { testSpec trafficSpec } {
-includeMode inTest \
-itemType trafficItem
sg_commit
+
+ #
+ # configuring the results folder that corresponds to /quickTest/rfc2544throughput:1
+ #
+ ixNet setAttr $sg_rfc2544throughput -resultPath $output_dir
+ ixNet commit
set sg_trafficSelection [lindex [ixNet remapIds $sg_trafficSelection] 0]
ixNet commit
@@ -6466,7 +6493,7 @@ proc startRfc2544Test { testSpec trafficSpec } {
-tolerance 0 \
-frameLossUnit {0} \
-staggeredStart False \
- -framesizeList $frameSize \
+ -framesizeList [list $frameSize] \
-frameSizeMode custom \
-rateSelect percentMaxRate \
-percentMaxRate 100 \
@@ -6611,14 +6638,74 @@ proc startRfc2544Test { testSpec trafficSpec } {
}
ixNet exec apply $rfc2544test
after 5000
-
#
# starting the RFC2544 Throughput test
#
puts "Starting test..."
ixNet exec start $rfc2544test
+ puts "Checking if [ixNet getA $rfc2544test -name] started...."
+ set count 0
+ while { [ixNet getA $rfc2544test/results -isRunning] eq false } {
+ after 1000
+ if { $count > 60 } { error "QT failed to start after 1 minute" }
+ incr count
+ }
+ puts "Looking for statistics"
+ set results_file_name "Traffic Item Statistics"
+ set results_file_path [getResultFile $results_file_name]
+ return $results_file_path
+}
+
+proc getResultFile { viewName } {
+ global output_dir
+ puts "Sleeping 20 seconds to have $viewName view"
+ after 20000
+ set root [ixNet getRoot]
+ set views [ixNet getList $root/statistics view]
+ foreach view $views {
+ if { [ixNet getA $view -caption] eq $viewName } {
+ set trafficView $view
+ break
+ }
+ }
+ puts "Checking that the $viewName view is ready"
+ set count 0
+ while { [ixNet getA $trafficView/data -isReady] eq false } {
+ after 1000
+ if { $count > 2 } { break }
+ incr count
+ }
+ puts "Success! $viewName view is ready! "
+ puts "Changing the CSV path"
+ set setAttr [ixNet setA $root/statistics -csvFilePath $output_dir]
+ if { $setAttr != "::ixNet::OK"} {
+ error "Error"
+ }
+ ixNet commit
+ puts "Enabling CSV logging"
+ set setAttr [ixNet setA $trafficView -enableCsvLogging True]
+ if { $setAttr != "::ixNet::OK"} {
+ error "Error"
+ }
+ ixNet commit
+ puts "Enabled CSV logging"
+ puts "Getting CSV file name for $trafficView view"
+ set csv_path [ixNet getA $root/statistics -csvFilePath]
+ set csv_name [ixNet getA $trafficView -csvFileName]
+ ixNet commit
+ return [file join $csv_path $csv_name]
}
+proc copyFileResults { sourceFile destFile } {
+ puts "Coping the file $sourceFile to $destFile..."
+ set source [dict get $sourceFile source_file]
+ set dest [dict get $destFile dest_file]
+ if {[catch {ixNet exec copyFile [ixNet readFrom "$source" -ixNetRelative] [ixNet writeTo "$dest" -overwrite]} errMsg]} {
+ error "Error while copying results : '$errMsg'"
+ }
+}
+
+
proc waitForRfc2544Test { } {
# Wait for- and return results of- RFC2544 quicktest.
@@ -6626,7 +6713,14 @@ proc waitForRfc2544Test { } {
puts "Waiting for test to complete..."
set result [ixNet exec waitForTest $rfc2544test]
+ puts "Checking if [ixNet getA $rfc2544test -name] stopped"
+ set count 0
+ while { [ixNet getA $rfc2544test/results -isRunning] eq true } {
+ after 1000
+ if { $count > 60 } { error "QT failed to stop after 1 minute it finished" }
+ incr count
+ }
puts "Finished Test"
return "$result"
-}
+} \ No newline at end of file