Adding upstream version 1.4.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
dc7df702ea
commit
7996c81031
166 changed files with 13787 additions and 11959 deletions
|
@ -6,15 +6,19 @@
|
|||
# pylint: disable=C0302
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
import sys
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from anta.models import AntaTest
|
||||
from anta.result_manager.models import AntaTestStatus
|
||||
from anta.tests.bfd import VerifyBFDPeersHealth, VerifyBFDPeersIntervals, VerifyBFDPeersRegProtocols, VerifyBFDSpecificPeers
|
||||
from tests.units.anta_tests import test
|
||||
|
||||
DATA: list[dict[str, Any]] = [
|
||||
{
|
||||
"name": "success",
|
||||
"test": VerifyBFDPeersIntervals,
|
||||
if TYPE_CHECKING:
|
||||
from tests.units.anta_tests import AntaUnitTestDataDict
|
||||
|
||||
DATA: AntaUnitTestDataDict = {
|
||||
(VerifyBFDPeersIntervals, "success"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
|
@ -22,14 +26,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,14 +35,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,11 +49,9 @@ DATA: list[dict[str, Any]] = [
|
|||
{"peer_address": "192.0.255.70", "vrf": "MGMT", "tx_interval": 1200, "rx_interval": 1200, "multiplier": 3},
|
||||
]
|
||||
},
|
||||
"expected": {"result": "success"},
|
||||
"expected": {"result": AntaTestStatus.SUCCESS},
|
||||
},
|
||||
{
|
||||
"name": "success-detection-time",
|
||||
"test": VerifyBFDPeersIntervals,
|
||||
(VerifyBFDPeersIntervals, "success-detection-time"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
|
@ -71,14 +59,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,14 +68,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,11 +82,9 @@ DATA: list[dict[str, Any]] = [
|
|||
{"peer_address": "192.0.255.70", "vrf": "MGMT", "tx_interval": 1200, "rx_interval": 1200, "multiplier": 3, "detection_time": 3600},
|
||||
]
|
||||
},
|
||||
"expected": {"result": "success"},
|
||||
"expected": {"result": AntaTestStatus.SUCCESS},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-peer",
|
||||
"test": VerifyBFDPeersIntervals,
|
||||
(VerifyBFDPeersIntervals, "failure-no-peer"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
|
@ -120,14 +92,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,14 +101,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1200000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 3,
|
||||
"detectTime": 3600000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1200000, "operRxInterval": 1200000, "detectMult": 3, "detectTime": 3600000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,17 +115,9 @@ DATA: list[dict[str, Any]] = [
|
|||
{"peer_address": "192.0.255.70", "vrf": "MGMT", "tx_interval": 1200, "rx_interval": 1200, "multiplier": 3, "detection_time": 3600},
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: CS - Not found",
|
||||
"Peer: 192.0.255.70 VRF: MGMT - Not found",
|
||||
],
|
||||
},
|
||||
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Peer: 192.0.255.7 VRF: CS - Not found", "Peer: 192.0.255.70 VRF: MGMT - Not found"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-incorrect-timers",
|
||||
"test": VerifyBFDPeersIntervals,
|
||||
(VerifyBFDPeersIntervals, "failure-incorrect-timers"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
|
@ -175,14 +125,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1300000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 4,
|
||||
"detectTime": 4000000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1300000, "operRxInterval": 1200000, "detectMult": 4, "detectTime": 4000000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,16 +133,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 120000,
|
||||
"operRxInterval": 120000,
|
||||
"detectMult": 5,
|
||||
"detectTime": 4000000,
|
||||
}
|
||||
}
|
||||
}
|
||||
"peerStats": {"": {"peerStatsDetail": {"operTxInterval": 120000, "operRxInterval": 120000, "detectMult": 5, "detectTime": 4000000}}}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -213,7 +147,7 @@ DATA: list[dict[str, Any]] = [
|
|||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Incorrect Transmit interval - Expected: 1200 Actual: 1300",
|
||||
"Peer: 192.0.255.7 VRF: default - Incorrect Multiplier - Expected: 3 Actual: 4",
|
||||
|
@ -223,9 +157,7 @@ DATA: list[dict[str, Any]] = [
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-incorrect-timers-with-detection-time",
|
||||
"test": VerifyBFDPeersIntervals,
|
||||
(VerifyBFDPeersIntervals, "failure-incorrect-timers-with-detection-time"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
|
@ -233,14 +165,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 1300000,
|
||||
"operRxInterval": 1200000,
|
||||
"detectMult": 4,
|
||||
"detectTime": 4000000,
|
||||
}
|
||||
}
|
||||
"": {"peerStatsDetail": {"operTxInterval": 1300000, "operRxInterval": 1200000, "detectMult": 4, "detectTime": 4000000}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,16 +173,7 @@ DATA: list[dict[str, Any]] = [
|
|||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"peerStatsDetail": {
|
||||
"operTxInterval": 120000,
|
||||
"operRxInterval": 120000,
|
||||
"detectMult": 5,
|
||||
"detectTime": 4000000,
|
||||
}
|
||||
}
|
||||
}
|
||||
"peerStats": {"": {"peerStatsDetail": {"operTxInterval": 120000, "operRxInterval": 120000, "detectMult": 5, "detectTime": 4000000}}}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -271,7 +187,7 @@ DATA: list[dict[str, Any]] = [
|
|||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Incorrect Transmit interval - Expected: 1200 Actual: 1300",
|
||||
"Peer: 192.0.255.7 VRF: default - Incorrect Multiplier - Expected: 3 Actual: 4",
|
||||
|
@ -283,354 +199,149 @@ DATA: list[dict[str, Any]] = [
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "success",
|
||||
"test": VerifyBFDSpecificPeers,
|
||||
(VerifyBFDSpecificPeers, "success"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": {"ipv4Neighbors": {"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132}}}}},
|
||||
"MGMT": {"ipv4Neighbors": {"192.0.255.70": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132}}}}},
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {"bfd_peers": [{"peer_address": "192.0.255.7", "vrf": "default"}, {"peer_address": "192.0.255.70", "vrf": "MGMT"}]},
|
||||
"expected": {"result": "success"},
|
||||
"expected": {"result": AntaTestStatus.SUCCESS},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-peer",
|
||||
"test": VerifyBFDSpecificPeers,
|
||||
(VerifyBFDSpecificPeers, "failure-no-peer"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": {"ipv4Neighbors": {"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132}}}}},
|
||||
"MGMT": {"ipv4Neighbors": {"192.0.255.71": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132}}}}},
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {"bfd_peers": [{"peer_address": "192.0.255.7", "vrf": "CS"}, {"peer_address": "192.0.255.70", "vrf": "MGMT"}]},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: CS - Not found",
|
||||
"Peer: 192.0.255.70 VRF: MGMT - Not found",
|
||||
],
|
||||
},
|
||||
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Peer: 192.0.255.7 VRF: CS - Not found", "Peer: 192.0.255.70 VRF: MGMT - Not found"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-session-down",
|
||||
"test": VerifyBFDSpecificPeers,
|
||||
(VerifyBFDSpecificPeers, "failure-session-down"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "down",
|
||||
"remoteDisc": 108328132,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "down",
|
||||
"remoteDisc": 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": {"ipv4Neighbors": {"192.0.255.7": {"peerStats": {"": {"status": "down", "remoteDisc": 108328132}}}}},
|
||||
"MGMT": {"ipv4Neighbors": {"192.0.255.70": {"peerStats": {"": {"status": "down", "remoteDisc": 0}}}}},
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {"bfd_peers": [{"peer_address": "192.0.255.7", "vrf": "default"}, {"peer_address": "192.0.255.70", "vrf": "MGMT"}]},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Session not properly established - State: down Remote Discriminator: 108328132",
|
||||
"Peer: 192.0.255.70 VRF: MGMT - Session not properly established - State: down Remote Discriminator: 0",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "success",
|
||||
"test": VerifyBFDPeersHealth,
|
||||
(VerifyBFDPeersHealth, "success"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}}
|
||||
},
|
||||
"ipv6Neighbors": {},
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.71": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}}
|
||||
},
|
||||
"ipv6Neighbors": {},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"utcTime": 1703667348.111288,
|
||||
},
|
||||
{"utcTime": 1703667348.111288},
|
||||
],
|
||||
"inputs": {"down_threshold": 2},
|
||||
"expected": {"result": "success"},
|
||||
"expected": {"result": AntaTestStatus.SUCCESS},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-peer",
|
||||
"test": VerifyBFDPeersHealth,
|
||||
(VerifyBFDPeersHealth, "failure-no-peer"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"MGMT": {
|
||||
"ipv6Neighbors": {},
|
||||
"ipv4Neighbors": {},
|
||||
},
|
||||
"default": {
|
||||
"ipv6Neighbors": {},
|
||||
"ipv4Neighbors": {},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"utcTime": 1703658481.8778424,
|
||||
},
|
||||
{"vrfs": {"MGMT": {"ipv6Neighbors": {}, "ipv4Neighbors": {}}, "default": {"ipv6Neighbors": {}, "ipv4Neighbors": {}}}},
|
||||
{"utcTime": 1703658481.8778424},
|
||||
],
|
||||
"inputs": None,
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": ["No IPv4 BFD peers are configured for any VRF"],
|
||||
},
|
||||
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["No IPv4 BFD peers are configured for any VRF"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-session-down",
|
||||
"test": VerifyBFDPeersHealth,
|
||||
(VerifyBFDPeersHealth, "failure-session-down"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "down",
|
||||
"remoteDisc": 0,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.7": {"peerStats": {"": {"status": "down", "remoteDisc": 0, "lastDown": 1703657258.652725, "l3intf": ""}}},
|
||||
"192.0.255.70": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}},
|
||||
},
|
||||
"ipv6Neighbors": {},
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "down",
|
||||
"remoteDisc": 0,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"ipv4Neighbors": {"192.0.255.71": {"peerStats": {"": {"status": "down", "remoteDisc": 0, "lastDown": 1703657258.652725, "l3intf": ""}}}},
|
||||
"ipv6Neighbors": {},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"utcTime": 1703658481.8778424,
|
||||
},
|
||||
{"utcTime": 1703658481.8778424},
|
||||
],
|
||||
"inputs": {},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Session not properly established - State: down Remote Discriminator: 0",
|
||||
"Peer: 192.0.255.71 VRF: MGMT - Session not properly established - State: down Remote Discriminator: 0",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-session-up-disc",
|
||||
"test": VerifyBFDPeersHealth,
|
||||
(VerifyBFDPeersHealth, "failure-session-up-disc"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 0,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "Ethernet2",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 0,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "Ethernet2",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 0, "lastDown": 1703657258.652725, "l3intf": "Ethernet2"}}},
|
||||
"192.0.255.71": {"peerStats": {"": {"status": "up", "remoteDisc": 0, "lastDown": 1703657258.652725, "l3intf": "Ethernet2"}}},
|
||||
},
|
||||
"ipv6Neighbors": {},
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"utcTime": 1703658481.8778424,
|
||||
},
|
||||
{"utcTime": 1703658481.8778424},
|
||||
],
|
||||
"inputs": {},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Session not properly established - State: up Remote Discriminator: 0",
|
||||
"Peer: 192.0.255.71 VRF: default - Session not properly established - State: up Remote Discriminator: 0",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-last-down",
|
||||
"test": VerifyBFDPeersHealth,
|
||||
(VerifyBFDPeersHealth, "failure-last-down"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.71": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.17": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 3940685114,
|
||||
"lastDown": 1703657258.652725,
|
||||
"l3intf": "",
|
||||
}
|
||||
}
|
||||
},
|
||||
"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}},
|
||||
"192.0.255.71": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}},
|
||||
"192.0.255.17": {"peerStats": {"": {"status": "up", "remoteDisc": 3940685114, "lastDown": 1703657258.652725, "l3intf": ""}}},
|
||||
},
|
||||
"ipv6Neighbors": {},
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"utcTime": 1703667348.111288,
|
||||
},
|
||||
{"utcTime": 1703667348.111288},
|
||||
],
|
||||
"inputs": {"down_threshold": 4},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Session failure detected within the expected uptime threshold (3 hours ago)",
|
||||
"Peer: 192.0.255.71 VRF: default - Session failure detected within the expected uptime threshold (3 hours ago)",
|
||||
|
@ -638,42 +349,18 @@ DATA: list[dict[str, Any]] = [
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "success",
|
||||
"test": VerifyBFDPeersRegProtocols,
|
||||
(VerifyBFDPeersRegProtocols, "success"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
"peerStatsDetail": {
|
||||
"role": "active",
|
||||
"apps": ["ospf"],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
"192.0.255.7": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132, "peerStatsDetail": {"role": "active", "apps": ["ospf"]}}}}
|
||||
}
|
||||
},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 108328132,
|
||||
"peerStatsDetail": {
|
||||
"role": "active",
|
||||
"apps": ["bgp"],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
"192.0.255.70": {"peerStats": {"": {"status": "up", "remoteDisc": 108328132, "peerStatsDetail": {"role": "active", "apps": ["bgp"]}}}}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -685,43 +372,16 @@ DATA: list[dict[str, Any]] = [
|
|||
{"peer_address": "192.0.255.70", "vrf": "MGMT", "protocols": ["bgp"]},
|
||||
]
|
||||
},
|
||||
"expected": {"result": "success"},
|
||||
"expected": {"result": AntaTestStatus.SUCCESS},
|
||||
},
|
||||
{
|
||||
"name": "failure",
|
||||
"test": VerifyBFDPeersRegProtocols,
|
||||
(VerifyBFDPeersRegProtocols, "failure"): {
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.7": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"peerStatsDetail": {
|
||||
"role": "active",
|
||||
"apps": ["ospf"],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": {"ipv4Neighbors": {"192.0.255.7": {"peerStats": {"": {"status": "up", "peerStatsDetail": {"role": "active", "apps": ["ospf"]}}}}}},
|
||||
"MGMT": {
|
||||
"ipv4Neighbors": {
|
||||
"192.0.255.70": {
|
||||
"peerStats": {
|
||||
"": {
|
||||
"status": "up",
|
||||
"remoteDisc": 0,
|
||||
"peerStatsDetail": {
|
||||
"role": "active",
|
||||
"apps": ["bgp"],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
"192.0.255.70": {"peerStats": {"": {"status": "up", "remoteDisc": 0, "peerStatsDetail": {"role": "active", "apps": ["bgp"]}}}}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -734,36 +394,21 @@ DATA: list[dict[str, Any]] = [
|
|||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"result": AntaTestStatus.FAILURE,
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - `isis` routing protocol(s) not configured",
|
||||
"Peer: 192.0.255.70 VRF: MGMT - `isis`, `ospf` routing protocol(s) not configured",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-not-found",
|
||||
"test": VerifyBFDPeersRegProtocols,
|
||||
"eos_data": [
|
||||
{
|
||||
"vrfs": {
|
||||
"default": {},
|
||||
"MGMT": {},
|
||||
}
|
||||
}
|
||||
],
|
||||
(VerifyBFDPeersRegProtocols, "failure-not-found"): {
|
||||
"eos_data": [{"vrfs": {"default": {}, "MGMT": {}}}],
|
||||
"inputs": {
|
||||
"bfd_peers": [
|
||||
{"peer_address": "192.0.255.7", "vrf": "default", "protocols": ["isis"]},
|
||||
{"peer_address": "192.0.255.70", "vrf": "MGMT", "protocols": ["isis"]},
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Peer: 192.0.255.7 VRF: default - Not found",
|
||||
"Peer: 192.0.255.70 VRF: MGMT - Not found",
|
||||
],
|
||||
},
|
||||
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Peer: 192.0.255.7 VRF: default - Not found", "Peer: 192.0.255.70 VRF: MGMT - Not found"]},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue