tests: Check notification/capability received message stats instead of reset/established

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-09-22 15:50:27 +03:00
parent 64b4a93d81
commit fa5783bbab
4 changed files with 35 additions and 14 deletions

View File

@ -1,6 +1,9 @@
! !
!debug bgp neighbor !debug bgp neighbor
! !
int lo
ip address 10.10.10.10/32
!
int r2-eth0 int r2-eth0
ip address 192.168.1.2/24 ip address 192.168.1.2/24
! !
@ -12,4 +15,8 @@ router bgp 65002
neighbor 192.168.1.1 timers 1 3 neighbor 192.168.1.1 timers 1 3
neighbor 192.168.1.1 timers connect 1 neighbor 192.168.1.1 timers connect 1
neighbor 192.168.1.1 capability dynamic neighbor 192.168.1.1 capability dynamic
!
address-family ipv4 unicast
redistribute connected
exit-address-family
! !

View File

@ -80,8 +80,6 @@ def test_bgp_dynamic_capability_graceful_restart():
} }
}, },
}, },
"connectionsEstablished": 1,
"connectionsDropped": 0,
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
@ -96,6 +94,9 @@ def test_bgp_dynamic_capability_graceful_restart():
"Change Graceful-Restart restart-time, LLGR stale-time and check if they changed dynamically" "Change Graceful-Restart restart-time, LLGR stale-time and check if they changed dynamically"
) )
# Clear message stats to check if we receive a notification or not after we
# change the settings fo LLGR.
r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r2.vtysh_cmd( r2.vtysh_cmd(
""" """
configure terminal configure terminal
@ -127,8 +128,10 @@ def test_bgp_dynamic_capability_graceful_restart():
} }
}, },
}, },
"connectionsEstablished": 1, "messageStats": {
"connectionsDropped": 0, "notificationsRecv": 0,
"capabilityRecv": 2,
},
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
@ -145,6 +148,9 @@ def test_bgp_dynamic_capability_graceful_restart():
"Disable Graceful-Restart notification support, and check if it's changed dynamically" "Disable Graceful-Restart notification support, and check if it's changed dynamically"
) )
# Clear message stats to check if we receive a notification or not after we
# change the settings fo LLGR.
r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r2.vtysh_cmd( r2.vtysh_cmd(
""" """
configure terminal configure terminal
@ -175,8 +181,10 @@ def test_bgp_dynamic_capability_graceful_restart():
} }
}, },
}, },
"connectionsEstablished": 1, "messageStats": {
"connectionsDropped": 0, "notificationsRecv": 0,
"capabilityRecv": 1,
},
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)

View File

@ -66,8 +66,6 @@ def test_bgp_dynamic_capability_role():
"neighborCapabilities": { "neighborCapabilities": {
"dynamic": "advertisedAndReceived", "dynamic": "advertisedAndReceived",
}, },
"connectionsEstablished": 1,
"connectionsDropped": 0,
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
@ -80,6 +78,9 @@ def test_bgp_dynamic_capability_role():
step("Set local-role and check if it's exchanged dynamically") step("Set local-role and check if it's exchanged dynamically")
# Clear message stats to check if we receive a notification or not after we
# change the settings fo LLGR.
r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r1.vtysh_cmd( r1.vtysh_cmd(
""" """
configure terminal configure terminal
@ -107,8 +108,10 @@ def test_bgp_dynamic_capability_role():
"dynamic": "advertisedAndReceived", "dynamic": "advertisedAndReceived",
"role": "advertisedAndReceived", "role": "advertisedAndReceived",
}, },
"connectionsEstablished": 1, "messageStats": {
"connectionsDropped": 0, "notificationsRecv": 0,
"capabilityRecv": 1,
},
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)

View File

@ -68,8 +68,6 @@ def test_bgp_dynamic_capability_software_version():
"receivedSoftwareVersion": None, "receivedSoftwareVersion": None,
}, },
}, },
"connectionsEstablished": 1,
"connectionsDropped": 0,
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
@ -82,6 +80,9 @@ def test_bgp_dynamic_capability_software_version():
step("Enable software version capability and check if it's exchanged dynamically") step("Enable software version capability and check if it's exchanged dynamically")
# Clear message stats to check if we receive a notification or not after we
# change the settings fo LLGR.
r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r1.vtysh_cmd( r1.vtysh_cmd(
""" """
configure terminal configure terminal
@ -128,8 +129,10 @@ def test_bgp_dynamic_capability_software_version():
"receivedSoftwareVersion": rcv, "receivedSoftwareVersion": rcv,
}, },
}, },
"connectionsEstablished": 1, "messageStats": {
"connectionsDropped": 0, "notificationsRecv": 0,
"capabilityRecv": 1,
},
} }
} }
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)