Skip to content

Commit

Permalink
topotests: add bgp_vpnv4_gr graceful restart test
Browse files Browse the repository at this point in the history
This test creates a BGP peering with 2 VPNv4 routes that
became staled after the link between the peering becomes down.
- One test checks that the routes are removed on the BGP listener.
Then the recovery re-adds the routes.
- The other test removes one of the two received routes, after
the link is down. Then a recovery happens. The expecation is that
the removed route is removed from the BGP listener, while the
maintained route is kept.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Aug 29, 2023
1 parent 3671f90 commit f6ba066
Show file tree
Hide file tree
Showing 7 changed files with 568 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r1/bgp_ipv4_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"vrfName": "vrf1",
"localAS": 65500,
"routes":
{
"172.31.0.10/32": [
{
"prefix": "172.31.0.10",
"prefixLen": 32,
"network": "172.31.0.10\/32",
"nhVrfName": "default",
"nexthops": [
{
"ip": "192.168.0.2",
"afi": "ipv4",
"used": true
}
]
}
],
"172.31.1.10/32": [
{
"prefix": "172.31.1.10",
"prefixLen": 32,
"network": "172.31.1.10\/32",
"nhVrfName": "default",
"nexthops": [
{
"ip": "192.168.0.2",
"afi": "ipv4",
"used": true
}
]
}
]
}
}
52 changes: 52 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r1/bgp_vpnv4_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"vrfName":"default",
"routerId":"192.0.2.1",
"defaultLocPrf":100,
"localAS":65500,
"routes":{
"routeDistinguishers":{
"444:2":{
"172.31.0.10/32":[
{
"valid":true,
"bestpath":true,
"selectionReason":"First path received",
"pathFrom":"external",
"prefix":"172.31.0.10",
"prefixLen":32,
"network":"172.31.0.10\/32",
"peerId":"192.168.0.2",
"nexthops":[
{
"ip":"192.168.0.2",
"afi":"ipv4",
"used":true
}
]
}
]
},
"444:2":{
"172.31.1.10/32":[
{
"valid":true,
"bestpath":true,
"selectionReason":"First path received",
"pathFrom":"external",
"prefix":"172.31.1.10",
"prefixLen":32,
"network":"172.31.1.10\/32",
"peerId":"192.168.0.2",
"nexthops":[
{
"ip":"192.168.0.2",
"afi":"ipv4",
"used":true
}
]
}
]
}
}
}
}
25 changes: 25 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
router bgp 65500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor 192.168.0.2 remote-as 65501
neighbor 192.168.0.2 timers 10 30
address-family ipv4 unicast
no neighbor 192.168.0.2 activate
exit-address-family
address-family ipv4 vpn
neighbor 192.168.0.2 activate
exit-address-family
!
router bgp 65500 vrf vrf1
bgp router-id 192.0.2.1
address-family ipv4 unicast
label vpn export 101
rd vpn export 444:1
rt vpn both 52:100
export vpn
import vpn
exit-address-family
!
interface r1-eth0
mpls bgp forwarding
!
7 changes: 7 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
log stdout
interface r1-eth1 vrf vrf1
ip address 172.31.0.1/32
!
interface r1-eth0
ip address 192.168.0.1/24
!
29 changes: 29 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r2/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
router bgp 65501
bgp router-id 192.0.2.2
bgp graceful-restart restart-time 15
bgp graceful-restart
no bgp ebgp-requires-policy
neighbor 192.168.0.1 remote-as 65500
neighbor 192.168.0.1 timers 10 30
neighbor 192.168.0.1 timers connect 5
address-family ipv4 unicast
no neighbor 192.168.0.1 activate
exit-address-family
address-family ipv4 vpn
neighbor 192.168.0.1 activate
exit-address-family
!
router bgp 65501 vrf vrf1
bgp router-id 192.0.2.2
address-family ipv4 unicast
redistribute connected
label vpn export 102
rd vpn export 444:2
rt vpn both 52:100
export vpn
import vpn
exit-address-family
!
interface r2-eth0
mpls bgp forwarding
!
10 changes: 10 additions & 0 deletions tests/topotests/bgp_vpnv4_gr/r2/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
log stdout
interface r2-eth2 vrf vrf1
ip address 172.31.1.10/32
!
interface r2-eth1 vrf vrf1
ip address 172.31.0.10/32
!
interface r2-eth0
ip address 192.168.0.2/24
!
Loading

0 comments on commit f6ba066

Please sign in to comment.