ixCheckLinkState
ixCheckLinkState - checks the link state on a group of ports
SYNOPSIS
ixCheckLinkState portList
DESCRIPTION
The ixCheckLinkState command checks the link state on a group of ports. This command must be called in the beginning of the script to ensure that all links are up before any traffic is transmitted to the DUT.
ARGUMENTS
portList
(By reference) The list of ports in one of the following formats:
one2oneArray, one2manyArray, many2oneArray, many2manyArray
Or a reference to a list. For example, pl after
set pl {{1 1 1} {1 1 2} {1 1 3} {1 1 4}} -or-
set pl {1,1,1 1,1,2 1,1,3 1,1,4}
RETURNS
0
Links on all ports are up.
1
Link on one or more ports is down.
EXAMPLES
package req IxTclHal
set host galaxy
set username user
# Check if we're running on UNIX - connect to the TCL Server
# which must be running on the chassis
if [isUNIX] {
if [ixConnectToTclServer $host] {
ixPuts "Could not connect to $host"
return 1
}
}
# Now connect to the chassis
if [ixConnectToChassis $host] {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis ID to use in port lists
set chassis [ixGetChassisID $host]
set cardA 1
set portA 1
set cardB 1
set portB 2
set portList [list [list $chassis $cardA $portA] [list $chassis $cardB $portB]]
# Login before taking ownership
if [ixLogin $username] {
ixPuts $::ixErrorInfo
return 1
}
# Take ownership of the ports we'll use
if [ixTakeOwnership $portList] {
ixPuts $::ixErrorInfo
return 1
}
map new -type one2one
map config -type one2one
map add $chassis $cardA $portA $chassis $cardB $portB
map add $chassis $cardB $portB $chassis $cardA $portA
port setDefault
port set $chassis $cardA $portA
port set $chassis $cardB $portB
stream setDefault
stream config -dma stopStream
stream config -numFrames 100000
stream set $chassis $cardA $portA 1
stream config -numFrames 200000
stream set $chassis $cardB $portB 1
ixWritePortsToHardware one2oneArray
# wait for write ports to have an effect
after 1000
if {[ixCheckLinkState one2oneArray] != 0} {
ixPuts "One or more links are down"
}
# Let go of the ports that we reserved
ixClearOwnership $portList
# Disconnect from the chassis we're using
ixDisconnectFromChassis $host
# If we're running on UNIX, disconnect from the TCL Server
if [isUNIX] {
ixDisconnectTclServer $host
}