From: G. Paul Ziemba Date: Fri, 23 Feb 2018 01:46:34 +0000 (-0800) Subject: bgp_l3vpn_to_bgp_vrf: assign different RDs to customers on r4 X-Git-Tag: frr-7.1-dev~151^2~100 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1630ad4695876238d6d0e3c9e7f3f713777d531e;p=matthieu%2Ffrr.git bgp_l3vpn_to_bgp_vrf: assign different RDs to customers on r4 Signed-off-by: G. Paul Ziemba --- 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 aa1c2a086d..58c547647a 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/r4/bgpd.conf @@ -31,7 +31,7 @@ router bgp 5227 vrf r4-cust1 vpn-policy ipv4 label 1041 - rd 10:4 + rd 10:41 rt both 52:100 ! nexthop 192.168.1.1 exit @@ -53,7 +53,7 @@ router bgp 5228 vrf r4-cust2 vpn-policy ipv4 label 1042 - rd 10:4 + rd 10:42 #note RT same as r4-cust1 for inter-vrf route leaking rt both 52:100 ! nexthop 192.168.1.1 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 d2dfb07071..d6736c3574 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 @@ -91,7 +91,18 @@ luCommand('r1','vtysh -c "show bgp ipv4 vpn"','Distinguisher: *10:1.*5.1.0.0/24 luCommand('r3','vtysh -c "show bgp ipv4 vpn"','Distinguisher: *10:3.*5.1.0.0/24 *3.3.3.3 .*5.1.1.0/24 *3.3.3.3 .*99.0.0.2/32 *3.3.3.3 ','pass','vrf->vpn routes') -luCommand('r4','vtysh -c "show bgp ipv4 vpn"','Distinguisher: *10:4.*5.1.2.0/24 *4.4.4.4 .*5.1.3.0/24 *4.4.4.4 .*5.4.2.0/24 *4.4.4.4 .*5.4.3.0/24 *4.4.4.4 .*99.0.0.3/32 *4.4.4.4 .*99.0.0.4/32 *4.4.4.4 ','pass','vrf->vpn routes') +#luCommand('r4','vtysh -c "show bgp ipv4 vpn"','Distinguisher: *10:4.*5.1.2.0/24 *4.4.4.4 .*5.1.3.0/24 *4.4.4.4 .*5.4.2.0/24 *4.4.4.4 .*5.4.3.0/24 *4.4.4.4 .*99.0.0.3/32 *4.4.4.4 .*99.0.0.4/32 *4.4.4.4 ','pass','vrf->vpn routes') + +want = [ + {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + + {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'}, +] +bgpribRequireVpnRoutes('r4','vrf->vpn routes',want) ######################################################################## # PE routers: exporting vrfs set MPLS vrf labels in kernel @@ -114,13 +125,13 @@ want_rd_routes = [ {'rd':'10:3', 'p':'5.1.0.0/24', 'n':'3.3.3.3'}, {'rd':'10:3', 'p':'99.0.0.2/32', 'n':'3.3.3.3'}, - {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'}, ] bgpribRequireVpnRoutes('r2','Customer routes in provider vpn core',want_rd_routes) @@ -135,13 +146,13 @@ want_r1_remote_vpn_routes = [ {'rd':'10:3', 'p':'5.1.1.0/24', 'n':'3.3.3.3'}, {'rd':'10:3', 'p':'99.0.0.2/32', 'n':'3.3.3.3'}, - {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'}, ] bgpribRequireVpnRoutes('r1','Remote Customer routes in R1 vpn',want_r1_remote_vpn_routes) @@ -150,13 +161,13 @@ want_r3_remote_vpn_routes = [ {'rd':'10:1', 'p':'5.1.1.0/24', 'n':'1.1.1.1'}, {'rd':'10:1', 'p':'99.0.0.1/32', 'n':'1.1.1.1'}, - {'rd':'10:4', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'5.1.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:41', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, - {'rd':'10:4', 'p':'99.0.0.3/32', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.2.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'5.4.3.0/24', 'n':'4.4.4.4'}, + {'rd':'10:42', 'p':'99.0.0.4/32', 'n':'4.4.4.4'}, ] bgpribRequireVpnRoutes('r3','Remote Customer routes in R3 vpn',want_r3_remote_vpn_routes) diff --git a/tests/topotests/lib/bgprib.py b/tests/topotests/lib/bgprib.py index 39cb0e71f7..9bd038e675 100644 --- a/tests/topotests/lib/bgprib.py +++ b/tests/topotests/lib/bgprib.py @@ -98,8 +98,8 @@ class BgpRib: BgpRib=BgpRib() -def bgpribRequireVpnRoutes(target, title, wantroutes): - BgpRib.RequireVpnRoutes(target, title, wantroutes) +def bgpribRequireVpnRoutes(target, title, wantroutes, debug=0): + BgpRib.RequireVpnRoutes(target, title, wantroutes, debug) -def bgpribRequireUnicastRoutes(target, afi, vrf, title, wantroutes): - BgpRib.RequireUnicastRoutes(target, afi, vrf, title, wantroutes) +def bgpribRequireUnicastRoutes(target, afi, vrf, title, wantroutes, debug=0): + BgpRib.RequireUnicastRoutes(target, afi, vrf, title, wantroutes, debug)