Adding upstream version 1.3.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
6fd6eb426a
commit
dc7df702ea
337 changed files with 16571 additions and 4891 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2023-2024 Arista Networks, Inc.
|
||||
# Copyright (c) 2023-2025 Arista Networks, Inc.
|
||||
# Use of this source code is governed by the Apache License 2.0
|
||||
# that can be found in the LICENSE file.
|
||||
"""Tests for anta.tests.path_selection.py."""
|
||||
|
@ -58,7 +58,7 @@ DATA: list[dict[str, Any]] = [
|
|||
{"dpsPeers": {}},
|
||||
],
|
||||
"inputs": {},
|
||||
"expected": {"result": "failure", "messages": ["No path configured for router path-selection."]},
|
||||
"expected": {"result": "failure", "messages": ["No path configured for router path-selection"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-not-established",
|
||||
|
@ -101,9 +101,9 @@ DATA: list[dict[str, Any]] = [
|
|||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Path state for peer 10.255.0.1 in path-group internet is `ipsecPending`.",
|
||||
"Path state for peer 10.255.0.1 in path-group mpls is `ipsecPending`.",
|
||||
"Path state for peer 10.255.0.2 in path-group mpls is `ipsecPending`.",
|
||||
"Peer: 10.255.0.1 Path Group: internet - Invalid path state - Expected: ipsecEstablished, routeResolved Actual: ipsecPending",
|
||||
"Peer: 10.255.0.1 Path Group: mpls - Invalid path state - Expected: ipsecEstablished, routeResolved Actual: ipsecPending",
|
||||
"Peer: 10.255.0.2 Path Group: mpls - Invalid path state - Expected: ipsecEstablished, routeResolved Actual: ipsecPending",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -148,9 +148,9 @@ DATA: list[dict[str, Any]] = [
|
|||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Telemetry state for peer 10.255.0.1 in path-group internet is `inactive`.",
|
||||
"Telemetry state for peer 10.255.0.1 in path-group mpls is `inactive`.",
|
||||
"Telemetry state for peer 10.255.0.2 in path-group mpls is `inactive`.",
|
||||
"Peer: 10.255.0.1 Path Group internet - Telemetry state inactive",
|
||||
"Peer: 10.255.0.1 Path Group mpls - Telemetry state inactive",
|
||||
"Peer: 10.255.0.2 Path Group mpls - Telemetry state inactive",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -158,107 +158,125 @@ DATA: list[dict[str, Any]] = [
|
|||
"name": "success",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path3": {
|
||||
"state": "ipsecEstablished",
|
||||
"source": "172.18.13.2",
|
||||
"destination": "172.18.15.2",
|
||||
"dpsSessions": {"0": {"active": True}},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.2": {
|
||||
"dpsGroups": {
|
||||
"mpls": {
|
||||
"dpsPaths": {
|
||||
"path2": {
|
||||
"path7": {},
|
||||
"path8": {
|
||||
"source": "172.18.13.2",
|
||||
"destination": "172.18.15.2",
|
||||
"state": "ipsecEstablished",
|
||||
"dpsSessions": {"0": {"active": True}},
|
||||
},
|
||||
}
|
||||
},
|
||||
"internet": {},
|
||||
}
|
||||
},
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path6": {
|
||||
"source": "100.64.3.2",
|
||||
"destination": "100.64.1.2",
|
||||
"state": "ipsecEstablished",
|
||||
"source": "172.18.3.2",
|
||||
"destination": "172.18.5.2",
|
||||
"dpsSessions": {"0": {"active": True}},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mpls": {},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"paths": [
|
||||
{"peer": "10.255.0.1", "path_group": "internet", "source_address": "172.18.3.2", "destination_address": "172.18.5.2"},
|
||||
{"peer": "10.255.0.1", "path_group": "internet", "source_address": "100.64.3.2", "destination_address": "100.64.1.2"},
|
||||
{"peer": "10.255.0.2", "path_group": "mpls", "source_address": "172.18.13.2", "destination_address": "172.18.15.2"},
|
||||
]
|
||||
},
|
||||
"expected": {"result": "success"},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-peer",
|
||||
"name": "failure-expected-path-group-not-found",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [
|
||||
{"dpsPeers": {}},
|
||||
{"dpsPeers": {}},
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.2": {
|
||||
"dpsGroups": {"internet": {}},
|
||||
},
|
||||
"10.255.0.1": {"peerName": "", "dpsGroups": {"mpls": {}}},
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"paths": [
|
||||
{"peer": "10.255.0.1", "path_group": "internet", "source_address": "172.18.3.2", "destination_address": "172.18.5.2"},
|
||||
{"peer": "10.255.0.1", "path_group": "internet", "source_address": "100.64.3.2", "destination_address": "100.64.1.2"},
|
||||
{"peer": "10.255.0.2", "path_group": "mpls", "source_address": "172.18.13.2", "destination_address": "172.18.15.2"},
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Path `peer: 10.255.0.1 source: 172.18.3.2 destination: 172.18.5.2` is not configured for path-group `internet`.",
|
||||
"Path `peer: 10.255.0.2 source: 172.18.13.2 destination: 172.18.15.2` is not configured for path-group `mpls`.",
|
||||
"Peer: 10.255.0.1 PathGroup: internet Source: 100.64.3.2 Destination: 100.64.1.2 - No DPS path found for this peer and path group",
|
||||
"Peer: 10.255.0.2 PathGroup: mpls Source: 172.18.13.2 Destination: 172.18.15.2 - No DPS path found for this peer and path group",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-router-path-configured",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [{"dpsPeers": {}}],
|
||||
"inputs": {"paths": [{"peer": "10.255.0.1", "path_group": "internet", "source_address": "100.64.3.2", "destination_address": "100.64.1.2"}]},
|
||||
"expected": {"result": "failure", "messages": ["Router path-selection not configured"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-no-specific-peer-configured",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [{"dpsPeers": {"10.255.0.2": {}}}],
|
||||
"inputs": {"paths": [{"peer": "10.255.0.1", "path_group": "internet", "source_address": "172.18.3.2", "destination_address": "172.18.5.2"}]},
|
||||
"expected": {"result": "failure", "messages": ["Peer: 10.255.0.1 PathGroup: internet Source: 172.18.3.2 Destination: 172.18.5.2 - Peer not found"]},
|
||||
},
|
||||
{
|
||||
"name": "failure-not-established",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path3": {"state": "ipsecPending", "source": "172.18.3.2", "destination": "172.18.5.2", "dpsSessions": {"0": {"active": True}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.2": {
|
||||
"dpsGroups": {
|
||||
"mpls": {
|
||||
"dpsPaths": {
|
||||
"path4": {
|
||||
"state": "ipsecPending",
|
||||
"path7": {},
|
||||
"path8": {
|
||||
"source": "172.18.13.2",
|
||||
"destination": "172.18.15.2",
|
||||
"dpsSessions": {"0": {"active": False}},
|
||||
}
|
||||
"state": "ipsecPending",
|
||||
"dpsSessions": {"0": {"active": True}},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
"internet": {"dpsPaths": {}},
|
||||
}
|
||||
}
|
||||
},
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path6": {"source": "172.18.3.2", "destination": "172.18.5.2", "state": "ipsecPending", "dpsSessions": {"0": {"active": True}}}
|
||||
}
|
||||
},
|
||||
"mpls": {"dpsPaths": {}},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"paths": [
|
||||
|
@ -269,8 +287,10 @@ DATA: list[dict[str, Any]] = [
|
|||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Path state for `peer: 10.255.0.1 source: 172.18.3.2 destination: 172.18.5.2` in path-group internet is `ipsecPending`.",
|
||||
"Path state for `peer: 10.255.0.2 source: 172.18.13.2 destination: 172.18.15.2` in path-group mpls is `ipsecPending`.",
|
||||
"Peer: 10.255.0.1 PathGroup: internet Source: 172.18.3.2 Destination: 172.18.5.2 - Invalid state path - Expected: ipsecEstablished, routeResolved "
|
||||
"Actual: ipsecPending",
|
||||
"Peer: 10.255.0.2 PathGroup: mpls Source: 172.18.13.2 Destination: 172.18.15.2 - Invalid state path - Expected: ipsecEstablished, routeResolved "
|
||||
"Actual: ipsecPending",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -278,37 +298,33 @@ DATA: list[dict[str, Any]] = [
|
|||
"name": "failure-inactive",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path3": {"state": "routeResolved", "source": "172.18.3.2", "destination": "172.18.5.2", "dpsSessions": {"0": {"active": False}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.2": {
|
||||
"dpsGroups": {
|
||||
"mpls": {
|
||||
"dpsPaths": {
|
||||
"path4": {
|
||||
"state": "routeResolved",
|
||||
"path8": {
|
||||
"source": "172.18.13.2",
|
||||
"destination": "172.18.15.2",
|
||||
"state": "routeResolved",
|
||||
"dpsSessions": {"0": {"active": False}},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path6": {"source": "172.18.3.2", "destination": "172.18.5.2", "state": "routeResolved", "dpsSessions": {"0": {"active": False}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"paths": [
|
||||
|
@ -319,8 +335,49 @@ DATA: list[dict[str, Any]] = [
|
|||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Telemetry state for path `peer: 10.255.0.1 source: 172.18.3.2 destination: 172.18.5.2` in path-group internet is `inactive`.",
|
||||
"Telemetry state for path `peer: 10.255.0.2 source: 172.18.13.2 destination: 172.18.15.2` in path-group mpls is `inactive`.",
|
||||
"Peer: 10.255.0.1 PathGroup: internet Source: 172.18.3.2 Destination: 172.18.5.2 - Telemetry state inactive for this path",
|
||||
"Peer: 10.255.0.2 PathGroup: mpls Source: 172.18.13.2 Destination: 172.18.15.2 - Telemetry state inactive for this path",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "failure-source-destination-not-configured",
|
||||
"test": VerifySpecificPath,
|
||||
"eos_data": [
|
||||
{
|
||||
"dpsPeers": {
|
||||
"10.255.0.2": {
|
||||
"dpsGroups": {
|
||||
"mpls": {
|
||||
"dpsPaths": {
|
||||
"path8": {"source": "172.18.3.2", "destination": "172.8.15.2", "state": "routeResolved", "dpsSessions": {"0": {"active": False}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"10.255.0.1": {
|
||||
"dpsGroups": {
|
||||
"internet": {
|
||||
"dpsPaths": {
|
||||
"path6": {"source": "172.8.3.2", "destination": "172.8.5.2", "state": "routeResolved", "dpsSessions": {"0": {"active": False}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"paths": [
|
||||
{"peer": "10.255.0.1", "path_group": "internet", "source_address": "172.18.3.2", "destination_address": "172.18.5.2"},
|
||||
{"peer": "10.255.0.2", "path_group": "mpls", "source_address": "172.18.13.2", "destination_address": "172.18.15.2"},
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"result": "failure",
|
||||
"messages": [
|
||||
"Peer: 10.255.0.1 PathGroup: internet Source: 172.18.3.2 Destination: 172.18.5.2 - No path matching the source and destination found",
|
||||
"Peer: 10.255.0.2 PathGroup: mpls Source: 172.18.13.2 Destination: 172.18.15.2 - No path matching the source and destination found",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue