proc VerifyProtocolSessionStatusUpNgpfHlt { protocolHandle {totalTime 60}} { # protocolHandle: Ethernet handle, IPv4 handle, OSPF handle, etc # IPv4 handle sample: /topology:1/deviceGroup:1/ethernet:1/ipv4:1 # OSPF handle sample: /topology:1/deviceGroup:1/ethernet:1/ipv4:1/ospfv2:1 for {set timer 1} {$timer <= $totalTime} {incr timer} { set sessionStatus [ixiangpf::protocol_info \ -handle $protocolHandle \ -mode "aggregate" \ ] set currentSessionUp [keylget sessionStatus $protocolHandle.aggregate.sessions_up] set totalSessions [keylget sessionStatus $protocolHandle.aggregate.sessions_total] puts "\n$protocolHandle" puts "\t$timer/$totalTime\secs: CurrentSessionUp:$currentSessionUp TotalSessions:$totalSessions" if {$timer < $totalTime && $currentSessionUp != $totalSessions} { after 1000 continue } if {$timer < $totalTime && $currentSessionUp == $totalSessions} { return 0 } if {$timer == $totalTime && $currentSessionUp != $totalSessions} { puts "\nError: It has been $timer seconds and total sessions are not all UP" return 1 } } }