From 3b6dcf03fbfa3475c5b2dc2eb79918213e2cfb76 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sat, 18 Jan 2025 23:06:13 +0200 Subject: [PATCH] tests: Fix test_bgp_dynamic_capability_enhe topotest Drop redundant function (duplicate), and reset counters for r2 instead of r1. We check received capabilities on r2, hence we need to flush the counters on r2 too. Fixes: d1cfd730601e5063d126ca1e78be5695fe909a77 ("tests: Check if ENHE capability can be handled dynamically") Signed-off-by: Donatas Abraitis --- .../test_bgp_dynamic_capability_enhe.py | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_enhe.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_enhe.py index aa0508e88f..fd467b8c3b 100644 --- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_enhe.py +++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_enhe.py @@ -114,7 +114,7 @@ def test_bgp_dynamic_capability_enhe(): # Clear message stats to check if we receive a notification or not after we # change the role. - r1.vtysh_cmd("clear bgp 2001:db8::2 message-stats") + r2.vtysh_cmd("clear bgp 2001:db8::1 message-stats") r1.vtysh_cmd( """ configure terminal @@ -149,32 +149,6 @@ def test_bgp_dynamic_capability_enhe(): _, result = topotest.run_and_expect(test_func, None, count=30, wait=1) assert result is None, "Session was reset after setting ENHE capability" - def _bgp_check_if_session_not_reset(): - output = json.loads(r2.vtysh_cmd("show bgp neighbor 2001:db8::1 json")) - expected = { - "2001:db8::1": { - "bgpState": "Established", - "neighborCapabilities": { - "dynamic": "advertisedAndReceived", - "extendedNexthop": "advertisedAndReceived", - "extendedNexthopFamililesByPeer": { - "ipv4Unicast": "recieved", - }, - }, - "messageStats": { - "notificationsRecv": 0, - "capabilityRecv": 1, - }, - } - } - return topotest.json_cmp(output, expected) - - test_func = functools.partial( - _bgp_check_if_session_not_reset, - ) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=1) - assert result is None, "Session was reset after setting ENHE capability" - def _bgp_check_nexthop_enhe(): output = json.loads(r1.vtysh_cmd("show ip route 10.10.10.10/32 json")) expected = { -- 2.39.5