#!/usr/local/bin/expect -f source ../gated.tcl # pim.tcl defines MIB variables and redefines some function from gated.tcl source pim.tcl # This script tests for correct interoperability with cisco implementations # of PIM-DM. # # This script must be run as root on the control machine and ssh must # be set up all all machines to allow root to connect via ssh without # a password (i.e. a .shosts file must be set up). # # Tests: # - Correct response of cisco to gated join, prune, graft, and assert # messages, and vice versa. # # # N2 N3 # +--- B ---+ # N1 | B1 B2 | N4 # S ----- A -----+ +--- D ------- R # S1 | | D1 D2 R1 # +--- C ---+ # C1 C2 # # Routers A, B, and D are gated routers. # Router C is a cisco router. This test was originally conducted with the # following version info: # # Cisco Internetwork Operating System Software # IOS (tm) 4500 Software (C4500-IS-M), Experimental Version 11.3(19971029:195120) [iwu-pim_v2_f.BLD 1130] # Synced to mainline version: 11.3(0.9)P # Copyright (c) 1986-1997 by cisco Systems, Inc. # Compiled Fri 31-Oct-97 10:54 by iwu # Image text-base: 0x60008910, data-base: 0x606DA000 # # ROM: System Bootstrap, Version 5.2(4) [kmac 4], RELEASE SOFTWARE (fc1) # BOOTFLASH: 4500 Software (C4500-BOOT-M), Version 11.2(2.5), MAINTENANCE INTERIM SOFTWARE # # cisco 4500 (R4K) processor (revision B) with 32768K/4096K bytes of memory. # Processor board ID 01816485 # R4600 processor, Implementation 32, Revision 2.0 # G.703/E1 software, Version 1.0. # Bridging software. # X.25 software, Version 3.0.0. # 4 Ethernet/IEEE 802.3 interface(s) # 1 FDDI network interface(s) # 128K bytes of non-volatile configuration memory. # 4096K bytes of processor board System flash (Read/Write) # 4096K bytes of processor board Boot flash (Read/Write) # # # Cisco Interoperabilty Issues: # - Route preference interoperability during asserts: # Non-default preferences should be assigned to unicast routes where # asserts need to interoperate with cisco. Preference greater than or # equal to cisco prefs (110 for ospf) # # To change cisco: router ospf 223 # distance 10 # interface * # ip ospf cost 1 # # # - Different MRT entry timeout # # # This script should be executed on router A. # # # This section needs to be configured with the machine information # # username for remote actions not requiring root access (e.g. ping) set username kurtw # OSPF area set ospfarea 128.223.163.0 # networks set N1 128.223.163/24 set N2 128.223.91/24 set N3 128.223.227/24 set N4 128.223.226/24 set N1netmask 255.255.255.0 set N2netmask 255.255.255.0 set N3netmask 255.255.255.0 set N4netmask 255.255.255.0 # peabody (sending host) set S 128.223.163.125 set S1 128.223.163.125 # makaha (receiving host) set R 128.223.226.128 set R1 128.223.226.128 # canejo set A 128.223.163.129 set A1 128.223.163.129 set A2 128.223.91.129 # seaside set B 128.223.91.126 set B1 128.223.91.126 set B2 128.223.227.126 # rincon set D 128.223.227.127 set D1 128.223.227.127 set D2 128.223.226.127 # cisco12-gw # NOTE: C2-win and C2-lose must be set such that they will win or lose # the assert election against B2 on N3 (i.e. C2-win > B2 and C2-lose < B2) set C 128.223.91.254 set C1name Ether0 set C1 128.223.91.254 set C2name Ether1 set COSPF_PID 223 ;# The ospf process for 'router ospf <#>' command set C2win 128.223.227.254 set C2lose 128.223.227.2 set Aconfig /root/gated-confs/pimdm_cisco_interop.conf set Agated /home/kurtw/gated-multi/src/gated/gated set Bconfig /root/gated-confs/pimdm_cisco_interop.conf set Bgated /home/kurtw/gated-multi/src/gated/gated set Dconfig /root/gated-confs/pimdm_cisco_interop.conf set Dgated /home/kurtw/gated-multi/src/gated/gated # The cisco should already be configured with OSPF routing and other # basic stuff. This script will configure interface addresses and multicast. # Will need the access and enable passwords: set Cpassword interop set Cenable interop set G1 225.1.1.1 set G2 225.1.1.2 # # Shouldn't need to change anything below here # proc cisco_start {} { global cisco_config_session global C C1 C2 C1name C2name Cpassword Cenable N2netmask N3netmask COSPF_PID spawn telnet $C set cisco_config_session $spawn_id expect { -i $cisco_config_session "Password:" { send "$Cpassword\r" } -re "Operation timed out|eof" { puts "Could not connect to cisco $C for configuration"; close -i $cisco_config_session; return; } } expect -i $cisco_config_session ">" { send "enable\r" } expect -i $cisco_config_session "Password:" { send "$Cenable\r" } expect -i $cisco_config_session "#" { send "clear ip mroute *\r" } expect -i $cisco_config_session "#" { send "config terminal\r" } expect -i $cisco_config_session "(config)#" { send "ip multicast-routing\r" } expect -i $cisco_config_session "(config)#" { send "interface $C1name\r" } expect -i $cisco_config_session "(config-if)#" { send "ip address $C1 $N2netmask\r" } expect -i $cisco_config_session "(config-if)#" { send "ip ospf cost 1\r" } expect -i $cisco_config_session "(config-if)#" { send "ip pim dense-mode\r" } expect -i $cisco_config_session "(config-if)#" { send "ip pim version 2\r" } expect -i $cisco_config_session "(config-if)#" { send "no shutdown\r" } expect -i $cisco_config_session "(config-if)#" { send "interface $C2name\r" } expect -i $cisco_config_session "(config-if)#" { send "ip address $C2 $N3netmask\r" } expect -i $cisco_config_session "(config-if)#" { send "ip ospf cost 1\r" } expect -i $cisco_config_session "(config-if)#" { send "ip pim dense-mode\r" } expect -i $cisco_config_session "(config-if)#" { send "ip pim version 2\r" } expect -i $cisco_config_session "(config-if)#" { send "no shutdown\r" } expect -i $cisco_config_session "(config-if)#" { send "router ospf $COSPF_PID\r" } expect -i $cisco_config_session "(config-router)#" { send "distance 10\r" } expect -i $cisco_config_session "#" { close -i $cisco_config_session } puts "...Done configuring cisco" } proc cisco_stop {} { global cisco_config_session global C C1 C2 C1name C2name Cpassword Cenable N2netmask N3netmask spawn telnet $C set cisco_config_session $spawn_id expect { -i $cisco_config_session "Password:" { send "$Cpassword\r" } -re "Operation timed out|eof" { puts "Could not connect to cisco $C for configuration"; close -i $cisco_config_session; return; } } expect -i $cisco_config_session ">" { send "enable\r" } expect -i $cisco_config_session "Password:" { send "$Cenable\r" } expect -i $cisco_config_session "#" { send "config terminal\r" } expect -i $cisco_config_session "(config)#" { send "interface $C1name\r" } expect -i $cisco_config_session "(config-if)#" { send "no ip pim dense-mode\r" } expect -i $cisco_config_session "(config-if)#" { send "interface $C2name\r" } expect -i $cisco_config_session "(config-if)#" { send "no ip pim dense-mode\r" } expect -i $cisco_config_session "(config-if)#" { close -i $cisco_config_session } puts "...Done configuring cisco" } proc shutdown {} { cleanup exit } proc cleanup {} { global A B D A1 B1 D1 puts "-----------------------------------------------------------------------" puts "Cleaning up..." stop_gated $D stop_gated $B cisco_stop stop_gated $A puts "ok" } foreach C2 "$C2win $C2lose" { # 0) Clean up puts "-----------------------------------------------------------------------" puts "Step 0: Clean up" cleanup # 1) Start gated on routers A, B and C with equal links costs for interfaces # on N1 puts "-----------------------------------------------------------------------" puts "Step 1a: Start gated on router $A with $A1 cost of 1" save_file $A $Aconfig "\ traceoptions \"/var/log/gated.log\" replace size 1m files 4 all;\n\ interfaces { interface all passive; };\n\ router-id $A;\n\ icmp {};\n\ igmp yes {};\n\ ospf yes {\n\ defaults {\n\ ribs unicast multicast;\n\ };\n\ area $ospfarea {\n\ authtype none;\n\ interface lo0 {\n\ priority 5;\n\ enable;\n\ };\n\ interface all {\n\ priority 5;\n\ enable;\n\ };\n\ };\n\ };\n\ pim yes {\n\ dense \"dm0\" { interface all enable; };\n\ };\n\ " if { [start_gated $A $Agated $Aconfig] == 0 } { puts "failed" exit } else { puts "ok" } puts "-----------------------------------------------------------------------" puts "Step 1b: Start gated on router $B with $B1 cost of 1" save_file $B $Bconfig "\ traceoptions \"/var/log/gated.log\" replace size 1m files 4 all;\n\ interfaces { interface all passive; };\n\ router-id $B;\n\ icmp {};\n\ igmp yes {};\n\ ospf yes {\n\ defaults {\n\ ribs unicast multicast;\n\ };\n\ area $ospfarea {\n\ authtype none;\n\ interface lo0 {\n\ priority 5;\n\ enable;\n\ };\n\ interface all {\n\ priority 5;\n\ enable;\n\ };\n\ };\n\ };\n\ pim yes {\n\ dense \"dm0\" { interface all enable; };\n\ };\n\ " if { [start_gated $B $Bgated $Bconfig] == 0 } { puts "failed" exit } else { puts "ok" } puts "-----------------------------------------------------------------------" puts "Step 1c: configure multicast on CISCO router $C" cisco_start puts "-----------------------------------------------------------------------" puts "Step 1d: Start gated on router $D and wait 60 seconds" save_file $D $Dconfig "\ traceoptions \"/var/log/gated.log\" replace size 1m files 4 all;\n\ interfaces { interface all passive; };\n\ router-id $D;\n\ icmp {};\n\ igmp yes {};\n\ ospf yes {\n\ defaults {\n\ ribs unicast multicast;\n\ };\n\ area $ospfarea {\n\ authtype none;\n\ interface all {\n\ priority 5;\n\ enable;\n\ };\n\ };\n\ };\n\ pim yes {\n\ dense \"dm0\" { interface all enable; };\n\ };\n\ " if { [start_gated $D $Dgated $Dconfig] == 0 } { puts "failed" exit } else { puts "ok" } # wait for unicast routes to stablize sleep 60 set AifIndex1 [IP2IntfIndex $A $A1] set AifIndex2 [IP2IntfIndex $A $A2] set BifIndex1 [IP2IntfIndex $B $B1] set BifIndex2 [IP2IntfIndex $B $B2] set CifIndex1 [IP2IntfIndex $C $C1] set CifIndex2 [IP2IntfIndex $C $C2] set DifIndex1 [IP2IntfIndex $D $D1] set DifIndex2 [IP2IntfIndex $D $D2] # 2) Verify that A has established neighbor adjacencies with B and C. puts "-----------------------------------------------------------------------" puts "Step 2: Verify that $A has established neighbor adjacencies with $B and $C" set ret [snmpget $A ${pimNeighborEntry}.2.${B1}] if { $ret == $AifIndex2 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $A ${pimNeighborEntry}.2.${C1}] if { $ret == $AifIndex2 } { puts "ok" } else { puts "failed" exit } # 3) Verify that B has established neighbor adjacencies with A, C, and D. puts "-----------------------------------------------------------------------" puts "Step 3: Verify that $B has established neighbor adjacencies with $A, $C, and $D" set ret [snmpget $B ${pimNeighborEntry}.2.${A2}] if { $ret == $BifIndex1 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $B ${pimNeighborEntry}.2.${C1}] if { $ret == $BifIndex1 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $B ${pimNeighborEntry}.2.${D1}] if { $ret == $BifIndex2 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $B ${pimNeighborEntry}.2.${C2}] if { $ret == $BifIndex2 } { puts "ok" } else { puts "failed" exit } # 4) Verify that C has established neighbor adjacencies with B and C. puts "-----------------------------------------------------------------------" puts "Step 4: Verify that $C has established neighbor adjacencies with $A, $B, and $D" set ret [snmpget $C ${pimNeighborEntry}.2.${A2}] if { $ret == $CifIndex1 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $C ${pimNeighborEntry}.2.${B1}] if { $ret == $CifIndex1 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $C ${pimNeighborEntry}.2.${B2}] if { $ret == $CifIndex2 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $C ${pimNeighborEntry}.2.${D1}] if { $ret == $CifIndex2 } { puts "ok" } else { puts "failed" exit } # 5) Verify that D has established neighbor adjacencies with B and C. puts "-----------------------------------------------------------------------" puts "Step 5: Verify that $D has established neighbor adjacencies with $B and $C" set ret [snmpget $D ${pimNeighborEntry}.2.${B2}] if { $ret == $DifIndex1 } { puts "ok" } else { puts "failed" exit } set ret [snmpget $D ${pimNeighborEntry}.2.${C2}] if { $ret == $DifIndex1 } { puts "ok" } else { puts "failed" exit } # 6) Join group G from host R, and wait 3 second. # This will have no effect on routing since there is no router state for G puts "-----------------------------------------------------------------------" puts -nonewline "Step 6: Join group $G1 from host $R, and wait 3 seconds..." if { [mtest_join $R $username $G1 $R1] == 0 } { puts "join failed" exit } puts "ok" sleep 3 # Since pref and metric to S should be equal, winner is router with # highest IP address. if {[ipaddrcmp $C2 $B2] == -1} { set winner $B set winner_ifaddr $B2 set winner_ifIndex $BifIndex2 set loser $C set loser_ifaddr $C2 set loser_ifIndex $CifIndex2 } else { set winner $C set winner_ifaddr $C2 set winner_ifIndex $CifIndex2 set loser $B set loser_ifaddr $B2 set loser_ifIndex $BifIndex2 } puts "-----------------------------------------------------------------------" puts "Assert winner will be: $winner_ifaddr" # Due to the fact that gated's mbr always triggers a graft when creating # an (S,G) entry with outgoing interfaces (as PIMDM spec), we need to send # two data packets to stabilize the assert state. The first packet will # flood (S,G) state with oifs, triggering grafts on all routers). Then # the assert winner is chosen and the loser prunes. However, if the # graft is recieved by the loser after the loser prunes, the assert loser # will still have forwarding state. But subsequent data packets will # trigger another assert which will prune the losing oif for the remainder # of the assert timeout period. So we send __2__ pings here. # # As of 3/20/98, this should no loner be necessary! # 7) Ping group G from host S, and wait 1 second puts "-----------------------------------------------------------------------" puts -nonewline "Step 7: Ping group $G1 from host $S on interface $S1" set ret [send_ping $S $username $S1 $G1] puts "Wait 6 seconds for assert winner ($winner) to receive join from $C" sleep 6 puts "Then send another ping to stabilize assert state, and wait 10 seconds." set ret [send_ping $S $username $S1 $G1] sleep 10 # 8) Verify that A now has N2 in the oiflist of (S,G). puts "-----------------------------------------------------------------------" puts "Step 8: Verify that $A now has $N2 in the oiflist of ($S,$G1)" puts -nonewline " Querying ipMRouteNextHopState table..." set ret [snmpget $A ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${AifIndex2}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N2 state value $ret" exit } # 9) Verify that the winner now has N3 in the oiflist of (S,G). puts "-----------------------------------------------------------------------" puts "Step 9: Verify that $winner now has $N2 in the oiflist of ($S,$G1)" puts -nonewline " Querying ipMRouteNextHopState table..." set ret [snmpget $winner ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${winner_ifIndex}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N3 state value $ret" exit } # 10) Verify that loser now has empty oiflist for (S,G). puts "-----------------------------------------------------------------------" puts "Step 10: Verify that $loser has ($S,$G1) forwarding state with null oif-list" puts -nonewline " : Querying ${loser}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $loser ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $A2" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${loser}'s ipMRouteNextHopState object..." set ret [snmpget $loser ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${loser_ifIndex}.${G1}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 11) Verify that downstream router now has forwarding state the the winner # as the upstream neighbor. puts "-----------------------------------------------------------------------" puts "Step 11: Verify that $D has assert winner as upstream nbr and $N4 in the oiflist for ($S,$G1)" puts -nonewline " : Querying ${D}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $D ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $winner_ifaddr" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " Querying ${D}'s ipMRouteNextHopState table..." set ret [snmpget $D ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${DifIndex2}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N4 state value $ret" exit } sleep 10 # 12) Leave group G on host R. puts "-----------------------------------------------------------------------" puts "Step 12: Leave group $G1 on host $R and wait 11 seconds for prunes to propogate up" if { [mtest_leave $R $username $G1 $R1] == 0 } { puts "failed" exit } puts "ok" sleep 15 # Now verify the the A is pruned for (S,G) puts "-----------------------------------------------------------------------" puts "Step 13: Verify that $A has ($S,$G1) forwarding state with null oif-list" puts -nonewline " : Querying ${A}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $A ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $S1" || $ret == "IpAddress: 0.0.0.0" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${A}'s ipMRouteNextHopState object..." set ret [snmpget $A ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${AifIndex2}.${G1}] if { $ret == "no_such_variable" || $ret == "1"} { puts "ok" } else { puts "failed with return code $ret" exit } # Now verify the assert winner is pruned for (S,G) puts "-----------------------------------------------------------------------" puts "Step 14: Verify that $winner has ($S,$G1) forwarding state with null oif-list" puts -nonewline " : Querying ${winner}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $winner ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $A2" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${winner}'s ipMRouteNextHopState object..." set ret [snmpget $winner ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${winner_ifIndex}.${G1}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # Now verify the the downstream router, D, is pruned for (S,G) puts "-----------------------------------------------------------------------" puts "Step 15: Verify that $D has ($S,$G1) forwarding state with null oif-list" puts -nonewline " : Querying ${D}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $D ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $winner_ifaddr" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${D}'s ipMRouteNextHopState object..." set ret [snmpget $D ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${DifIndex2}.${G1}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # Now, repeat the assert process with no receivers to be sure that # both upstream routers prune. # 16) Ping group G from host S, and wait 1 second puts "-----------------------------------------------------------------------" puts -nonewline "Step 15: Ping group $G2 from host $S on interface $S1" set ret [send_ping $S $username $S1 $G2] sleep 6 set ret [send_ping $S $username $S1 $G2] puts "-----------------------------------------------------------------------" puts "Wait 15 seconds for assert winner ($winner) to prune $N3" sleep 15 # Now verify the the A is pruned for (S,G) puts "-----------------------------------------------------------------------" puts "Step 17: Verify that $A has ($S,$G2) forwarding state with null oif-list" puts -nonewline " : Querying ${A}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $A ${ipMRouteUpstreamNeighbor}.${G2}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $S1" || $ret == "IpAddress: 0.0.0.0" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${A}'s ipMRouteNextHopState object..." set ret [snmpget $A ${ipMRouteNextHopState}.${G2}.${S1}.255.255.255.255.${AifIndex2}.${G2}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 18) Verify that winner now has empty oiflist for (S,G). puts "-----------------------------------------------------------------------" puts "Step 18: Verify that $winner has ($S,$G2) forwarding state with null oif-list" puts -nonewline " : Querying ${winner}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $winner ${ipMRouteUpstreamNeighbor}.${G2}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $A2" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${winner}'s ipMRouteNextHopState object..." set ret [snmpget $winner ${ipMRouteNextHopState}.${G2}.${S1}.255.255.255.255.${winner_ifIndex}.${G2}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 19) Verify that loser now has empty oiflist for (S,G). puts "-----------------------------------------------------------------------" puts "Step 19: Verify that $loser has ($S,$G2) forwarding state with null oif-list" puts -nonewline " : Querying ${loser}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $loser ${ipMRouteUpstreamNeighbor}.${G2}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $A2" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${loser}'s ipMRouteNextHopState object..." set ret [snmpget $loser ${ipMRouteNextHopState}.${G2}.${S1}.255.255.255.255.${loser_ifIndex}.${G2}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 20) Verify that downstream router now has null oiflist puts "-----------------------------------------------------------------------" puts "Step 20: Verify that $D has assert winner as upstream nbr and null oiflist for ($S,$G2)" puts -nonewline " : Querying ${D}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $D ${ipMRouteUpstreamNeighbor}.${G2}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $winner_ifaddr" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${D}'s ipMRouteNextHopState object..." set ret [snmpget $D ${ipMRouteNextHopState}.${G2}.${S1}.255.255.255.255.${DifIndex2}.${G2}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 21) Join group G from host R, and wait 15 second. # This will have no effect on routing since there is no router state for G puts "-----------------------------------------------------------------------" puts -nonewline "Step 21: Join group $G1 from host $R, and wait 15 seconds..." if { [mtest_join $R $username $G1 $R1] == 0 } { puts "join failed" exit } puts "ok" sleep 15 # 22) Verify that A now has N2 in the oiflist of (S,G). puts "-----------------------------------------------------------------------" puts "Step 22: Verify that $A now has $N2 in the oiflist of ($S,$G1)" puts -nonewline " Querying ipMRouteNextHopState table..." set ret [snmpget $A ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${AifIndex2}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N2 state value $ret" exit } # 23) Verify that the winner now has N3 in the oiflist of (S,G). puts "-----------------------------------------------------------------------" puts "Step 23: Verify that $winner now has $N2 in the oiflist of ($S,$G1)" puts -nonewline " Querying ipMRouteNextHopState table..." set ret [snmpget $winner ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${winner_ifIndex}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N3 state value $ret" exit } # 24) Verify that loser now has empty oiflist for (S,G). puts "-----------------------------------------------------------------------" puts "Step 24: Verify that $loser has ($S,$G1) forwarding state with null oif-list" puts -nonewline " : Querying ${loser}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $loser ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $A2" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " : Querying ${loser}'s ipMRouteNextHopState object..." set ret [snmpget $loser ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${loser_ifIndex}.${G1}] if { $ret == "no_such_variable" || $ret == "1" } { puts "ok" } else { puts "failed with return code $ret" exit } # 25) Verify that downstream router now has forwarding state the the winner # as the upstream neighbor. puts "-----------------------------------------------------------------------" puts "Step 25: Verify that $D has assert winner as upstream nbr and $N4 in the oiflist for ($S,$G1)" puts -nonewline " : Querying ${D}'s ipMRouteUpstreamNeighbor table..." set ret [snmpget $D ${ipMRouteUpstreamNeighbor}.${G1}.${S1}.255.255.255.255 ] if { $ret == "IpAddress: $winner_ifaddr" } { puts "ok" } else { puts "failed with upstream neighbor value $ret" exit } puts -nonewline " Querying ${D}'s ipMRouteNextHopState table..." set ret [snmpget $D ${ipMRouteNextHopState}.${G1}.${S1}.255.255.255.255.${DifIndex2}.${G1}] if { $ret == "2" } { puts "ok" } else { puts "failed with $N4 state value $ret" exit } sleep 330 } ;# foreach C2 # 26) Halt gated on A, B, and D puts "-----------------------------------------------------------------------" puts "Step 26: Halt gated on $A, $B and $D" puts -nonewline "Step 26a: Halt gated on $D..." if { [stop_gated $D] == 0 } { puts "failed" exit } else { puts "ok" } puts "-----------------------------------------------------------------------" puts -nonewline "Step 26b: Halt gated on $B..." if { [stop_gated $B] == 0 } { puts "failed" exit } else { puts "ok" } puts "-----------------------------------------------------------------------" puts -nonewline "Step 26c: Turn off PIM-DM on cisco..." cisco_stop puts "-----------------------------------------------------------------------" puts -nonewline "Step 26d: Halt gated on $A..." if { [stop_gated $A] == 0 } { puts "failed" exit } else { puts "ok" } puts "TEST SUCCESSFULLY COMPLETED!"