From 6a945b41049d36dc3cd41c6ff3d1c03a34d1d49f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 20 Nov 2024 09:22:46 -0500 Subject: [PATCH] tests: zebra_fec_nexthop_resolution improve a) timers are really large preventing convergence in 30 seconds b) The same configuration does not need to be initiated 60 times when things are not working properly. Once is enough. Signed-off-by: Donald Sharp --- .../topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf | 2 ++ .../topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf | 1 + .../topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf | 1 + .../topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf | 1 + .../topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf | 1 + .../topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf | 2 ++ .../test_zebra_fec_nexthop_resolution.py | 9 +++++---- 7 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf index 9d28957d99..ccfec19e9b 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf @@ -1,5 +1,6 @@ ! router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.1 neighbor 192.0.2.3 remote-as 65500 neighbor 192.0.2.3 update-source lo @@ -7,6 +8,7 @@ router bgp 65500 neighbor 192.0.2.7 ttl-security hops 10 neighbor 192.0.2.7 disable-connected-check neighbor 192.0.2.7 update-source lo + neighbor 192.0.2.7 timers connect 5 ! address-family ipv4 unicast network 192.0.2.1/32 diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf index 46d2c9a01d..e02e7a4b29 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf @@ -1,4 +1,5 @@ router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.2 neighbor 192.0.2.1 remote-as 65500 neighbor 192.0.2.1 update-source lo diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf index 060777e7fe..f2b22d7b38 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf @@ -1,4 +1,5 @@ router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.3 neighbor 192.0.2.1 remote-as 65500 neighbor 192.0.2.1 update-source lo diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf index dc052da863..d0f2f468bf 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf @@ -1,5 +1,6 @@ ! router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.4 neighbor 192.0.2.1 remote-as 65500 neighbor 192.0.2.1 ttl-security hops 10 diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf index 1c73154e27..e2401eb1f9 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf @@ -1,4 +1,5 @@ router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.5 neighbor 192.0.2.3 remote-as 65500 neighbor 192.0.2.3 update-source lo diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf index eeda9d9cfa..325124e9f8 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf +++ b/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf @@ -1,10 +1,12 @@ ! router bgp 65500 + timers bgp 3 9 bgp router-id 192.0.2.7 neighbor 192.0.2.1 remote-as 65500 neighbor 192.0.2.1 ttl-security hops 10 neighbor 192.0.2.1 disable-connected-check neighbor 192.0.2.1 update-source lo + neighbor 192.0.2.1 timers connect 5 neighbor 192.0.2.5 remote-as 65500 neighbor 192.0.2.5 update-source lo ! diff --git a/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py b/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py index 984ff3c185..e42070b4d6 100644 --- a/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py +++ b/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py @@ -156,16 +156,17 @@ def test_zebra_fec_nexthop_resolution_bgp(): def _check_bgp_session(): r1 = tgen.gears["r1"] - tgen.gears["r3"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end") - tgen.gears["r3"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end") - tgen.gears["r5"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end") - tgen.gears["r5"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end") output = json.loads(r1.vtysh_cmd("show bgp summary json")) if output["ipv4Unicast"]["peers"]["192.0.2.7"]["state"] == "Established": return None return False + tgen.gears["r3"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end") + tgen.gears["r3"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end") + tgen.gears["r5"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end") + tgen.gears["r5"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end") + test_func1 = functools.partial(_check_bgp_session) _, result1 = topotest.run_and_expect(test_func1, None, count=60, wait=0.5) assert result1 is None, "Failed to verify the fec_nexthop_resolution: bgp session"