]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: add a new topotest to bgp_aigp 17149/head
authorEnke Chen <enchen@paloaltonetworks.com>
Wed, 16 Oct 2024 18:19:28 +0000 (11:19 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 17 Oct 2024 05:57:12 +0000 (05:57 +0000)
Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 51612593f7f747d0003a48a41367be87d3ea5361)

tests/topotests/bgp_aigp/r4/bgpd.conf
tests/topotests/bgp_aigp/r6/zebra.conf
tests/topotests/bgp_aigp/test_bgp_aigp.py

index e12c45e0bb06c78d18aa43aa67b6d3d259bcd0e4..2cdf84a1b38b74b18e1bee6dcb37db47feebcf3b 100644 (file)
@@ -13,9 +13,16 @@ router bgp 65001
  neighbor 10.0.0.6 update-source lo
  address-family ipv4
   redistribute connected route-map connected-to-bgp
+  redistribute ospf route-map ospf-to-bgp
   neighbor 192.168.24.2 route-map set-nexthop out
  exit-address-family
 !
+ip prefix-list p66 seq 5 permit 10.0.6.6/32
+!
+route-map ospf-to-bgp permit 10
+ match ip address prefix-list p66
+ set aigp igp-metric
+!
 ! Two OSPF domains should be isolated - otherwise the connected routes
 ! on r4 would be advertised to r3 (via r4 -> r6 -> r5 -> r3), and can
 ! mess up bgp bestpath calculation (igp metrics for the BGP nexthops).
index f8ca5f8b825f27d13c6f64978bcf48cbe77192cb..b6456cacc5ac875ecbd26b47c5dbce889f0fa60b 100644 (file)
@@ -1,6 +1,7 @@
 !
 interface lo
  ip address 10.0.0.6/32
+ ip address 10.0.6.6/32
 !
 interface r6-eth0
  ip address 192.168.46.6/24
index 108b19c4a5c456eaa4b7f9267bd3acd3c5fdc009..27a4d9ec74f1d7f2deb3119d5a65989e7d708405 100644 (file)
@@ -228,6 +228,11 @@ def test_bgp_aigp():
     """
     )
 
+    # r4, 10.0.6.6/32 with aigp-metric 20
+    test_func = functools.partial(_bgp_check_aigp_metric, r4, "10.0.6.6/32", 20)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
+    assert result is None, "aigp-metric for 10.0.6.6/32 is not 20"
+
     # r4, 10.0.0.71/32 with aigp-metric 71
     test_func = functools.partial(_bgp_check_aigp_metric, r4, "10.0.0.71/32", 71)
     _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)