VIAVI TestCenter-Automation: How to verify the actual port speed, after auto negotiation in VIAVI TestCenter?

Knowledge Base - FAQ

VIAVI TestCenter-Automation: How to verify the actual port speed, after auto negotiation in VIAVI TestCenter?
Just run the following as a script in the "Global Services: Run Custom Command" of the GUI Command Sequencer? foreach port [stc::get system1.project -children-port] {     array set result [stc::perform PortSetupGetActivePhy -port $port]     set phy $result(-ActivePhy)     array set result [stc::perform GetObjectInfo -Object $phy]     set objecttype $result(-ObjectType)     # Determine the current link speed.     if { [regexp -nocase {COPPER.EN_US} $objecttype] } {         # This will really only work with copper ports.         set speed [stc::get $phy -LineSpeedStatus]     } else {         switch [string tolower $objecttype] {             ethernet100gigfiber { set speed "SPEED_100G" }             ethernet10gigfiber  { set speed "SPEED_40G"  }             ethernet40gigfiber  { set speed "SPEED_10G"  }             ethernetfiber       { set speed "SPEED_1G"   }             default {                 set speed $objecttype             }         }     }     set portname [stc::get $port -name]     stc::config $port -name "$portname $speed" }