diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2025-01-18 22:06:13 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2025-01-18 22:07:37 +0100 |
commit | 3b6dcf03fbfa3475c5b2dc2eb79918213e2cfb76 (patch) | |
tree | 3f386cd076c6c227edeb4a236eccc880449c3719 /tests | |
parent | Merge pull request #17727 from idryzhov/netns-all-daemons (diff) | |
download | frr-3b6dcf03fbfa3475c5b2dc2eb79918213e2cfb76.tar.xz frr-3b6dcf03fbfa3475c5b2dc2eb79918213e2cfb76.zip |
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 <donatas@opensourcerouting.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_enhe.py | 28 |
1 files changed, 1 insertions, 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 aa0508e88..fd467b8c3 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 = { |