test_peering1.sh
来自「BCAST Implementation for NS2」· Shell 代码 · 共 884 行 · 第 1/2 页
SH
884 行
echo " 1) Send an update packet on an IBGP peer with no local pref twice" echo " 2) This is not an error. Our BGP emits a warnings" PACKET='packet update origin 1 aspath 1 nexthop 20.20.20.20 nlri 10.10.10.0/24 nlri 20.20.20.20/24' reset coord peer1 establish AS $AS holdtime 0 id 192.150.187.100 coord peer1 assert established coord peer1 expect packet notify $UPDATEMSGERR $MISSWATTR coord peer1 send $PACKET coord peer1 send $PACKET sleep 2 coord peer1 assert queue 1 coord peer1 assert established}test14(){ echo "TEST14 - Send an update packet on an EBGP peer twice" PACKET="packet update origin 1 aspath $PEER2_AS nexthop 20.20.20.20 nlri 10.10.10.0/24 nlri 20.20.20.20/24" coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established coord peer1 expect packet notify $UPDATEMSGERR $MISSWATTR coord peer1 send $PACKET coord peer1 send $PACKET sleep 2 coord peer1 assert queue 1 coord peer1 assert established}test15(){ echo "TEST15 - Establish a connection drop the peering and establish again" for i in 1 2 do coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established done}test16(){ echo "TEST16 - Send two update packets on an EBGP peer with local pref set" # Local preference should not be set on an update packet from an EBGP peer. coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET_1="packet update origin 1 aspath $PEER2_AS nexthop 20.20.20.20 localpref 100 nlri 10.10.10.0/16" PACKET_2="packet update origin 1 aspath $PEER2_AS,2 nexthop 20.20.20.20 localpref 100 nlri 30.30.30.0/24" coord peer1 send $PACKET_1 coord peer1 send $PACKET_2 # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1}test17(){ echo "TEST17 - Send an update packet with a repeated NLRI." coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET="packet update origin 1 aspath $PEER2_AS nexthop 20.20.20.20 nlri 30.30.30.0/24 nlri 30.30.30.0/24" coord peer1 send $PACKET # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1}test18(){ echo "TEST18 - Send two update packets on an EBGP peer." coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET_1="packet update origin 1 aspath $PEER2_AS nexthop 20.20.20.20 nlri 10.10.10.0/16" PACKET_2="packet update origin 1 aspath $PEER2_AS,2 nexthop 20.20.20.20 nlri 30.30.30.0/24" coord peer1 send $PACKET_1 coord peer1 send $PACKET_2 # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1 # Make a new connection. sleep 2 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established}test19(){ echo "TEST19 - EBGP peer update packet then different withdraw" coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET_1='packet update origin 1 aspath 1 nexthop 20.20.20.20 nlri 10.10.10.0/16' PACKET_2='packet update withdraw 30.30.30.0/24' #coord peer1 send $PACKET_1 coord peer1 send $PACKET_2 # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1 sleep 2 # Make a new connection. coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 sleep 2 coord peer1 assert established}test20(){ echo "TEST20 - EBGP peer single withdraw" coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET='packet update withdraw 30.30.30.0/24' coord peer1 send $PACKET # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1 sleep 2 # Make a new connection. coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 sleep 2 coord peer1 assert established}test21(){ echo "TEST21 - EBGP peer update packet then corresponding withdraw" coord reset coord target $HOST $PORT2 coord initialise attach peer1 coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 coord peer1 assert established PACKET_1="packet update origin 1 aspath $PEER2_AS nexthop 20.20.20.20 nlri 10.10.10.0/16" PACKET_2='packet update withdraw 10.10.10.0/16' coord peer1 send $PACKET_1 coord peer1 send $PACKET_2 # Make sure that the session still exists. sleep 2 coord peer1 assert established # Reset the connection coord reset coord target $HOST $PORT2 coord initialise attach peer1 sleep 2 # Make a new connection. coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 sleep 2 coord peer1 assert established}test22(){ echo "TEST22 - EBGP Establish an IPV6 peering" coord reset coord target $HOST $PORT3 coord initialise attach peer1 coord peer1 establish AS $PEER3_AS holdtime 0 id 192.150.187.100 ipv6 true coord peer1 assert established}test23(){ echo "TEST23" echo " 1) Establish an IBGP IPV6 peering" echo " 2) Send an IPv6 only update packet" coord reset coord target $HOST $PORT3 coord initialise attach peer1 coord peer1 establish AS $PEER3_AS holdtime 0 id 192.150.187.100 ipv6 true PACKET="packet update origin 1 aspath 1,2,(3,4,5),6,(7,8),9 nexthop6 20:20:20:20:20:20:20:20 nlri6 2000::/3 localpref 100" coord peer1 send $PACKET coord peer1 assert established}test24(){ echo "TEST24" echo " 1) Establish an EBGP IPV6 peering" echo " 2) Send an IPv6 only update packet" coord reset coord target $HOST $PORT4 coord initialise attach peer1 coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true PACKET="packet update origin 1 aspath $PEER4_AS nexthop6 20:20:20:20:20:20:20:20 nlri6 2000::/3" coord peer1 send $PACKET coord peer1 assert established}test25(){ echo "TEST25" echo " 1) Establish an EBGP IPV6 peering" echo " 2) Send an IPv4 and IPv6 update packet" coord reset coord target $HOST $PORT4 coord initialise attach peer1 coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true PACKET="packet update origin 1 aspath $PEER4_AS nexthop 20.20.20.20 nlri 10.10.10.0/24 nexthop6 20:20:20:20:20:20:20:20 nlri6 2000::/3" coord peer1 send $PACKET coord peer1 assert established}test26(){ echo "TEST26" echo " 1) Establish an EBGP IPV6 peering" echo " 2) Send an IPv4 and IPv6 update packet repeat both nexthops" coord reset coord target $HOST $PORT4 coord initialise attach peer1 coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true PACKET="packet update origin 1 aspath $PEER4_AS nexthop 20.20.20.20 nexthop 20.20.20.20 nlri 10.10.10.0/24 nexthop6 20:20:20:20:20:20:20:20 nexthop6 20:20:20:20:20:20:20:20 nlri6 2000::/3" coord peer1 expect packet notify $UPDATEMSGERR $MALATTRLIST coord peer1 send $PACKET sleep 2 coord peer1 assert queue 0 coord peer1 assert idle}TESTS_NOT_FIXED=''TESTS='test1 test2 test3 test4 test5 test6 test7 test8 test8_ipv6 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 test22 test23 test24 test25 test26'# Include command line. ${srcdir}/args.shif [ $START_PROGRAMS = "yes" ]thenCXRL="$CALLXRL -r 10" ../../utils/runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF ../../libxipc/xorp_finder ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name ./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name ./coord = $CXRL finder://coord/common/0.1/get_target_nameEOF trap '' 0 exit $?fiif [ $CONFIGURE = "yes" ]then configure_bgpfifor i in $TESTSdo# Temporary fix to let TCP sockets created by call_xrl pass through TIME_WAIT TIME_WAIT=`time_wait_seconds` echo "Waiting $TIME_WAIT seconds for TCP TIME_WAIT state timeout" sleep $TIME_WAIT $idone# Local Variables:# mode: shell-script# sh-indentation: 4# End:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?