summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-10-26 17:35:52 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2022-12-15 17:10:59 +0100
commitdbb03df84fbd0a27dee18c2ab89e21d052f90a44 (patch)
tree710ad27509212f27a7dcd6b4312d9852920e14f2
parente577535f15b31d3028889d74ce72b34fd6fd8b6e (diff)
tests: fix IGP metric best path selection in bgp_l3vpn_to_bgp_vrf
The L3VPN best path computation now takes into accound the IGP metric. Adapt the bgp_l3vpn_to_bgp_vrf tests so that routes with the best IGP metric are selected when needed. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r--tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py56
1 files changed, 23 insertions, 33 deletions
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 550ff93ea3..1e2758c1c9 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
@@ -339,7 +339,7 @@ luCommand(
luCommand(
"r1",
'vtysh -c "show bgp vrf r1-cust1 ipv4 uni 6.0.1.0/24"',
- "3 available, best",
+ "4 available, best",
"wait",
"Ensure 6.0.1.0 shows up on r1",
10,
@@ -347,7 +347,7 @@ luCommand(
luCommand(
"r1",
'vtysh -c "show bgp vrf r1-cust1 ipv4 uni 6.0.2.0/24"',
- "3 available, best",
+ "4 available, best",
"wait",
"Ensure 6.0.2.0 shows up on r1",
10,
@@ -396,9 +396,9 @@ want_r1_remote_cust1_routes = [
{"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": 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": 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"},
@@ -473,7 +473,7 @@ luCommand(
luCommand(
"r3",
'vtysh -c "show bgp vrf r3-cust1 ipv4 uni 6.0.1.0/24"',
- "3 available, best",
+ "4 available, best",
"wait",
"Ensure 6.0.1.0 shows up on r3",
10,
@@ -481,7 +481,7 @@ luCommand(
luCommand(
"r3",
'vtysh -c "show bgp vrf r3-cust1 ipv4 uni 6.0.2.0/24"',
- "3 available, best",
+ "4 available, best",
"wait",
"Ensure 6.0.2.0 shows up on r3",
10,
@@ -522,9 +522,9 @@ want_r3_remote_cust1_routes = [
{"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
{"p": "6.0.1.0/24", "n": "4.4.4.4", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.2", "bp": False},
- {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
+ {"p": "6.0.2.0/24", "n": "1.1.1.1", "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.2", "bp": False},
+ {"p": "6.0.2.0/24", "n": "99.0.0.2", "bp": True},
{"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},
@@ -611,9 +611,9 @@ want_r4_remote_cust1_routes = [
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
- {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
+ {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": False},
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
- {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": False},
+ {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": False},
{"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
@@ -638,9 +638,9 @@ want_r4_remote_cust2_routes = [
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
- {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": True},
+ {"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": False},
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
- {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": False},
+ {"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": True},
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": False},
{"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
{"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
@@ -721,7 +721,7 @@ luCommand("r4", 'vtysh -c "show ip route vrf r4-cust2"')
luCommand(
"ce3",
'vtysh -c "show bgp ipv4 uni"',
- "12 routes and 14",
+ "12 routes and 13",
"wait",
"Local and remote routes",
10,
@@ -733,7 +733,6 @@ want = [
{"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
{"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.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},
]
@@ -834,45 +833,36 @@ luCommand(
luCommand(
"ce1",
'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
- "2 available, best .*192.168.1.1.* Local.* 99.0.0.1 from 0.0.0.0 .99.0.0.1"
- + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight"
+ "1 available, best .*192.168.1.1.* Local.* 99.0.0.1 from 0.0.0.0 .99.0.0.1"
+ + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .First path received"
+ ".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:11",
"pass",
- "Redundant route 2 details",
+ "Route 2 details",
)
luCommand(
"ce2",
'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
- "2 available, best .*192.168.1.1.* Local.* 99.0.0.2 from 0.0.0.0 .99.0.0.2"
- + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight"
+ "1 available, best .*192.168.1.1.* Local.* 99.0.0.2 from 0.0.0.0 .99.0.0.2"
+ + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .First path received"
+ ".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:12",
"pass",
- "Redundant route 2 details",
+ "Route 2 details",
)
luCommand(
"ce3",
'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
- "2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3"
- + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight"
+ "1 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3"
+ + ".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .First path received"
+ ".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:13",
"pass",
- "Redundant route 2 details",
-)
-luCommand(
- "ce3",
- 'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
- "2 available, best .*192.168.1.1.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1"
- + ".* Origin IGP, metric 100, localpref 100, valid, internal"
- + ".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:11",
- "pass",
- "Redundant route 2 details",
+ "Route 2 details",
)
luCommand(
"ce4",
'vtysh -c "show bgp vrf ce4-cust2 ipv4 6.0.2.0"',
"2 available, best .*192.168.2.1.* Local.* 192.168.2.1 from 192.168.2.1 .192.168.2.1"
+ ".* Origin IGP, metric 100, localpref 100, valid, internal"
- + ".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:11",
+ + ".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:13",
"pass",
"Redundant route 2 details",
)