Skip to content

Commit

Permalink
topotests: add bgp_redistribute_table test
Browse files Browse the repository at this point in the history
There is no test that ensures the test of the 'redistribute
table-direct' facility. Add a test that checks that routes
created before and after BGP is started, is correctly imported.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Sep 13, 2023
1 parent 8b8adf2 commit 1838537
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 0 deletions.
Empty file.
8 changes: 8 additions & 0 deletions tests/topotests/bgp_redistribute_table/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
router bgp 65500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor 192.168.0.2 remote-as 65501
address-family ipv4 unicast
neighbor 192.168.0.2 activate
exit-address-family
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"172.31.0.2/32": [
{
"prefix": "172.31.0.2/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
],
"172.31.0.10/32": [
{
"prefix": "172.31.0.10/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
],
"172.31.0.15/32": [
{
"prefix": "172.31.0.15/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"172.31.0.2/32": [
{
"prefix": "172.31.0.2/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
],
"172.31.0.10/32": [
{
"prefix": "172.31.0.10/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"172.31.0.2/32": [
{
"prefix": "172.31.0.2/32",
"prefixLen": 32,
"protocol": "bgp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 20,
"metric": 0,
"installed": true,
"nexthops": [
{
"fib": true,
"ip": "192.168.0.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": true,
"weight": 1
}
]
}
]
}
7 changes: 7 additions & 0 deletions tests/topotests/bgp_redistribute_table/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
log stdout
interface r1-eth1
ip address 172.31.0.1/32
!
interface r1-eth0
ip address 192.168.0.1/24
!
10 changes: 10 additions & 0 deletions tests/topotests/bgp_redistribute_table/r2/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
router bgp 65501
bgp router-id 192.0.2.2
no bgp ebgp-requires-policy
neighbor 192.168.0.1 remote-as 65500
address-family ipv4 unicast
network 172.31.0.2/32
neighbor 192.168.0.1 activate
redistribute table-direct 2200
exit-address-family
!
8 changes: 8 additions & 0 deletions tests/topotests/bgp_redistribute_table/r2/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
log stdout
interface r2-eth0
ip address 192.168.0.2/24
!
interface r2-eth1
ip address 172.31.0.2/32
ip address 172.31.1.2/24
!
Loading

0 comments on commit 1838537

Please sign in to comment.