Skip to content

Commit aa29d3a

Browse files
authored
Make 'routing/01-locpref' integration test VRF-aware (ipspace#2702)
Implements ipspace#2533
1 parent 256e08a commit aa29d3a

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

tests/integration/routing/01-locpref.yml

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ message: |
44
has to set node-wide local preference on prefixes received from X1 and
55
neighbor-specific local preference on prefixes received from X2.
66
7-
plugin: [ bgp.policy ]
7+
plugin: [ bgp.policy, test.vrf_check ]
88
module: [ bgp, ospf, routing ]
99

1010
defaults.sources.extra: [ defaults-ds.yml, ../wait_times.yml, ../warnings.yml ]
@@ -13,30 +13,47 @@ groups:
1313
probes:
1414
device: frr
1515
provider: clab
16-
members: [ x1, x2, probe ]
16+
members: [ x1, x2, probe, v1, v2, vp ]
17+
ebgp:
18+
members: [ x1, x2, v1, v2, vp ]
19+
module: [ bgp, routing ]
1720

1821
routing.policy:
1922
lp_17:
2023
locpref: 17
2124
lp_42:
2225
locpref: 42
26+
prepend:
27+
prepend.count: 1
28+
29+
vrfs:
30+
customer:
2331

2432
nodes:
2533
dut:
34+
module: [ bgp, ospf, routing, vrf ]
2635
bgp.as: 65000
2736
id: 1
2837
probe:
2938
bgp.as: 65000
3039
x1:
3140
bgp.as: 65100
32-
module: [ bgp ]
3341
loopback.ipv4: 172.42.42.1/24
3442
loopback.ipv6: 2001:db8:cafe:42::1/64
3543
x2:
3644
bgp.as: 65101
37-
module: [ bgp ]
3845
loopback.ipv4: 172.42.43.1/24
3946
loopback.ipv6: 2001:db8:cafe:43::1/64
47+
v1:
48+
bgp.as: 65200
49+
bgp.router_id: 10.0.0.200
50+
loopback.ipv4: 172.42.29.1/24
51+
v2:
52+
bgp.as: 65201
53+
bgp.router_id: 10.0.0.201
54+
loopback.ipv4: 172.42.29.1/24
55+
vp:
56+
bgp.as: 65202
4057

4158
links:
4259
- dut:
@@ -47,11 +64,24 @@ links:
4764
x2:
4865
- dut-probe
4966

67+
- dut: # The VRF locpref test cannot use IBGP, so we'll
68+
vrf: customer # ... accept the same prefix from two VRF EBGP neighbors
69+
bgp.policy.in: lp_17 # ... set low local preference on one with shorter AS path
70+
v1:
71+
- dut:
72+
vrf: customer
73+
bgp.policy.in: lp_42 # ... and high local preference on one with longer AS path
74+
v2:
75+
bgp.policy.out: prepend # ... caused by the prepending on V2
76+
- dut:
77+
vrf: customer
78+
vp: # ... and hoping VP gets the prefix advertised by V1
79+
5080
validate:
5181
ebgp_v4:
5282
description: Check IPv4 EBGP sessions with DUT
5383
wait: ebgp_session
54-
nodes: [ x1, x2 ]
84+
nodes: [ x1, x2, v1, v2, vp ]
5585
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
5686

5787
ibgp_v4:
@@ -119,3 +149,14 @@ validate:
119149
wait: bgp_scan_time
120150
nodes: [ probe ]
121151
plugin: bgp_prefix(nodes.x2.loopback.ipv6,af='ipv6',locpref=42)
152+
153+
vrf_v4_pfx:
154+
description: Check for VRF prefix originated by V1/V2 on VP
155+
wait: bgp_scan_time
156+
nodes: [ vp ]
157+
plugin: bgp_prefix(nodes.v1.loopback.ipv4)
158+
159+
vrf_v4_aspath:
160+
description: Check for the AS path of the V1/V2 prefix preferred by DUT
161+
nodes: [ vp ]
162+
plugin: bgp_prefix(nodes.v1.loopback.ipv4,aspath='65000 65201 65201')

0 commit comments

Comments
 (0)