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 <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2024-11-20 09:22:46 -05:00
parent 2a94de8af2
commit 6a945b4104
7 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
!

View File

@ -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"