Skip to content

Commit

Permalink
topotests: add unified configuration
Browse files Browse the repository at this point in the history
Replace the various per-daemon config files with a unique frr.conf
configuration file.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Dec 20, 2024
1 parent b8fc9f1 commit 5176098
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 67 deletions.
2 changes: 1 addition & 1 deletion tests/topotests/bgp_bmp/test_bgp_bmp_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def setup_module(mod):
"tcpdump -nni r1-eth0 -s 0 -w {} &".format(pcap_file), stdout=None
)

for rname, router in tgen.routers().items():
for _, (rname, router) in enumerate(tgen.routers().items(), 1):
logger.info("Loading router %s" % rname)
router.load_frr_config(
os.path.join(CWD, "{}/frr.conf".format(rname)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
log stdout

hostname r1
password zebra

! debug zebra vxlan
! debug zebra kernel
! debug zebra dplane
! debug zebra rib
! debug bgp neighbor-events
! debug bgp updates
! debug bgp zebra
log stdout
vrf r1-vrf-101
vni 101
exit-vrf
!
interface r1-eth0
ip address 192.168.100.21/24
!
interface loop101 vrf r1-vrf-101
ip address 192.168.102.21/32
ipv6 address fd00::1/128
!
router bgp 65000
bgp router-id 192.168.100.21
bgp log-neighbor-changes
Expand Down Expand Up @@ -40,3 +61,5 @@ exit
route-map rmap_r1 permit 1
match evpn vni 101
exit


23 changes: 0 additions & 23 deletions tests/topotests/bgp_evpn_rt5/r1/zebra.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
log stdout

hostname r2
password zebra

! debug zebra vxlan
! debug bgp neighbor-events
! debug bgp updates
! debug bgp zebra

vrf r2-vrf-101
vni 101
exit-vrf
!
interface loop101 vrf r2-vrf-101
ip address 192.168.101.41/32
ipv6 address fd00::2/128
!
interface r2-eth0
ip address 192.168.100.41/24
!
router bgp 65000
bgp router-id 192.168.100.41
bgp log-neighbor-changes
Expand Down Expand Up @@ -47,3 +65,4 @@ exit
route-map rmap6 deny 2
match ipv6 address acl6_2
exit

19 changes: 0 additions & 19 deletions tests/topotests/bgp_evpn_rt5/r2/zebra.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
! debug bgp neighbor-events
! debug bgp updates
! debug bgp zebra
vrf r3-vrf-102
vni 102
exit-vrf
!
interface r3-eth0
ip address 192.168.100.61/24
!
interface loop102 vrf r3-vrf-102
ip address 192.168.102.61/32
ipv6 address fd00:6::1/128
!
router bgp 65500
bgp router-id 192.168.100.61
bgp log-neighbor-changes
Expand Down Expand Up @@ -29,3 +40,5 @@ router bgp 65000 vrf r3-vrf-102
advertise ipv6 unicast
exit-address-family
!


13 changes: 0 additions & 13 deletions tests/topotests/bgp_evpn_rt5/r3/zebra.conf

This file was deleted.

18 changes: 7 additions & 11 deletions tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,17 @@ def setup_module(mod):
tgen.net["r1"].cmd_raises("ip -n r1-vrf-101 link set bridge-101 up")
tgen.net["r1"].cmd_raises("ip -n r1-vrf-101 link set vxlan-101 up")

for rname, router in router_list.items():
for rname, router in tgen.routers().items():
logger.info("Loading router %s" % rname)
if rname == "r1":
router.load_config(TopoRouter.RD_MGMTD, None, "--vrfwnetns")
router.load_config(
TopoRouter.RD_ZEBRA,
os.path.join(CWD, "{}/zebra.conf".format(rname)),
"--vrfwnetns",
router.load_frr_config(
os.path.join(CWD, "{}/frr.conf".format(rname)),
[(TopoRouter.RD_MGMTD, "--vrfwnetns"), (TopoRouter.RD_ZEBRA, "--vrfwnetns"), (TopoRouter.RD_BGP, None)],
)
else:
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
router.load_frr_config(
os.path.join(CWD, "{}/frr.conf".format(rname))
)
router.load_config(
TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
)

# Initialize all routers.
tgen.start_router()
Expand Down

0 comments on commit 5176098

Please sign in to comment.