From 1160c390931c750a8b3c1ffb1b22b6d56225d930 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 14 Mar 2025 11:03:57 +0100 Subject: [PATCH] topotests: move bgp_srv6l3vpn_to_bgp_vrf to unified configuration Use the unified configuration for bgp_srv6l3vpn_to_bgp_vrf test. Signed-off-by: Philippe Guibert --- .../bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf | 8 --- .../ce1/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf | 8 --- .../ce2/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf | 8 --- .../ce3/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf | 8 --- .../ce4/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf | 8 --- .../ce5/{zebra.conf => frr.conf} | 7 +-- .../bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf | 8 --- .../ce6/{zebra.conf => frr.conf} | 7 +-- .../r1/{bgpd.conf => frr.conf} | 54 ++++++++++++------ .../bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf | 41 -------------- .../r2/{bgpd.conf => frr.conf} | 56 +++++++++++++------ .../bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf | 41 -------------- .../test_bgp_srv6l3vpn_to_bgp_vrf.py | 10 +--- 17 files changed, 85 insertions(+), 207 deletions(-) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/{zebra.conf => frr.conf} (68%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/{zebra.conf => frr.conf} (68%) rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/{bgpd.conf => frr.conf} (53%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf rename tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/{bgpd.conf => frr.conf} (52%) delete mode 100644 tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf deleted file mode 100644 index 3459796629..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce1 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf index 665808a0e7..e48629cdac 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce1 +frr defaults traditional ! interface eth0 ipv6 address 2001:1::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:1::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf deleted file mode 100644 index 8ed9978749..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce2 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf index cc9b90a3b0..36dc3bd8e9 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce2 +frr defaults traditional ! interface eth0 ipv6 address 2001:2::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:2::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf deleted file mode 100644 index a85d9701c7..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce3 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf index beca0b1211..65e08ce23d 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce3 +frr defaults traditional ! interface eth0 ipv6 address 2001:3::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:3::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf deleted file mode 100644 index 93fb32fd1b..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce4 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf index 7b21074df0..00d1f076e0 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce4 +frr defaults traditional ! interface eth0 ipv6 address 2001:4::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:4::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf deleted file mode 100644 index 2ab6f2d2a7..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce5 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf index b5ad48e709..dd5144bce5 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce5 +frr defaults traditional ! interface eth0 ipv6 address 2001:5::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:5::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf deleted file mode 100644 index e0b6540514..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/bgpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -frr defaults traditional -! -hostname ce6 -password zebra -! -log stdout notifications -log commands -log file bgpd.log diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf similarity index 68% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf index 7d19d9880b..47947dce85 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/zebra.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/frr.conf @@ -1,6 +1,4 @@ -log file zebra.log -! -hostname ce6 +frr defaults traditional ! interface eth0 ipv6 address 2001:6::2/64 @@ -9,6 +7,3 @@ ip forwarding ipv6 forwarding ! ipv6 route ::/0 2001:6::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf similarity index 53% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf index 8079bb0c2a..716369d48a 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/frr.conf @@ -1,23 +1,45 @@ -frr defaults traditional +! debug zebra packet +! debug zebra dplane +! debug zebra kernel +! debug bgp neighbor-events +! debug bgp zebra +! debug bgp vnc verbose +! debug bgp update-groups +! debug bgp updates in +! debug bgp updates out +! debug bgp vpn label +! debug bgp vpn leak-from-vrf +! debug bgp vpn leak-to-vrf +! debug bgp vpn rmap-event ! -bgp send-extra-data zebra +interface eth0 + ipv6 address 2001::1/64 ! -hostname r1 -password zebra +interface eth1 vrf vrf10 + ipv6 address 2001:1::1/64 ! -log stdout notifications -log commands +interface eth2 vrf vrf10 + ipv6 address 2001:3::1/64 ! -!debug bgp neighbor-events -!debug bgp zebra -!debug bgp vnc verbose -!debug bgp update-groups -!debug bgp updates in -!debug bgp updates out -!debug bgp vpn label -!debug bgp vpn leak-from-vrf -!debug bgp vpn leak-to-vrf -!debug bgp vpn rmap-event +interface eth3 vrf vrf20 + ipv6 address 2001:5::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:1:1::/64 func-bits 8 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:2:1::/64 2001::2 +ipv6 route 2001:db8:2:2::/64 2001::2 +ipv6 route 2001:db8:2:3::/64 2001::2 +! +line vty ! router bgp 1 bgp router-id 1.1.1.1 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf deleted file mode 100644 index c84106f2bb..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf +++ /dev/null @@ -1,41 +0,0 @@ -log file zebra.log -! -hostname r1 -password zebra -! -log stdout notifications -log commands -! -! debug zebra packet -! debug zebra dplane -! debug zebra kernel -! -interface eth0 - ipv6 address 2001::1/64 -! -interface eth1 vrf vrf10 - ipv6 address 2001:1::1/64 -! -interface eth2 vrf vrf10 - ipv6 address 2001:3::1/64 -! -interface eth3 vrf vrf20 - ipv6 address 2001:5::1/64 -! -segment-routing - srv6 - locators - locator loc1 - prefix 2001:db8:1:1::/64 func-bits 8 - ! - ! -! -ip forwarding -ipv6 forwarding -! -ipv6 route 2001:db8:2:1::/64 2001::2 -ipv6 route 2001:db8:2:2::/64 2001::2 -ipv6 route 2001:db8:2:3::/64 2001::2 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf similarity index 52% rename from tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf rename to tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf index c2e8530273..38f6bdaeab 100644 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/frr.conf @@ -1,24 +1,46 @@ -frr defaults traditional +! debug zebra packet +! debug zebra dplane +! debug zebra kernel +! debug bgp neighbor-events +! debug bgp zebra +! debug bgp vnc verbose +! debug bgp update-groups +! debug bgp updates in +! debug bgp updates out +! debug bgp updates +! debug bgp vpn label +! debug bgp vpn leak-from-vrf +! debug bgp vpn leak-to-vrf +! debug bgp vpn rmap-event ! -bgp send-extra-data zebra +interface eth0 + ipv6 address 2001::2/64 ! -hostname r2 -password zebra +interface eth1 vrf vrf10 + ipv6 address 2001:2::1/64 ! -log stdout notifications -log commands +interface eth2 vrf vrf20 + ipv6 address 2001:4::1/64 ! -!debug bgp neighbor-events -!debug bgp zebra -!debug bgp vnc verbose -!debug bgp update-groups -!debug bgp updates in -!debug bgp updates out -!debug bgp updates -!debug bgp vpn label -!debug bgp vpn leak-from-vrf -!debug bgp vpn leak-to-vrf -!debug bgp vpn rmap-event +interface eth3 vrf vrf20 + ipv6 address 2001:6::1/64 +! +segment-routing + srv6 + locators + locator loc1 + prefix 2001:db8:2:2::/64 func-bits 8 + ! + ! +! +ip forwarding +ipv6 forwarding +! +ipv6 route 2001:db8:1:1::/64 2001::1 +ipv6 route 2001:db8:1:2::/64 2001::1 +ipv6 route 2001:db8:1:3::/64 2001::1 +! +line vty ! router bgp 2 bgp router-id 2.2.2.2 diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf deleted file mode 100644 index 5c12429ff2..0000000000 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf +++ /dev/null @@ -1,41 +0,0 @@ -log file zebra.log -! -hostname r2 -password zebra -! -log stdout notifications -log commands -! -! debug zebra packet -! debug zebra dplane -! debug zebra kernel -! -interface eth0 - ipv6 address 2001::2/64 -! -interface eth1 vrf vrf10 - ipv6 address 2001:2::1/64 -! -interface eth2 vrf vrf20 - ipv6 address 2001:4::1/64 -! -interface eth3 vrf vrf20 - ipv6 address 2001:6::1/64 -! -segment-routing - srv6 - locators - locator loc1 - prefix 2001:db8:2:2::/64 func-bits 8 - ! - ! -! -ip forwarding -ipv6 forwarding -! -ipv6 route 2001:db8:1:1::/64 2001::1 -ipv6 route 2001:db8:1:2::/64 2001::1 -ipv6 route 2001:db8:1:3::/64 2001::1 -! -line vty -! diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py index a6938668ad..1010bb7bd0 100755 --- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py +++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/test_bgp_srv6l3vpn_to_bgp_vrf.py @@ -92,14 +92,8 @@ def setup_module(mod): tgen.start_topology() router_list = tgen.routers() for rname, router in tgen.routers().items(): - if os.path.exists("{}/{}/setup.sh".format(CWD, rname)): - router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname)) - router.load_config( - TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)) - ) - router.load_config( - TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname)) - ) + logger.info("Loading router %s" % rname) + router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname))) tgen.gears["r1"].run("ip link add vrf10 type vrf table 10") tgen.gears["r1"].run("ip link set vrf10 up") -- 2.39.5