tests: bgp_l3vpn_to_bgp_vrf - add bestpath checks

Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
Lou Berger 2020-09-30 00:09:46 -04:00 committed by Donald Sharp
parent b4bfe0aa47
commit 5df69602e7

View File

@ -286,86 +286,95 @@ bgpribRequireVpnRoutes(
# PE routers: VRFs contain routes from remote customer nets # PE routers: VRFs contain routes from remote customer nets
######################################################################## ########################################################################
want_r1_remote_cust1_routes = [ want_r1_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "3.3.3.3"}, {"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
{"p": "5.1.1.0/24", "n": "3.3.3.3"}, {"p": "5.1.0.0/24", "n": "99.0.0.1", "bp": True},
{"p": "6.0.1.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.2.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "99.0.0.1", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
{"p": "5.1.2.0/24", "n": "4.4.4.4"}, {"p": "5.1.2.0/24", "n": "4.4.4.4"},
{"p": "5.1.3.0/24", "n": "4.4.4.4"}, {"p": "5.1.3.0/24", "n": "4.4.4.4"},
{"p": "99.0.0.3/32", "n": "4.4.4.4"},
{"p": "5.4.2.0/24", "n": "4.4.4.4"}, {"p": "5.4.2.0/24", "n": "4.4.4.4"},
{"p": "5.4.3.0/24", "n": "4.4.4.4"}, {"p": "5.4.3.0/24", "n": "4.4.4.4"},
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "4.4.4.4", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.1", "bp": True},
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.2.0/24", "n": "4.4.4.4", "bp": False},
{"p": "6.0.2.0/24", "n": "99.0.0.1", "bp": True},
{"p": "99.0.0.1/32", "n": "192.168.1.2", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
{"p": "99.0.0.3/32", "n": "4.4.4.4"}, {"p": "99.0.0.3/32", "n": "4.4.4.4"},
{"p": "6.0.1.0/24", "n": "4.4.4.4"}, {"p": "99.0.0.4/32", "n": "4.4.4.4"},
{"p": "6.0.2.0/24", "n": "4.4.4.4"},
{"p": "6.0.1.0/24", "n": "99.0.0.1"},
{"p": "6.0.2.0/24", "n": "99.0.0.1"},
] ]
bgpribRequireUnicastRoutes( bgpribRequireUnicastRoutes(
"r1", "ipv4", "r1-cust1", "Customer 1 routes in r1 vrf (2)", want_r1_remote_cust1_routes "r1", "ipv4", "r1-cust1", "Customer 1 routes in r1 vrf (2)", want_r1_remote_cust1_routes
) , debug=False)
want_r3_remote_cust1_routes = [ want_r3_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "99.0.0.2", "bp": False},
{"p": "99.0.0.1/32", "n": "1.1.1.1"}, {"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "1.1.1.1"}, {"p": "5.1.1.0/24", "n": "99.0.0.2", "bp": False},
{"p": "6.0.2.0/24", "n": "1.1.1.1"}, {"p": "5.1.2.0/24", "n": "4.4.4.4", "bp": True},
{"p": "5.1.2.0/24", "n": "4.4.4.4"}, {"p": "5.1.3.0/24", "n": "4.4.4.4", "bp": True},
{"p": "5.1.3.0/24", "n": "4.4.4.4"}, {"p": "5.4.2.0/24", "n": "4.4.4.4", "bp": True},
{"p": "99.0.0.3/32", "n": "4.4.4.4"}, {"p": "5.4.3.0/24", "n": "4.4.4.4", "bp": True},
{"p": "5.4.2.0/24", "n": "4.4.4.4"}, {"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.4.3.0/24", "n": "4.4.4.4"}, {"p": "6.0.1.0/24", "n": "4.4.4.4", "bp": False},
{"p": "99.0.0.3/32", "n": "4.4.4.4"}, {"p": "6.0.1.0/24", "n": "99.0.0.2", "bp": False},
{"p": "6.0.1.0/24", "n": "4.4.4.4"}, {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "4.4.4.4"}, {"p": "6.0.2.0/24", "n": "4.4.4.4", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.2"}, {"p": "6.0.2.0/24", "n": "99.0.0.2", "bp": False},
{"p": "6.0.2.0/24", "n": "99.0.0.2"}, {"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
{"p": "99.0.0.3/32", "n": "4.4.4.4", "bp": True},
{"p": "99.0.0.4/32", "n": "4.4.4.4", "bp": True},
] ]
bgpribRequireUnicastRoutes( bgpribRequireUnicastRoutes(
"r3", "ipv4", "r3-cust1", "Customer 1 routes in r3 vrf (2)", want_r3_remote_cust1_routes "r3", "ipv4", "r3-cust1", "Customer 1 routes in r3 vrf (2)", want_r3_remote_cust1_routes
) , debug=False)
want_r4_remote_cust1_routes = [ want_r4_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
{"p": "5.1.0.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "1.1.1.1"}, {"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "1.1.1.1"}, {"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "3.3.3.3"}, {"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.2.0/24", "n": "3.3.3.3"}, {"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
{"p": "99.0.0.1/32", "n": "1.1.1.1"}, {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3"}, {"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.3"}, {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.2.0/24", "n": "99.0.0.3"}, {"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.4"}, {"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.4"}, {"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
{"p": "99.0.0.3/32", "n": "192.168.1.2", "bp": True},
{"p": "99.0.0.4/32", "n": "192.168.2.2", "bp": True},
] ]
bgpribRequireUnicastRoutes( bgpribRequireUnicastRoutes(
"r4", "ipv4", "r4-cust1", "Customer 1 routes in r4 vrf (2)", want_r4_remote_cust1_routes "r4", "ipv4", "r4-cust1", "Customer 1 routes in r4 vrf (2)", want_r4_remote_cust1_routes
) , debug=False)
want_r4_remote_cust2_routes = [ want_r4_remote_cust2_routes = [
{"p": "5.1.0.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "1.1.1.1"}, {"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
{"p": "5.1.0.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "3.3.3.3"}, {"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "1.1.1.1"}, {"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "3.3.3.3"}, {"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.2.0/24", "n": "1.1.1.1"}, {"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.2.0/24", "n": "3.3.3.3"}, {"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
{"p": "99.0.0.1/32", "n": "1.1.1.1"}, {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3"}, {"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.3"}, {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.2.0/24", "n": "99.0.0.3"}, {"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.4"}, {"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.4"}, {"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
{"p": "99.0.0.3/32", "n": "192.168.1.2", "bp": True},
{"p": "99.0.0.4/32", "n": "192.168.2.2", "bp": True},
] ]
bgpribRequireUnicastRoutes( bgpribRequireUnicastRoutes(
"r4", "ipv4", "r4-cust2", "Customer 2 routes in r4 vrf (2)", want_r4_remote_cust2_routes "r4", "ipv4", "r4-cust2", "Customer 2 routes in r4 vrf (2)", want_r4_remote_cust2_routes
) , debug=False)
######################################################################### #########################################################################
@ -384,14 +393,16 @@ luCommand(
10, 10,
) )
want = [ want = [
{"p": "5.1.2.0/24", "n": "192.168.1.1"}, {"p": "5.1.0.0/24", "n": "99.0.0.1", "bp": True},
{"p": "5.1.3.0/24", "n": "192.168.1.1"}, {"p": "5.1.1.0/24", "n": "99.0.0.1", "bp": True},
{"p": "5.4.2.0/24", "n": "192.168.1.1"}, {"p": "5.1.2.0/24", "n": "192.168.1.1", "bp": True},
{"p": "5.4.3.0/24", "n": "192.168.1.1"}, {"p": "5.1.3.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "99.0.0.1"}, {"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.1"}, {"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "99.0.0.1", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.1", "bp": True},
] ]
bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes from remote", want) bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
luCommand( luCommand(
"ce2", "ce2",
@ -402,16 +413,20 @@ luCommand(
10, 10,
) )
want = [ want = [
{"p": "5.1.0.0/24", "n": "192.168.1.1"}, {"p": "5.1.0.0/24", "n": "192.168.1.1", "bp": False},
{"p": "5.1.1.0/24", "n": "192.168.1.1"}, {"p": "5.1.0.0/24", "n": "99.0.0.2", "bp": True},
{"p": "5.1.2.0/24", "n": "192.168.1.1"}, {"p": "5.1.1.0/24", "n": "192.168.1.1", "bp": False},
{"p": "5.1.3.0/24", "n": "192.168.1.1"}, {"p": "5.1.1.0/24", "n": "99.0.0.2", "bp": True},
{"p": "5.4.2.0/24", "n": "192.168.1.1"}, {"p": "5.1.2.0/24", "n": "192.168.1.1", "bp": True},
{"p": "5.4.3.0/24", "n": "192.168.1.1"}, {"p": "5.1.3.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "192.168.1.1"}, {"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.2.0/24", "n": "192.168.1.1"}, {"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "192.168.1.1", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.2", "bp": True},
{"p": "6.0.2.0/24", "n": "192.168.1.1", "bp": False},
{"p": "6.0.2.0/24", "n": "99.0.0.2", "bp": True},
] ]
bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 1 routes from remote", want) bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
# human readable output for debugging # human readable output for debugging
luCommand("r4", 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni"') luCommand("r4", 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni"')
@ -430,14 +445,16 @@ luCommand(
) )
# Requires bvl-bug-degenerate-no-label fix (FRR PR #2053) # Requires bvl-bug-degenerate-no-label fix (FRR PR #2053)
want = [ want = [
{"p": "5.1.0.0/24", "n": "192.168.1.1"}, {"p": "5.1.0.0/24", "n": "192.168.1.1", "bp": True},
{"p": "5.1.1.0/24", "n": "192.168.1.1"}, {"p": "5.1.1.0/24", "n": "192.168.1.1", "bp": True},
{"p": "5.4.2.0/24", "n": "192.168.1.1"}, {"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
{"p": "5.4.3.0/24", "n": "192.168.1.1"}, {"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "192.168.1.1"}, {"p": "6.0.1.0/24", "n": "192.168.1.1", "bp": False},
{"p": "6.0.2.0/24", "n": "192.168.1.1"}, {"p": "6.0.2.0/24", "n": "192.168.1.1", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": True},
] ]
bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 1 routes from remote", want) bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
luCommand( luCommand(
"ce4", "ce4",
@ -448,13 +465,15 @@ luCommand(
10, 10,
) )
want = [ want = [
{"p": "5.1.0.0/24", "n": "192.168.2.1"}, {"p": "5.1.0.0/24", "n": "192.168.2.1", "bp": True},
{"p": "5.1.1.0/24", "n": "192.168.2.1"}, {"p": "5.1.1.0/24", "n": "192.168.2.1", "bp": True},
{"p": "5.1.2.0/24", "n": "192.168.2.1"}, {"p": "5.1.2.0/24", "n": "192.168.2.1", "bp": True},
{"p": "5.1.3.0/24", "n": "192.168.2.1"}, {"p": "5.1.3.0/24", "n": "192.168.2.1", "bp": True},
{"p": "6.0.1.0/24", "n": "192.168.2.1"}, {"p": "6.0.1.0/24", "n": "192.168.2.1", "bp": False},
{"p": "6.0.2.0/24", "n": "192.168.2.1"}, {"p": "6.0.2.0/24", "n": "192.168.2.1", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": True},
] ]
bgpribRequireUnicastRoutes( bgpribRequireUnicastRoutes(
"ce4", "ipv4", "ce4-cust2", "Cust 2 routes from remote", want "ce4", "ipv4", "ce4-cust2", "Cust 2 routes from remote", want, debug=False
) )