mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 10:37:29 +00:00
tests: Check prefix statistics for path-attribute discard/withdraw
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
28e62b46ba
commit
6fb7b3401b
@ -142,6 +142,27 @@ def test_bgp_path_attribute_discard():
|
||||
result is None
|
||||
), "Failed to discard path attributes (atomic-aggregate, community)"
|
||||
|
||||
def _bgp_check_attributes_discarded_stats():
|
||||
output = json.loads(r1.vtysh_cmd("show bgp neighbor json"))
|
||||
expected = {
|
||||
"10.0.0.254": {
|
||||
"prefixStats": {
|
||||
"inboundFiltered": 0,
|
||||
"aspathLoop": 0,
|
||||
"originatorLoop": 0,
|
||||
"clusterLoop": 0,
|
||||
"invalidNextHop": 0,
|
||||
"withdrawn": 0,
|
||||
"attributesDiscarded": 3,
|
||||
}
|
||||
}
|
||||
}
|
||||
return topotest.json_cmp(output, expected)
|
||||
|
||||
test_func = functools.partial(_bgp_check_attributes_discarded_stats)
|
||||
_, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
|
||||
assert result is None, "Discarded path attributes count is not as expected"
|
||||
|
||||
def _bgp_check_if_aigp_invalid_attribute_discarded():
|
||||
output = json.loads(r2.vtysh_cmd("show bgp ipv4 unicast json detail"))
|
||||
expected = {
|
||||
|
@ -134,6 +134,27 @@ def test_bgp_path_attribute_treat_as_withdraw():
|
||||
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
|
||||
assert result is None, "Failed to withdraw prefixes with atomic-aggregate attribute"
|
||||
|
||||
def _bgp_check_attributes_withdrawn_stats():
|
||||
output = json.loads(r2.vtysh_cmd("show bgp neighbor json"))
|
||||
expected = {
|
||||
"10.0.0.1": {
|
||||
"prefixStats": {
|
||||
"inboundFiltered": 0,
|
||||
"aspathLoop": 0,
|
||||
"originatorLoop": 0,
|
||||
"clusterLoop": 0,
|
||||
"invalidNextHop": 0,
|
||||
"withdrawn": 1,
|
||||
"attributesDiscarded": 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
return topotest.json_cmp(output, expected)
|
||||
|
||||
test_func = functools.partial(_bgp_check_attributes_withdrawn_stats)
|
||||
_, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
|
||||
assert result is None, "Withdrawn prefix count is not as expected"
|
||||
|
||||
|
||||
def test_memory_leak():
|
||||
"Run the memory leak test and report results."
|
||||
|
Loading…
Reference in New Issue
Block a user