]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: bgp_bmp, use unified configuration
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 18 Nov 2024 20:38:45 +0000 (21:38 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 2 Dec 2024 17:44:50 +0000 (18:44 +0100)
Use unified configuration procedure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 files changed:
tests/topotests/bgp_bmp/r1/bgpd.conf [deleted file]
tests/topotests/bgp_bmp/r1/frr.conf [new file with mode: 0644]
tests/topotests/bgp_bmp/r1/zebra.conf [deleted file]
tests/topotests/bgp_bmp/r1vrf/bgpd.conf [deleted file]
tests/topotests/bgp_bmp/r1vrf/frr.conf [new file with mode: 0644]
tests/topotests/bgp_bmp/r1vrf/zebra.conf [deleted file]
tests/topotests/bgp_bmp/r2/bgpd.conf [deleted file]
tests/topotests/bgp_bmp/r2/frr.conf [new file with mode: 0644]
tests/topotests/bgp_bmp/r2/zebra.conf [deleted file]
tests/topotests/bgp_bmp/r2vrf/bgpd.conf [deleted file]
tests/topotests/bgp_bmp/r2vrf/frr.conf [new file with mode: 0644]
tests/topotests/bgp_bmp/r2vrf/zebra.conf [deleted file]
tests/topotests/bgp_bmp/test_bgp_bmp_1.py
tests/topotests/bgp_bmp/test_bgp_bmp_2.py

diff --git a/tests/topotests/bgp_bmp/r1/bgpd.conf b/tests/topotests/bgp_bmp/r1/bgpd.conf
deleted file mode 100644 (file)
index 485c217..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-router bgp 65501
- bgp router-id 192.168.0.1
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- neighbor 192.168.0.2 remote-as 65502
- neighbor 192:168::2 remote-as 65502
-!
- bmp targets bmp1
-  bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
-   bmp monitor ipv4 unicast pre-policy
-   bmp monitor ipv6 unicast pre-policy
-   bmp monitor ipv4 vpn pre-policy
-   bmp monitor ipv6 vpn pre-policy
-   bmp monitor ipv4 unicast post-policy
-   bmp monitor ipv6 unicast post-policy
-   bmp monitor ipv4 vpn post-policy
-   bmp monitor ipv6 vpn post-policy
-   bmp monitor ipv4 unicast loc-rib
-   bmp monitor ipv6 unicast loc-rib
-   bmp monitor ipv4 vpn loc-rib
-   bmp monitor ipv6 vpn loc-rib
- exit
-!
- address-family ipv4 vpn
-  neighbor 192.168.0.2 activate
-  neighbor 192.168.0.2 soft-reconfiguration inbound
- exit-address-family
- address-family ipv6 vpn
-  neighbor 192:168::2 activate
-  neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
- address-family ipv4 unicast
-  neighbor 192.168.0.2 activate
-  neighbor 192.168.0.2 soft-reconfiguration inbound
-  no neighbor 192:168::2 activate
- exit-address-family
-!
- address-family ipv6 unicast
-  neighbor 192:168::2 activate
-  neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
-!
-router bgp 65501 vrf vrf1
- bgp router_id 192.168.0.1
- bgp log-neighbor-changes
- 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
- address-family ipv6 unicast
-  label vpn export 103
-  rd vpn export 555:1
-  rt vpn both 54:200
-  export vpn
-  import vpn
-  exit-address-family
-exit
diff --git a/tests/topotests/bgp_bmp/r1/frr.conf b/tests/topotests/bgp_bmp/r1/frr.conf
new file mode 100644 (file)
index 0000000..f7cb669
--- /dev/null
@@ -0,0 +1,67 @@
+interface r1-eth0
+ ip address 192.0.2.1/24
+!
+interface r1-eth1
+ ip address 192.168.0.1/24
+ ipv6 address 192:168::1/64
+!
+router bgp 65501
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ neighbor 192.168.0.2 remote-as 65502
+ neighbor 192:168::2 remote-as 65502
+!
+ bmp targets bmp1
+  bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
+   bmp monitor ipv4 unicast pre-policy
+   bmp monitor ipv6 unicast pre-policy
+   bmp monitor ipv4 vpn pre-policy
+   bmp monitor ipv6 vpn pre-policy
+   bmp monitor ipv4 unicast post-policy
+   bmp monitor ipv6 unicast post-policy
+   bmp monitor ipv4 vpn post-policy
+   bmp monitor ipv6 vpn post-policy
+   bmp monitor ipv4 unicast loc-rib
+   bmp monitor ipv6 unicast loc-rib
+   bmp monitor ipv4 vpn loc-rib
+   bmp monitor ipv6 vpn loc-rib
+ exit
+!
+ address-family ipv4 vpn
+  neighbor 192.168.0.2 activate
+  neighbor 192.168.0.2 soft-reconfiguration inbound
+ exit-address-family
+ address-family ipv6 vpn
+  neighbor 192:168::2 activate
+  neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+ address-family ipv4 unicast
+  neighbor 192.168.0.2 activate
+  neighbor 192.168.0.2 soft-reconfiguration inbound
+  no neighbor 192:168::2 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+  neighbor 192:168::2 activate
+  neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+!
+router bgp 65501 vrf vrf1
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ 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
+ address-family ipv6 unicast
+  label vpn export 103
+  rd vpn export 555:1
+  rt vpn both 54:200
+  export vpn
+  import vpn
+  exit-address-family
+exit
diff --git a/tests/topotests/bgp_bmp/r1/zebra.conf b/tests/topotests/bgp_bmp/r1/zebra.conf
deleted file mode 100644 (file)
index 0b523c9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-interface r1-eth0
- ip address 192.0.2.1/24
-!
-interface r1-eth1
- ip address 192.168.0.1/24
- ipv6 address 192:168::1/64
-!
diff --git a/tests/topotests/bgp_bmp/r1vrf/bgpd.conf b/tests/topotests/bgp_bmp/r1vrf/bgpd.conf
deleted file mode 100644 (file)
index 961e204..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-router bgp 65501 vrf vrf1
- bgp router-id 192.168.0.1
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- neighbor 192.168.0.2 remote-as 65502
- neighbor 192:168::2 remote-as 65502
-!
- bmp targets bmp1
-  bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
-   bmp monitor ipv4 unicast pre-policy
-   bmp monitor ipv6 unicast pre-policy
-   bmp monitor ipv4 unicast post-policy
-   bmp monitor ipv6 unicast post-policy
-   bmp monitor ipv4 unicast loc-rib
-   bmp monitor ipv6 unicast loc-rib
- exit
-!
-
- address-family ipv4 unicast
-  neighbor 192.168.0.2 activate
-  neighbor 192.168.0.2 soft-reconfiguration inbound
-  no neighbor 192:168::2 activate
- exit-address-family
-!
- address-family ipv6 unicast
-  neighbor 192:168::2 activate
-  neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
-!
diff --git a/tests/topotests/bgp_bmp/r1vrf/frr.conf b/tests/topotests/bgp_bmp/r1vrf/frr.conf
new file mode 100644 (file)
index 0000000..cb8a7d2
--- /dev/null
@@ -0,0 +1,35 @@
+interface r1vrf-eth0
+ ip address 192.0.2.1/24
+!
+interface r1vrf-eth1
+ ip address 192.168.0.1/24
+ ipv6 address 192:168::1/64
+!
+router bgp 65501 vrf vrf1
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ neighbor 192.168.0.2 remote-as 65502
+ neighbor 192:168::2 remote-as 65502
+!
+ bmp targets bmp1
+  bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
+   bmp monitor ipv4 unicast pre-policy
+   bmp monitor ipv6 unicast pre-policy
+   bmp monitor ipv4 unicast post-policy
+   bmp monitor ipv6 unicast post-policy
+   bmp monitor ipv4 unicast loc-rib
+   bmp monitor ipv6 unicast loc-rib
+ exit
+!
+ address-family ipv4 unicast
+  neighbor 192.168.0.2 activate
+  neighbor 192.168.0.2 soft-reconfiguration inbound
+  no neighbor 192:168::2 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+  neighbor 192:168::2 activate
+  neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_bmp/r1vrf/zebra.conf b/tests/topotests/bgp_bmp/r1vrf/zebra.conf
deleted file mode 100644 (file)
index a242ead..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-interface r1vrf-eth0
- ip address 192.0.2.1/24
-!
-interface r1vrf-eth1
- ip address 192.168.0.1/24
- ipv6 address 192:168::1/64
-!
diff --git a/tests/topotests/bgp_bmp/r2/bgpd.conf b/tests/topotests/bgp_bmp/r2/bgpd.conf
deleted file mode 100644 (file)
index 40e2cd5..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-router bgp 65502
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- no bgp network import-check
- neighbor 192.168.0.1 remote-as 65501
- neighbor 192:168::1 remote-as 65501
-!
- address-family ipv4 unicast
-  neighbor 192.168.0.1 activate
-  no neighbor 192:168::1 activate
-  redistribute connected
- exit-address-family
-!
- address-family ipv4 vpn
-  neighbor 192.168.0.1 activate
- exit-address-family
-!
- address-family ipv6 vpn
-  neighbor 192:168::1 activate
- exit-address-family
-!
- address-family ipv6 unicast
-  neighbor 192:168::1 activate
-  redistribute connected
- exit-address-family
-!
-router bgp 65502 vrf vrf1
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp network import-check
- address-family ipv4 unicast
-  label vpn export 102
-  rd vpn export 444:2
-  rt vpn both 52:100
-  export vpn
-  import vpn
- exit-address-family
- address-family ipv6 unicast
-  label vpn export 105
-  rd vpn export 555:2
-  rt vpn both 54:200
-  export vpn
-  import vpn
- exit-address-family
-exit
diff --git a/tests/topotests/bgp_bmp/r2/frr.conf b/tests/topotests/bgp_bmp/r2/frr.conf
new file mode 100644 (file)
index 0000000..250071f
--- /dev/null
@@ -0,0 +1,54 @@
+interface r2-eth0
+ ip address 192.168.0.2/24
+ ipv6 address 192:168::2/64
+!
+interface r2-eth1
+ ip address 172.31.0.2/24
+ ipv6 address 172:31::2/64
+!
+router bgp 65502
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ no bgp network import-check
+ neighbor 192.168.0.1 remote-as 65501
+ neighbor 192:168::1 remote-as 65501
+!
+ address-family ipv4 unicast
+  neighbor 192.168.0.1 activate
+  no neighbor 192:168::1 activate
+  redistribute connected
+ exit-address-family
+!
+ address-family ipv4 vpn
+  neighbor 192.168.0.1 activate
+ exit-address-family
+!
+ address-family ipv6 vpn
+  neighbor 192:168::1 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+  neighbor 192:168::1 activate
+  redistribute connected
+ exit-address-family
+!
+router bgp 65502 vrf vrf1
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp network import-check
+ address-family ipv4 unicast
+  label vpn export 102
+  rd vpn export 444:2
+  rt vpn both 52:100
+  export vpn
+  import vpn
+ exit-address-family
+ address-family ipv6 unicast
+  label vpn export 105
+  rd vpn export 555:2
+  rt vpn both 54:200
+  export vpn
+  import vpn
+ exit-address-family
+exit
diff --git a/tests/topotests/bgp_bmp/r2/zebra.conf b/tests/topotests/bgp_bmp/r2/zebra.conf
deleted file mode 100644 (file)
index 9d82bfe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-interface r2-eth0
- ip address 192.168.0.2/24
- ipv6 address 192:168::2/64
-!
-interface r2-eth1
- ip address 172.31.0.2/24
- ipv6 address 172:31::2/64
-!
diff --git a/tests/topotests/bgp_bmp/r2vrf/bgpd.conf b/tests/topotests/bgp_bmp/r2vrf/bgpd.conf
deleted file mode 100644 (file)
index 7c8255a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-router bgp 65502
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- no bgp network import-check
- neighbor 192.168.0.1 remote-as 65501
- neighbor 192:168::1 remote-as 65501
-!
- address-family ipv4 unicast
-  neighbor 192.168.0.1 activate
-  no neighbor 192:168::1 activate
-  redistribute connected
- exit-address-family
-!
- address-family ipv6 unicast
-  neighbor 192:168::1 activate
-  redistribute connected
- exit-address-family
-!
diff --git a/tests/topotests/bgp_bmp/r2vrf/frr.conf b/tests/topotests/bgp_bmp/r2vrf/frr.conf
new file mode 100644 (file)
index 0000000..5268190
--- /dev/null
@@ -0,0 +1,27 @@
+interface r2vrf-eth0
+ ip address 192.168.0.2/24
+ ipv6 address 192:168::2/64
+!
+interface r2vrf-eth1
+ ip address 172.31.0.2/24
+ ipv6 address 172:31::2/64
+!
+router bgp 65502
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ no bgp network import-check
+ neighbor 192.168.0.1 remote-as 65501
+ neighbor 192:168::1 remote-as 65501
+!
+ address-family ipv4 unicast
+  neighbor 192.168.0.1 activate
+  no neighbor 192:168::1 activate
+  redistribute connected
+ exit-address-family
+!
+ address-family ipv6 unicast
+  neighbor 192:168::1 activate
+  redistribute connected
+ exit-address-family
+!
diff --git a/tests/topotests/bgp_bmp/r2vrf/zebra.conf b/tests/topotests/bgp_bmp/r2vrf/zebra.conf
deleted file mode 100644 (file)
index 9a8da2d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-interface r2vrf-eth0
- ip address 192.168.0.2/24
- ipv6 address 192:168::2/64
-!
-interface r2vrf-eth1
- ip address 172.31.0.2/24
- ipv6 address 172:31::2/64
-!
index cc7bc31041d9d337b282a38e1264a50496b1fa45..493f357f4b4bc040be72c792856b375defa7461e 100644 (file)
@@ -79,13 +79,10 @@ def setup_module(mod):
         )
 
     for rname, router in tgen.routers().items():
-        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)),
-            "-M bmp",
+        logger.info("Loading router %s" % rname)
+        router.load_frr_config(
+            os.path.join(CWD, "{}/frr.conf".format(rname)),
+            [(TopoRouter.RD_ZEBRA, None), (TopoRouter.RD_BGP, "-M bmp")],
         )
 
     tgen.start_router()
index 97cc98962bb684434c06cad6f2e348929771365d..82d3824a1b93c93c93e218179bce9bff5e79b4ed 100644 (file)
@@ -91,13 +91,10 @@ ip link set r1vrf-eth1 master vrf1
         )
 
     for rname, router in tgen.routers().items():
-        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)),
-            "-M bmp",
+        logger.info("Loading router %s" % rname)
+        router.load_frr_config(
+            os.path.join(CWD, "{}/frr.conf".format(rname)),
+            [(TopoRouter.RD_ZEBRA, None), (TopoRouter.RD_BGP, "-M bmp")],
         )
 
     tgen.start_router()