]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: fix max med on startup
authorDonald Sharp <sharpd@nvidia.com>
Thu, 7 Sep 2023 12:06:28 +0000 (08:06 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 25 Nov 2024 18:22:32 +0000 (13:22 -0500)
The test is failing because on r2 we are looking for a metric of 777
on startup, but the start of looking for this happens to be after
the 5 second delay that is setup in the config.

On r1:

2023/09/06 17:05:14.999407 BGP: [G822R-SBMNH] config-from-file# router bgp 65001
2023/09/06 17:05:15.003060 BGP: [G822R-SBMNH] config-from-file#   bgp max-med on-startup 5 777
2023/09/06 17:05:15.003342 BGP: [G822R-SBMNH] config-from-file#   no bgp ebgp-requires-policy
2023/09/06 17:05:15.003453 BGP: [G822R-SBMNH] config-from-file#   neighbor 192.168.255.2 remote-as 65001
2023/09/06 17:05:15.004029 BGP: [G822R-SBMNH] config-from-file#   neighbor 192.168.255.2 timers 3 10
2023/09/06 17:05:15.004242 BGP: [G822R-SBMNH] config-from-file#   address-family ipv4 unicast
2023/09/06 17:05:15.004329 BGP: [G822R-SBMNH] config-from-file#     redistribute connected
2023/09/06 17:05:15.005023 BGP: [G822R-SBMNH] config-from-file#   exit-address-family
2023/09/06 17:05:15.005140 BGP: [G822R-SBMNH] config-from-file#   !
2023/09/06 17:05:15.005162 BGP: [G822R-SBMNH] config-from-file# !
2023/09/06 17:05:17.538112 BGP: [M7Q4P-46WDR] vty[25]@> enable
2023/09/06 17:05:17.546700 BGP: [M7Q4P-46WDR] vty[25]@# clear log cmdline-targets
2023/09/06 17:05:17.570635 BGP: [M7Q4P-46WDR] vty[25]@(config)# log commands
2023/09/06 17:05:17.572518 BGP: [M7Q4P-46WDR] vty[25]@(config)# log timestamp precision 6
2023/09/06 17:05:24.982647 BGP: [YNGC8-65JDM] Begin maxmed onstartup mode - timer 5 seconds
2023/09/06 17:05:26.033134 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.255.2 in vrf default
2023/09/06 17:05:29.982960 BGP: [N1747-51Y51] Max med on startup ended - timer expired.

on r2:

2023/09/06 17:05:23.976029 BGP: [G822R-SBMNH] config-from-file# !
2023/09/06 17:05:26.084086 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.255.1 in vrf default
2023/09/06 17:05:27.280103 BGP: [M7Q4P-46WDR] vty[25]@> enable
2023/09/06 17:05:27.290204 BGP: [M7Q4P-46WDR] vty[25]@# clear log cmdline-targets
2023/09/06 17:05:27.328798 BGP: [M7Q4P-46WDR] vty[25]@(config)# log commands
2023/09/06 17:05:27.335032 BGP: [M7Q4P-46WDR] vty[25]@(config)# log timestamp precision 6
2023/09/06 17:05:31.558216 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:31.562482 BGP: [M7Q4P-46WDR] vty[5]@# do show logging
2023/09/06 17:05:32.942204 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:32.946745 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 json
2023/09/06 17:05:34.173879 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:34.178448 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:36.459365 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:36.472019 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:38.557840 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:38.558948 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:40.198563 BGP: [M7Q4P-46WDR] vty[5]@> enable

Notice that the 5 second delay for the max med expires at 29 seconds but the show routes
on r2 does not even begin until 34 seconds, long after the max med has expired and the
test has moved on.

Let's relax the max-med timer to 30 seconds and modify the test to wait a bit longer for
both finding it and expiring timer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/bgp_max_med_on_startup/r1/bgpd.conf
tests/topotests/bgp_max_med_on_startup/test_bgp_max_med_on_startup.py

index 41bf96344ad03c567166d782f9f7efff86120f8f..14f90b859db0626681c50471b738243c674ea75f 100644 (file)
@@ -1,6 +1,6 @@
 !
 router bgp 65001
-  bgp max-med on-startup 5 777
+  bgp max-med on-startup 30 777
   no bgp ebgp-requires-policy
   neighbor 192.168.255.2 remote-as 65001
   neighbor 192.168.255.2 timers 3 10
index 545d7bd245a917a5507a6f62f6a821f5a6eb06ba..12ec88249a96f3554b9672d8eeebadda01067a04 100644 (file)
@@ -82,12 +82,12 @@ def test_bgp_max_med_on_startup():
 
     # Check session is established
     test_func = functools.partial(_bgp_converge, router2)
-    _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1.0)
     assert result is None, "Failed bgp convergence on r2"
 
     # Check metric has value of max-med
     test_func = functools.partial(_bgp_has_routes, router2, 777)
-    _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1.0)
     assert result is None, "r2 does not receive routes with metric 777"
 
     # Check that when the max-med timer expires, metric is updated