From: Lou Berger Date: Thu, 8 Feb 2018 15:16:51 +0000 (-0500) Subject: bgp_l3vpn_to_bgp_vrf: prepend rtr name to vrf name, per Philippe X-Git-Tag: frr-7.1-dev~151^2~129 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=619891344901b60e602a11de2fbd8c743ad893de;p=mirror%2Ffrr.git bgp_l3vpn_to_bgp_vrf: prepend rtr name to vrf name, per Philippe Signed-off-by: Lou Berger --- diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py index beb9bffcc5..8d08ad0260 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py @@ -199,33 +199,33 @@ def ltemplatePreRouterStartHook(): #configure cust1 VRFs & MPLS rtrs = ['r1', 'r3', 'r4'] - cmds = ['ip link add cust1 type vrf table 10', - 'ip ru add oif cust1 table 10', - 'ip ru add iif cust1 table 10', - 'ip link set dev cust1 up'] + cmds = ['ip link add {0}-cust1 type vrf table 10', + 'ip ru add oif {0}-cust1 table 10', + 'ip ru add iif {0}-cust1 table 10', + 'ip link set dev {0}-cust1 up'] for rtr in rtrs: router = tgen.gears[rtr] for cmd in cmds: - cc.doCmd(tgen, rtr, cmd) - cc.doCmd(tgen, rtr, 'ip link set dev {}-eth4 master cust1'.format(rtr)) - intfs = ['cust1', 'lo', rtr+'-eth0', rtr+'-eth4'] + cc.doCmd(tgen, rtr, cmd.format(rtr)) + cc.doCmd(tgen, rtr, 'ip link set dev {0}-eth4 master {0}-cust1'.format(rtr)) + intfs = [rtr+'-cust1', 'lo', rtr+'-eth0', rtr+'-eth4'] for intf in intfs: cc.doCmd(tgen, rtr, 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf)) - logger.info('setup {0} vrf cust1, {0}-eth4. enabled mpls input.'.format(rtr)) + logger.info('setup {0} vrf {0}-cust1, {0}-eth4. enabled mpls input.'.format(rtr)) #configure cust2 VRFs & MPLS rtrs = ['r4'] - cmds = ['ip link add cust2 type vrf table 20', - 'ip ru add oif cust1 table 20', - 'ip ru add iif cust1 table 20', - 'ip link set dev cust2 up'] + cmds = ['ip link add {0}-cust2 type vrf table 20', + 'ip ru add oif {0}-cust1 table 20', + 'ip ru add iif {0}-cust1 table 20', + 'ip link set dev {0}-cust2 up'] for rtr in rtrs: for cmd in cmds: - cc.doCmd(tgen, rtr, cmd) - cc.doCmd(tgen, rtr, 'ip link set dev {}-eth5 master cust2'.format(rtr)) - intfs = ['cust2', rtr+'-eth5'] + cc.doCmd(tgen, rtr, cmd.format(rtr)) + cc.doCmd(tgen, rtr, 'ip link set dev {0}-eth5 master {0}-cust2'.format(rtr)) + intfs = [rtr+'-cust2', rtr+'-eth5'] for intf in intfs: cc.doCmd(tgen, rtr, 'echo 1 > /proc/sys/net/mpls/conf/{}/input'.format(intf)) - logger.info('setup {0} vrf cust2, {0}-eth5. enabled mpls input.'.format(rtr)) + logger.info('setup {0} vrf {0}-cust2, {0}-eth5. enabled mpls input.'.format(rtr)) global InitSuccess if cc.getOutput(): InitSuccess = False diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf index 2f2abb4233..4c3981e850 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf @@ -20,7 +20,7 @@ router bgp 5226 exit-address-family ! #wait for new syntax -# vrf-policy cust1 +# vrf-policy r1-cust1 # label 101 # rd 10:1 # rt both 52:100 @@ -28,11 +28,11 @@ router bgp 5226 # exit-vrf-policy ! !vnc export bgp mode group-nve - !vnc export bgp group-nve group cust1 + !vnc export bgp group-nve group r1-cust1 !vnc redistribute mode resolve-nve !vnc redistribute ipv4 bgp-direct -router bgp 5227 vrf cust1 +router bgp 5227 vrf r1-cust1 bgp router-id 192.168.1.1 neighbor 192.168.1.2 remote-as 5227 neighbor 192.168.1.2 update-source 192.168.1.1 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf index fd14af45e1..81d1af8250 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r3/bgpd.conf @@ -20,7 +20,7 @@ router bgp 5226 exit-address-family ! #wait for new syntax -# vrf-policy cust1 +# vrf-policy r3-cust1 # label 103 # rd 10:3 # rt both 52:100 @@ -28,11 +28,11 @@ router bgp 5226 # exit-vrf-policy ! ! vnc export bgp mode group-nve -! vnc export bgp group-nve group cust1 +! vnc export bgp group-nve group r3-cust1 ! vnc redistribute mode resolve-nve ! vnc redistribute ipv4 bgp-direct ! -router bgp 5227 vrf cust1 +router bgp 5227 vrf r3-cust1 bgp router-id 192.168.1.1 neighbor 192.168.1.2 remote-as 5227 neighbor 192.168.1.2 update-source 192.168.1.1 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf index c125ba1b44..d2b593009f 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf @@ -19,27 +19,27 @@ router bgp 5226 exit-address-family ! #wait for new syntax -# vrf-policy cust1 +# vrf-policy r4-cust1 # label 104 # rd 10:4 # rt both 52:100 #! nexthop 192.168.1.1 # exit-vrf-policy #! -# vrf-policy cust2 +# vrf-policy r4-cust2 # label 104 # rd 10:4 -# #note RT same as cust1 for inter-vrf route leaking +# #note RT same as r4-cust1 for inter-vrf route leaking # rt both 52:100 #! nexthop 192.168.2.1 # exit-vrf-policy ! ! vnc export bgp mode group-nve -! vnc export bgp group-nve group cust1 +! vnc export bgp group-nve group r4-cust2 ! vnc redistribute mode resolve-nve ! vnc redistribute ipv4 bgp-direct ! -router bgp 5227 vrf cust1 +router bgp 5227 vrf r4-cust1 bgp router-id 192.168.1.1 neighbor 192.168.1.2 remote-as 5227 neighbor 192.168.1.2 update-source 192.168.1.1 @@ -50,7 +50,7 @@ router bgp 5227 vrf cust1 neighbor 192.168.1.2 next-hop-self exit-address-family ! -router bgp 5228 vrf cust2 +router bgp 5228 vrf r4-cust2 bgp router-id 192.168.2.1 neighbor 192.168.2.2 remote-as 5228 neighbor 192.168.2.2 update-source 192.168.2.1 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py index f3c70ecbed..19b73d2057 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py @@ -1,7 +1,7 @@ from lutil import luCommand -luCommand('r1','vtysh -c "add vrf cust1 prefix 99.0.0.1/32"','.','none','IP Address') -luCommand('r3','vtysh -c "add vrf cust1 prefix 99.0.0.2/32"','.','none','IP Address') -luCommand('r4','vtysh -c "add vrf cust1 prefix 99.0.0.3/32"','.','none','IP Address') +luCommand('r1','vtysh -c "add vrf r1-cust1 prefix 99.0.0.1/32"','.','none','IP Address') +luCommand('r3','vtysh -c "add vrf r3-cust1 prefix 99.0.0.2/32"','.','none','IP Address') +luCommand('r4','vtysh -c "add vrf r4-cust1 prefix 99.0.0.3/32"','.','none','IP Address') luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','pass','Local Registration') luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','pass','Local Registration') luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','pass','Local Registration') diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py index 5721959884..2ccc945992 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py @@ -24,26 +24,26 @@ if ret != False and found != None: luCommand('r2','ip -M route show','.','pass','See %s as label to r1' % label4r1) luCommand('ce4','ip route add default via 192.168.2.1') luCommand('ce1','ip route add default via 192.168.1.1') - luCommand('r1','ip route add 99.0.0.1 vrf cust1 dev r1-eth4 via 192.168.1.2') - luCommand('r4','ip route add 99.0.0.4 vrf cust2 dev r4-eth4 via 192.168.2.2') - luCommand('r1','ip -M route add 101 dev cust1') - luCommand('r4','ip -M route add 104 dev cust2') - luCommand('r1','ip route add 99.0.0.4/32 vrf cust1 nexthop encap mpls %s/104 via 10.0.1.2 dev r1-eth0'%label4r4) - luCommand('r4','ip route add 99.0.0.1/32 vrf cust2 nexthop encap mpls %s/101 via 10.0.2.2 dev r4-eth0'%label4r1) - luCommand('r1','ip route show vrf cust1','99.0.0.4','pass', 'VRF->MPLS PHP route installed') - luCommand('r4','ip route show vrf cust2','99.0.0.1','pass', 'VRF->MPLS PHP route installed') + luCommand('r1','ip route add 99.0.0.1 vrf r1-cust1 dev r1-eth4 via 192.168.1.2') + luCommand('r4','ip route add 99.0.0.4 vrf r4-cust2 dev r4-eth4 via 192.168.2.2') + luCommand('r1','ip -M route add 101 dev r1-cust1') + luCommand('r4','ip -M route add 104 dev r4-cust2') + luCommand('r1','ip route add 99.0.0.4/32 vrf r1-cust1 nexthop encap mpls %s/104 via 10.0.1.2 dev r1-eth0'%label4r4) + luCommand('r4','ip route add 99.0.0.1/32 vrf r4-cust2 nexthop encap mpls %s/101 via 10.0.2.2 dev r4-eth0'%label4r1) + luCommand('r1','ip route show vrf r1-cust1','99.0.0.4','pass', 'VRF->MPLS PHP route installed') + luCommand('r4','ip route show vrf r4-cust2','99.0.0.1','pass', 'VRF->MPLS PHP route installed') luCommand('r1','ip -M route show','101','MPLS->VRF route installed') luCommand('r4','ip -M route show','104','MPLS->VRF route installed') luCommand('ce1','ping 99.0.0.4 -I 99.0.0.1 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping - l3vpn+zebra case') luCommand('ce4','ping 99.0.0.1 -I 99.0.0.4 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping - l3vpn+zebra case') - luCommand('r1','ip route del 99.0.0.4/32 vrf cust1') - luCommand('r4','ip route del 99.0.0.1/32 vrf cust2') - luCommand('r1','ip route add 99.0.0.4/32 vrf cust1 nexthop encap mpls %s/1004/104 via 10.0.1.2 dev r1-eth0'%label4r4) + luCommand('r1','ip route del 99.0.0.4/32 vrf r1-cust1') + luCommand('r4','ip route del 99.0.0.1/32 vrf r4-cust2') + luCommand('r1','ip route add 99.0.0.4/32 vrf r1-cust1 nexthop encap mpls %s/1004/104 via 10.0.1.2 dev r1-eth0'%label4r4) luCommand('r4','ip -M route add 1004 dev lo') - luCommand('r4','ip route add 99.0.0.1/32 vrf cust2 nexthop encap mpls %s/1001/101 via 10.0.2.2 dev r4-eth0'%label4r1) + luCommand('r4','ip route add 99.0.0.1/32 vrf r4-cust2 nexthop encap mpls %s/1001/101 via 10.0.2.2 dev r4-eth0'%label4r1) luCommand('r1','ip -M route add 1001 dev lo') - luCommand('r1','ip route show vrf cust1','99.0.0.4.*1004/104','pass', 'VRF->MPLS non-PHP route installed') - luCommand('r4','ip route show vrf cust2','99.0.0.1.*1001/101','pass', 'VRF->MPLS non-PHP route installed') + luCommand('r1','ip route show vrf r1-cust1','99.0.0.4.*1004/104','pass', 'VRF->MPLS non-PHP route installed') + luCommand('r4','ip route show vrf r4-cust2','99.0.0.1.*1001/101','pass', 'VRF->MPLS non-PHP route installed') luCommand('r1','ip -M route show','1001','MPLS "non-PHP" route installed') luCommand('r4','ip -M route show','1004','MPLS "non-PHP" route installed') luCommand('ce1','ping 99.0.0.4 -I 99.0.0.1 -c 1',' 0. packet loss','wait','CE->CE (loopback) ping') diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py index dfb86b5bfd..5ab993ece6 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py @@ -3,10 +3,10 @@ luCommand('ce1','vtysh -c "show bgp ipv4 uni"','5.1.0.0/24 .* 5.1.1.0/24 *99.0.0 luCommand('ce2','vtysh -c "show bgp ipv4 uni"','5.1.0.0/24 .* 5.1.1.0/24 *99.0.0.2 .*2 routes and 2','pass','Local routes') luCommand('ce3','vtysh -c "show bgp ipv4 uni"','5.1.2.0/24 .* 5.1.3.0/24 *99.0.0.3 .*2 routes and 2','pass','Local routes') luCommand('ce4','vtysh -c "show bgp ipv4 uni"','5.4.2.0/24 .* 5.4.3.0/24 *99.0.0.4 .*2 routes and 2','pass','Local routes') -luCommand('r1','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.1 .*2 routes and 2','wait','Cust1 unicast routes', 10) -luCommand('r3','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.2 .*2 routes and 2','wait','Cust1 unicast routes', 10) -luCommand('r4','vtysh -c "show bgp vrf cust1 ipv4 uni"','5.1.2.0/24 .*5.1.3.0/24 *99.0.0.3 .*2 routes and 2','wait','Cust1 unicast routes', 10) -luCommand('r4','vtysh -c "show bgp vrf cust2 ipv4 uni"','5.4.2.0/24 .*5.4.3.0/24 *99.0.0.4 .*2 routes and 2','wait','Cust2 unicast routes', 10) +luCommand('r1','vtysh -c "show bgp vrf r1-cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.1 .*2 routes and 2','wait','Cust1 unicast routes', 10) +luCommand('r3','vtysh -c "show bgp vrf r3-cust1 ipv4 uni"','5.1.0.0/24 .*5.1.1.0/24 *99.0.0.2 .*2 routes and 2','wait','Cust1 unicast routes', 10) +luCommand('r4','vtysh -c "show bgp vrf r4-cust1 ipv4 uni"','5.1.2.0/24 .*5.1.3.0/24 *99.0.0.3 .*2 routes and 2','wait','Cust1 unicast routes', 10) +luCommand('r4','vtysh -c "show bgp vrf r4-cust2 ipv4 uni"','5.4.2.0/24 .*5.4.3.0/24 *99.0.0.4 .*2 routes and 2','wait','Cust2 unicast routes', 10) luCommand('r1','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean') luCommand('r2','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean') luCommand('r3','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Core Unicast SAFI clean') diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py index a57a4f3e88..a721cf21bd 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py @@ -1,7 +1,7 @@ from lutil import luCommand -luCommand('r1','vtysh -c "clear vrf cust1 prefix 99.0.0.1/32"','.','none','Cleared VRF route') -luCommand('r3','vtysh -c "clear vrf cust1 prefix 99.0.0.2/32"','.','none','Cleared VRF route') -luCommand('r4','vtysh -c "clear vrf cust1 prefix 99.0.0.3/32"','.','none','Cleared VRF route') +luCommand('r1','vtysh -c "clear vrf r1-cust1 prefix 99.0.0.1/32"','.','none','Cleared VRF route') +luCommand('r3','vtysh -c "clear vrf r3-cust1 prefix 99.0.0.2/32"','.','none','Cleared VRF route') +luCommand('r4','vtysh -c "clear vrf r3-cust1 prefix 99.0.0.3/32"','.','none','Cleared VRF route') luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','fail','Local Registration cleared') luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','fail','Local Registration cleared') luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','fail','Local Registration cleared')