From a5a93b729023fd365c7c7ab6d7ea1882a554a55d Mon Sep 17 00:00:00 2001 From: geetanjalimanegslab <96573243+geetanjalimanegslab@users.noreply.github.com> Date: Tue, 31 Dec 2024 19:10:32 +0530 Subject: [PATCH 1/4] feat(anta): Added testcase to validate the STP disabled VLANs (#972) --- anta/tests/stp.py | 64 ++++++++++++++++++++++++++++++ examples/tests.yaml | 5 +++ tests/units/anta_tests/test_stp.py | 54 ++++++++++++++++++++++++- 3 files changed, 122 insertions(+), 1 deletion(-) diff --git a/anta/tests/stp.py b/anta/tests/stp.py index 93a0d2e39..7a625ff8e 100644 --- a/anta/tests/stp.py +++ b/anta/tests/stp.py @@ -309,3 +309,67 @@ def test(self) -> None: self.result.is_failure(f"The following STP topologies are not configured or number of changes not within the threshold:\n{failures}") else: self.result.is_success() + + +class VerifySTPDisabledVlans(AntaTest): + """Verifies the STP disabled VLAN(s). + + This test performs the following checks: + + 1. Verifies that the STP is configured. + 2. Verifies that the specified VLAN(s) exist on the device. + 3. Verifies that the STP is disabled for the specified VLAN(s). + + Expected Results + ---------------- + * Success: The test will pass if all of the following conditions are met: + - STP is properly configured on the device. + - The specified VLAN(s) exist on the device. + - STP is confirmed to be disabled for all the specified VLAN(s). + * Failure: The test will fail if any of the following condition is met: + - STP is not configured on the device. + - The specified VLAN(s) do not exist on the device. + - STP is enabled for any of the specified VLAN(s). + + Examples + -------- + ```yaml + anta.tests.stp: + - VerifySTPDisabledVlans: + vlans: + - 6 + - 4094 + ``` + """ + + categories: ClassVar[list[str]] = ["stp"] + commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show spanning-tree vlan detail", revision=1)] + + class Input(AntaTest.Input): + """Input model for the VerifySTPDisabledVlans test.""" + + vlans: list[Vlan] + """List of STP disabled VLAN(s).""" + + @AntaTest.anta_test + def test(self) -> None: + """Main test function for VerifySTPDisabledVlans.""" + self.result.is_success() + + command_output = self.instance_commands[0].json_output + stp_vlan_instances = command_output.get("spanningTreeVlanInstances", {}) + + # If the spanningTreeVlanInstances detail are not found in the command output, the test fails. + if not stp_vlan_instances: + self.result.is_failure("STP is not configured") + return + + actual_vlans = list(stp_vlan_instances) + # If the specified VLAN is not present on the device, STP is enabled for the VLAN(s), test fails. + for vlan in self.inputs.vlans: + if str(vlan) not in actual_vlans: + self.result.is_failure(f"VLAN: {vlan} - Not configured") + continue + + if stp_vlan_instances.get(str(vlan)): + self.result.is_failure(f"VLAN: {vlan} - STP is enabled") diff --git a/examples/tests.yaml b/examples/tests.yaml index e22acf49a..6e1fc5b85 100644 --- a/examples/tests.yaml +++ b/examples/tests.yaml @@ -749,6 +749,11 @@ anta.tests.stp: # Verifies there is no STP blocked ports. - VerifySTPCounters: # Verifies there is no errors in STP BPDU packets. + - VerifySTPDisabledVlans: + # Verifies the STP disabled VLAN(s). + vlans: + - 6 + - 4094 - VerifySTPForwardingPorts: # Verifies that all interfaces are forwarding for a provided list of VLAN(s). vlans: diff --git a/tests/units/anta_tests/test_stp.py b/tests/units/anta_tests/test_stp.py index 37422108b..bcd83f11d 100644 --- a/tests/units/anta_tests/test_stp.py +++ b/tests/units/anta_tests/test_stp.py @@ -7,7 +7,15 @@ from typing import Any -from anta.tests.stp import VerifySTPBlockedPorts, VerifySTPCounters, VerifySTPForwardingPorts, VerifySTPMode, VerifySTPRootPriority, VerifyStpTopologyChanges +from anta.tests.stp import ( + VerifySTPBlockedPorts, + VerifySTPCounters, + VerifySTPDisabledVlans, + VerifySTPForwardingPorts, + VerifySTPMode, + VerifySTPRootPriority, + VerifyStpTopologyChanges, +) from tests.units.anta_tests import test DATA: list[dict[str, Any]] = [ @@ -486,4 +494,48 @@ "inputs": {"threshold": 10}, "expected": {"result": "failure", "messages": ["STP is not configured."]}, }, + { + "name": "success", + "test": VerifySTPDisabledVlans, + "eos_data": [{"spanningTreeVlanInstances": {"1": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {"priority": 32768}}}, "6": {}, "4094": {}}}], + "inputs": {"vlans": ["6", "4094"]}, + "expected": {"result": "success"}, + }, + { + "name": "failure-stp-not-configured", + "test": VerifySTPDisabledVlans, + "eos_data": [{"spanningTreeVlanInstances": {}}], + "inputs": {"vlans": ["6", "4094"]}, + "expected": {"result": "failure", "messages": ["STP is not configured"]}, + }, + { + "name": "failure-vlans-not-found", + "test": VerifySTPDisabledVlans, + "eos_data": [ + { + "spanningTreeVlanInstances": { + "1": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + "6": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + "4094": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + } + } + ], + "inputs": {"vlans": ["16", "4093"]}, + "expected": {"result": "failure", "messages": ["VLAN: 16 - Not configured", "VLAN: 4093 - Not configured"]}, + }, + { + "name": "failure-vlans-enabled", + "test": VerifySTPDisabledVlans, + "eos_data": [ + { + "spanningTreeVlanInstances": { + "1": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + "6": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + "4094": {"spanningTreeVlanInstance": {"protocol": "mstp", "bridge": {}}}, + } + } + ], + "inputs": {"vlans": ["6", "4094"]}, + "expected": {"result": "failure", "messages": ["VLAN: 6 - STP is enabled", "VLAN: 4094 - STP is enabled"]}, + }, ] From 58c4de82cb1b0b614b776303b7b995c70ecfa7f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:04:16 +0100 Subject: [PATCH 2/4] ci: pre-commit autoupdate (#989) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: pre-commit autoupdate updates: - [github.com/pycqa/pylint: v3.3.2 → v3.3.3](https://github.com/pycqa/pylint/compare/v3.3.2...v3.3.3) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Guillaume Mulocher --- .pre-commit-config.yaml | 2 +- anta/__init__.py | 2 +- anta/catalog.py | 2 +- anta/cli/__init__.py | 2 +- anta/cli/_main.py | 2 +- anta/cli/check/__init__.py | 2 +- anta/cli/check/commands.py | 2 +- anta/cli/console.py | 2 +- anta/cli/debug/__init__.py | 2 +- anta/cli/debug/commands.py | 2 +- anta/cli/debug/utils.py | 2 +- anta/cli/exec/__init__.py | 2 +- anta/cli/exec/commands.py | 2 +- anta/cli/exec/utils.py | 2 +- anta/cli/get/__init__.py | 2 +- anta/cli/get/commands.py | 2 +- anta/cli/get/utils.py | 2 +- anta/cli/nrfu/__init__.py | 2 +- anta/cli/nrfu/commands.py | 2 +- anta/cli/nrfu/utils.py | 2 +- anta/cli/utils.py | 2 +- anta/constants.py | 2 +- anta/custom_types.py | 2 +- anta/decorators.py | 2 +- anta/device.py | 2 +- anta/input_models/__init__.py | 2 +- anta/input_models/avt.py | 2 +- anta/input_models/bfd.py | 2 +- anta/input_models/connectivity.py | 2 +- anta/input_models/cvx.py | 2 +- anta/input_models/interfaces.py | 2 +- anta/input_models/routing/__init__.py | 2 +- anta/input_models/routing/bgp.py | 2 +- anta/input_models/routing/generic.py | 2 +- anta/input_models/security.py | 2 +- anta/input_models/services.py | 2 +- anta/input_models/stun.py | 2 +- anta/input_models/system.py | 2 +- anta/inventory/__init__.py | 2 +- anta/inventory/exceptions.py | 2 +- anta/inventory/models.py | 2 +- anta/logger.py | 2 +- anta/models.py | 2 +- anta/reporter/__init__.py | 2 +- anta/reporter/csv_reporter.py | 2 +- anta/reporter/md_reporter.py | 2 +- anta/result_manager/__init__.py | 2 +- anta/result_manager/models.py | 2 +- anta/runner.py | 2 +- anta/tests/__init__.py | 2 +- anta/tests/aaa.py | 2 +- anta/tests/avt.py | 2 +- anta/tests/bfd.py | 2 +- anta/tests/configuration.py | 2 +- anta/tests/connectivity.py | 2 +- anta/tests/cvx.py | 2 +- anta/tests/field_notices.py | 2 +- anta/tests/flow_tracking.py | 2 +- anta/tests/greent.py | 2 +- anta/tests/hardware.py | 2 +- anta/tests/interfaces.py | 2 +- anta/tests/lanz.py | 2 +- anta/tests/logging.py | 2 +- anta/tests/mlag.py | 2 +- anta/tests/multicast.py | 2 +- anta/tests/path_selection.py | 2 +- anta/tests/profiles.py | 2 +- anta/tests/ptp.py | 2 +- anta/tests/routing/__init__.py | 2 +- anta/tests/routing/bgp.py | 2 +- anta/tests/routing/generic.py | 2 +- anta/tests/routing/isis.py | 2 +- anta/tests/routing/ospf.py | 2 +- anta/tests/security.py | 2 +- anta/tests/services.py | 2 +- anta/tests/snmp.py | 2 +- anta/tests/software.py | 2 +- anta/tests/stp.py | 2 +- anta/tests/stun.py | 2 +- anta/tests/system.py | 2 +- anta/tests/vlan.py | 2 +- anta/tests/vxlan.py | 2 +- anta/tools.py | 2 +- asynceapi/__init__.py | 2 +- asynceapi/aio_portcheck.py | 2 +- asynceapi/config_session.py | 2 +- asynceapi/device.py | 2 +- asynceapi/errors.py | 2 +- docs/README.md | 2 +- docs/advanced_usages/as-python-lib.md | 2 +- docs/advanced_usages/caching.md | 2 +- docs/advanced_usages/custom-tests.md | 2 +- docs/api/catalog.md | 2 +- docs/api/csv_reporter.md | 2 +- docs/api/device.md | 2 +- docs/api/inventory.md | 2 +- docs/api/inventory.models.input.md | 2 +- docs/api/md_reporter.md | 2 +- docs/api/models.md | 2 +- docs/api/reporters.md | 2 +- docs/api/result_manager.md | 2 +- docs/api/result_manager_models.md | 2 +- docs/api/runner.md | 2 +- docs/api/tests.aaa.md | 2 +- docs/api/tests.avt.md | 2 +- docs/api/tests.bfd.md | 2 +- docs/api/tests.configuration.md | 2 +- docs/api/tests.connectivity.md | 2 +- docs/api/tests.cvx.md | 2 +- docs/api/tests.field_notices.md | 2 +- docs/api/tests.flow_tracking.md | 2 +- docs/api/tests.greent.md | 2 +- docs/api/tests.hardware.md | 2 +- docs/api/tests.interfaces.md | 2 +- docs/api/tests.lanz.md | 2 +- docs/api/tests.logging.md | 2 +- docs/api/tests.md | 2 +- docs/api/tests.mlag.md | 2 +- docs/api/tests.multicast.md | 2 +- docs/api/tests.path_selection.md | 2 +- docs/api/tests.profiles.md | 2 +- docs/api/tests.ptp.md | 2 +- docs/api/tests.routing.bgp.md | 2 +- docs/api/tests.routing.generic.md | 2 +- docs/api/tests.routing.isis.md | 2 +- docs/api/tests.routing.ospf.md | 2 +- docs/api/tests.security.md | 2 +- docs/api/tests.services.md | 2 +- docs/api/tests.snmp.md | 2 +- docs/api/tests.software.md | 2 +- docs/api/tests.stp.md | 2 +- docs/api/tests.stun.md | 2 +- docs/api/tests.system.md | 2 +- docs/api/tests.vlan.md | 2 +- docs/api/tests.vxlan.md | 2 +- docs/api/types.md | 2 +- docs/cli/check.md | 2 +- docs/cli/debug.md | 2 +- docs/cli/exec.md | 2 +- docs/cli/get-inventory-information.md | 2 +- docs/cli/get-tests.md | 2 +- docs/cli/inv-from-ansible.md | 2 +- docs/cli/inv-from-cvp.md | 2 +- docs/cli/nrfu.md | 2 +- docs/cli/overview.md | 2 +- docs/cli/tag-management.md | 2 +- docs/contribution.md | 2 +- docs/faq.md | 2 +- docs/getting-started.md | 2 +- docs/requirements-and-installation.md | 2 +- docs/scripts/__init__.py | 2 +- docs/scripts/generate_examples_tests.py | 2 +- docs/scripts/generate_svg.py | 2 +- docs/troubleshooting.md | 2 +- docs/usage-inventory-catalog.md | 2 +- tests/__init__.py | 2 +- tests/benchmark/__init__.py | 2 +- tests/benchmark/conftest.py | 2 +- tests/benchmark/test_anta.py | 2 +- tests/benchmark/test_reporter.py | 2 +- tests/benchmark/test_runner.py | 2 +- tests/benchmark/utils.py | 2 +- tests/conftest.py | 2 +- tests/data/__init__.py | 2 +- tests/data/syntax_error.py | 2 +- tests/units/__init__.py | 2 +- tests/units/anta_tests/README.md | 2 +- tests/units/anta_tests/__init__.py | 2 +- tests/units/anta_tests/conftest.py | 2 +- tests/units/anta_tests/routing/__init__.py | 2 +- tests/units/anta_tests/routing/test_bgp.py | 2 +- tests/units/anta_tests/routing/test_generic.py | 2 +- tests/units/anta_tests/routing/test_isis.py | 2 +- tests/units/anta_tests/routing/test_ospf.py | 2 +- tests/units/anta_tests/test_aaa.py | 2 +- tests/units/anta_tests/test_avt.py | 2 +- tests/units/anta_tests/test_bfd.py | 2 +- tests/units/anta_tests/test_configuration.py | 2 +- tests/units/anta_tests/test_connectivity.py | 2 +- tests/units/anta_tests/test_cvx.py | 2 +- tests/units/anta_tests/test_field_notices.py | 2 +- tests/units/anta_tests/test_flow_tracking.py | 2 +- tests/units/anta_tests/test_greent.py | 2 +- tests/units/anta_tests/test_hardware.py | 2 +- tests/units/anta_tests/test_interfaces.py | 2 +- tests/units/anta_tests/test_lanz.py | 2 +- tests/units/anta_tests/test_logging.py | 2 +- tests/units/anta_tests/test_mlag.py | 2 +- tests/units/anta_tests/test_multicast.py | 2 +- tests/units/anta_tests/test_path_selection.py | 2 +- tests/units/anta_tests/test_profiles.py | 2 +- tests/units/anta_tests/test_ptp.py | 2 +- tests/units/anta_tests/test_security.py | 2 +- tests/units/anta_tests/test_services.py | 2 +- tests/units/anta_tests/test_snmp.py | 2 +- tests/units/anta_tests/test_software.py | 2 +- tests/units/anta_tests/test_stp.py | 2 +- tests/units/anta_tests/test_stun.py | 2 +- tests/units/anta_tests/test_system.py | 2 +- tests/units/anta_tests/test_vlan.py | 2 +- tests/units/anta_tests/test_vxlan.py | 2 +- tests/units/asynceapi/__init__.py | 2 +- tests/units/asynceapi/conftest.py | 2 +- tests/units/asynceapi/test_data.py | 2 +- tests/units/asynceapi/test_device.py | 2 +- tests/units/cli/__init__.py | 2 +- tests/units/cli/check/__init__.py | 2 +- tests/units/cli/check/test__init__.py | 2 +- tests/units/cli/check/test_commands.py | 2 +- tests/units/cli/conftest.py | 2 +- tests/units/cli/debug/__init__.py | 2 +- tests/units/cli/debug/test__init__.py | 2 +- tests/units/cli/debug/test_commands.py | 2 +- tests/units/cli/exec/__init__.py | 2 +- tests/units/cli/exec/test__init__.py | 2 +- tests/units/cli/exec/test_commands.py | 2 +- tests/units/cli/exec/test_utils.py | 2 +- tests/units/cli/get/__init__.py | 2 +- tests/units/cli/get/local_module/__init__.py | 2 +- tests/units/cli/get/test__init__.py | 2 +- tests/units/cli/get/test_commands.py | 2 +- tests/units/cli/get/test_utils.py | 2 +- tests/units/cli/nrfu/__init__.py | 2 +- tests/units/cli/nrfu/test__init__.py | 2 +- tests/units/cli/nrfu/test_commands.py | 2 +- tests/units/cli/test__init__.py | 2 +- tests/units/cli/test_main.py | 2 +- tests/units/conftest.py | 2 +- tests/units/input_models/__init__.py | 2 +- tests/units/input_models/routing/__init__.py | 2 +- tests/units/input_models/routing/test_bgp.py | 2 +- tests/units/input_models/test_interfaces.py | 2 +- tests/units/inventory/__init__.py | 2 +- tests/units/inventory/test__init__.py | 2 +- tests/units/inventory/test_models.py | 2 +- tests/units/reporter/__init__.py | 2 +- tests/units/reporter/conftest.py | 2 +- tests/units/reporter/test__init__.py | 2 +- tests/units/reporter/test_csv.py | 2 +- tests/units/reporter/test_md_reporter.py | 2 +- tests/units/result_manager/__init__.py | 2 +- tests/units/result_manager/conftest.py | 2 +- tests/units/result_manager/test__init__.py | 2 +- tests/units/result_manager/test_models.py | 2 +- tests/units/test_catalog.py | 2 +- tests/units/test_custom_types.py | 2 +- tests/units/test_decorators.py | 2 +- tests/units/test_device.py | 2 +- tests/units/test_logger.py | 2 +- tests/units/test_models.py | 2 +- tests/units/test_runner.py | 2 +- tests/units/test_tools.py | 2 +- 252 files changed, 252 insertions(+), 252 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f33db65ca..36d721b5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: name: Run Ruff formatter - repo: https://github.com/pycqa/pylint - rev: "v3.3.2" + rev: "v3.3.3" hooks: - id: pylint name: Check code style with pylint diff --git a/anta/__init__.py b/anta/__init__.py index 666084312..339a7d309 100644 --- a/anta/__init__.py +++ b/anta/__init__.py @@ -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. """Arista Network Test Automation (ANTA) Framework.""" diff --git a/anta/catalog.py b/anta/catalog.py index bc95104fc..65031cedc 100644 --- a/anta/catalog.py +++ b/anta/catalog.py @@ -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. """Catalog related functions.""" diff --git a/anta/cli/__init__.py b/anta/cli/__init__.py index 90be5c75c..dd39f78b5 100644 --- a/anta/cli/__init__.py +++ b/anta/cli/__init__.py @@ -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. """ANTA CLI.""" diff --git a/anta/cli/_main.py b/anta/cli/_main.py index ae4e050f7..1dc62240d 100644 --- a/anta/cli/_main.py +++ b/anta/cli/_main.py @@ -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. """ANTA CLI.""" diff --git a/anta/cli/check/__init__.py b/anta/cli/check/__init__.py index bbc5a7e9d..ab1b08eb8 100644 --- a/anta/cli/check/__init__.py +++ b/anta/cli/check/__init__.py @@ -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. """Click commands to validate configuration files.""" diff --git a/anta/cli/check/commands.py b/anta/cli/check/commands.py index 23895d73c..2ca601309 100644 --- a/anta/cli/check/commands.py +++ b/anta/cli/check/commands.py @@ -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. # pylint: disable = redefined-outer-name diff --git a/anta/cli/console.py b/anta/cli/console.py index 9c57d6d64..068e6768d 100644 --- a/anta/cli/console.py +++ b/anta/cli/console.py @@ -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. """ANTA Top-level Console. diff --git a/anta/cli/debug/__init__.py b/anta/cli/debug/__init__.py index 18d577fe8..d3ff5bf60 100644 --- a/anta/cli/debug/__init__.py +++ b/anta/cli/debug/__init__.py @@ -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. """Click commands to execute EOS commands on remote devices.""" diff --git a/anta/cli/debug/commands.py b/anta/cli/debug/commands.py index e6e456e67..54f580aaa 100644 --- a/anta/cli/debug/commands.py +++ b/anta/cli/debug/commands.py @@ -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. # pylint: disable = redefined-outer-name diff --git a/anta/cli/debug/utils.py b/anta/cli/debug/utils.py index 454c3e640..c8ead5a5c 100644 --- a/anta/cli/debug/utils.py +++ b/anta/cli/debug/utils.py @@ -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. """Utils functions to use with anta.cli.debug module.""" diff --git a/anta/cli/exec/__init__.py b/anta/cli/exec/__init__.py index 5fa6eb92a..bcec37c54 100644 --- a/anta/cli/exec/__init__.py +++ b/anta/cli/exec/__init__.py @@ -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. """Click commands to execute various scripts on EOS devices.""" diff --git a/anta/cli/exec/commands.py b/anta/cli/exec/commands.py index ff36e56d2..a29939344 100644 --- a/anta/cli/exec/commands.py +++ b/anta/cli/exec/commands.py @@ -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. """Click commands to execute various scripts on EOS devices.""" diff --git a/anta/cli/exec/utils.py b/anta/cli/exec/utils.py index 33a02220c..1f874b0cd 100644 --- a/anta/cli/exec/utils.py +++ b/anta/cli/exec/utils.py @@ -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. diff --git a/anta/cli/get/__init__.py b/anta/cli/get/__init__.py index 8763b35c1..d0393adc1 100644 --- a/anta/cli/get/__init__.py +++ b/anta/cli/get/__init__.py @@ -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. """Click commands to get information from or generate inventories.""" diff --git a/anta/cli/get/commands.py b/anta/cli/get/commands.py index 3cc912610..e34be2cc9 100644 --- a/anta/cli/get/commands.py +++ b/anta/cli/get/commands.py @@ -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. # pylint: disable = redefined-outer-name diff --git a/anta/cli/get/utils.py b/anta/cli/get/utils.py index d21dc5411..42fb4d89b 100644 --- a/anta/cli/get/utils.py +++ b/anta/cli/get/utils.py @@ -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. """Utils functions to use with anta.cli.get.commands module.""" diff --git a/anta/cli/nrfu/__init__.py b/anta/cli/nrfu/__init__.py index 0272e0dba..a6f76c4cd 100644 --- a/anta/cli/nrfu/__init__.py +++ b/anta/cli/nrfu/__init__.py @@ -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. """Click commands that run ANTA tests using anta.runner.""" diff --git a/anta/cli/nrfu/commands.py b/anta/cli/nrfu/commands.py index a5492680b..d1a72a01f 100644 --- a/anta/cli/nrfu/commands.py +++ b/anta/cli/nrfu/commands.py @@ -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. """Click commands that render ANTA tests results.""" diff --git a/anta/cli/nrfu/utils.py b/anta/cli/nrfu/utils.py index 375e6e1ed..0552fb411 100644 --- a/anta/cli/nrfu/utils.py +++ b/anta/cli/nrfu/utils.py @@ -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. """Utils functions to use with anta.cli.nrfu.commands module.""" diff --git a/anta/cli/utils.py b/anta/cli/utils.py index a939c3220..e740f8c56 100644 --- a/anta/cli/utils.py +++ b/anta/cli/utils.py @@ -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. """Utils functions to use with anta.cli module.""" diff --git a/anta/constants.py b/anta/constants.py index 4dcef3050..7a2fc22e9 100644 --- a/anta/constants.py +++ b/anta/constants.py @@ -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. """Constants used in ANTA.""" diff --git a/anta/custom_types.py b/anta/custom_types.py index 297f1f5a8..bd6a7b8d2 100644 --- a/anta/custom_types.py +++ b/anta/custom_types.py @@ -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. """Module that provides predefined types for AntaTest.Input instances.""" diff --git a/anta/decorators.py b/anta/decorators.py index 043162323..f360c0509 100644 --- a/anta/decorators.py +++ b/anta/decorators.py @@ -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. """decorators for tests.""" diff --git a/anta/device.py b/anta/device.py index 561323f96..ba363330e 100644 --- a/anta/device.py +++ b/anta/device.py @@ -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. """ANTA Device Abstraction Module.""" diff --git a/anta/input_models/__init__.py b/anta/input_models/__init__.py index 5b8974c76..5dbf8272a 100644 --- a/anta/input_models/__init__.py +++ b/anta/input_models/__init__.py @@ -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. """Package related to all ANTA tests input models.""" diff --git a/anta/input_models/avt.py b/anta/input_models/avt.py index 9219c2fc8..6430045eb 100644 --- a/anta/input_models/avt.py +++ b/anta/input_models/avt.py @@ -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. """Module containing input models for AVT tests.""" diff --git a/anta/input_models/bfd.py b/anta/input_models/bfd.py index 9ccc6254a..2d057d670 100644 --- a/anta/input_models/bfd.py +++ b/anta/input_models/bfd.py @@ -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. """Module containing input models for BFD tests.""" diff --git a/anta/input_models/connectivity.py b/anta/input_models/connectivity.py index e8f555371..53581ea3c 100644 --- a/anta/input_models/connectivity.py +++ b/anta/input_models/connectivity.py @@ -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. """Module containing input models for connectivity tests.""" diff --git a/anta/input_models/cvx.py b/anta/input_models/cvx.py index 4f937498c..e2f5f8e36 100644 --- a/anta/input_models/cvx.py +++ b/anta/input_models/cvx.py @@ -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. """Module containing input models for CVX tests.""" diff --git a/anta/input_models/interfaces.py b/anta/input_models/interfaces.py index 9e33a2c54..02ad76947 100644 --- a/anta/input_models/interfaces.py +++ b/anta/input_models/interfaces.py @@ -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. """Module containing input models for interface tests.""" diff --git a/anta/input_models/routing/__init__.py b/anta/input_models/routing/__init__.py index e1188cc9f..772b4f979 100644 --- a/anta/input_models/routing/__init__.py +++ b/anta/input_models/routing/__init__.py @@ -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. """Package related to routing tests input models.""" diff --git a/anta/input_models/routing/bgp.py b/anta/input_models/routing/bgp.py index 57c821740..04ced3853 100644 --- a/anta/input_models/routing/bgp.py +++ b/anta/input_models/routing/bgp.py @@ -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. """Module containing input models for routing BGP tests.""" diff --git a/anta/input_models/routing/generic.py b/anta/input_models/routing/generic.py index 41c78a132..b683a4582 100644 --- a/anta/input_models/routing/generic.py +++ b/anta/input_models/routing/generic.py @@ -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. """Module containing input models for generic routing tests.""" diff --git a/anta/input_models/security.py b/anta/input_models/security.py index 373d89735..5a517c575 100644 --- a/anta/input_models/security.py +++ b/anta/input_models/security.py @@ -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. """Module containing input models for security tests.""" diff --git a/anta/input_models/services.py b/anta/input_models/services.py index 596a3e38a..9989dae1b 100644 --- a/anta/input_models/services.py +++ b/anta/input_models/services.py @@ -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. """Module containing input models for services tests.""" diff --git a/anta/input_models/stun.py b/anta/input_models/stun.py index d1af40508..1d915672a 100644 --- a/anta/input_models/stun.py +++ b/anta/input_models/stun.py @@ -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. """Module containing input models for services tests.""" diff --git a/anta/input_models/system.py b/anta/input_models/system.py index 7600d2878..fd4a27097 100644 --- a/anta/input_models/system.py +++ b/anta/input_models/system.py @@ -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. """Module containing input models for system tests.""" diff --git a/anta/inventory/__init__.py b/anta/inventory/__init__.py index 3046d7a66..f98c42f29 100644 --- a/anta/inventory/__init__.py +++ b/anta/inventory/__init__.py @@ -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. """Inventory module for ANTA.""" diff --git a/anta/inventory/exceptions.py b/anta/inventory/exceptions.py index 90a672f61..f7adaa703 100644 --- a/anta/inventory/exceptions.py +++ b/anta/inventory/exceptions.py @@ -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. """Manage Exception in Inventory module.""" diff --git a/anta/inventory/models.py b/anta/inventory/models.py index 2eea701f6..320f5276c 100644 --- a/anta/inventory/models.py +++ b/anta/inventory/models.py @@ -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. """Models related to inventory management.""" diff --git a/anta/logger.py b/anta/logger.py index 54733fb73..167b821b1 100644 --- a/anta/logger.py +++ b/anta/logger.py @@ -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. """Configure logging for ANTA.""" diff --git a/anta/models.py b/anta/models.py index c69f78e1f..71f33ebd9 100644 --- a/anta/models.py +++ b/anta/models.py @@ -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. """Models to define a TestStructure.""" diff --git a/anta/reporter/__init__.py b/anta/reporter/__init__.py index 9e5fa1b30..32a8192fc 100644 --- a/anta/reporter/__init__.py +++ b/anta/reporter/__init__.py @@ -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. """Report management for ANTA.""" diff --git a/anta/reporter/csv_reporter.py b/anta/reporter/csv_reporter.py index 3f5592388..83292f344 100644 --- a/anta/reporter/csv_reporter.py +++ b/anta/reporter/csv_reporter.py @@ -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. """CSV Report management for ANTA.""" diff --git a/anta/reporter/md_reporter.py b/anta/reporter/md_reporter.py index 94c4a8668..69fc6640b 100644 --- a/anta/reporter/md_reporter.py +++ b/anta/reporter/md_reporter.py @@ -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. """Markdown report generator for ANTA test results.""" diff --git a/anta/result_manager/__init__.py b/anta/result_manager/__init__.py index b5b0f393f..8c535224a 100644 --- a/anta/result_manager/__init__.py +++ b/anta/result_manager/__init__.py @@ -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. """Result Manager module for ANTA.""" diff --git a/anta/result_manager/models.py b/anta/result_manager/models.py index 32975816c..a18ff579c 100644 --- a/anta/result_manager/models.py +++ b/anta/result_manager/models.py @@ -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. """Models related to anta.result_manager module.""" diff --git a/anta/runner.py b/anta/runner.py index 4c6da928a..93c433722 100644 --- a/anta/runner.py +++ b/anta/runner.py @@ -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. """ANTA runner function.""" diff --git a/anta/tests/__init__.py b/anta/tests/__init__.py index ec0b1ec9c..15362fc80 100644 --- a/anta/tests/__init__.py +++ b/anta/tests/__init__.py @@ -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. """Module related to all ANTA tests.""" diff --git a/anta/tests/aaa.py b/anta/tests/aaa.py index 019bf1a50..22f751891 100644 --- a/anta/tests/aaa.py +++ b/anta/tests/aaa.py @@ -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. """Module related to the EOS various AAA tests.""" diff --git a/anta/tests/avt.py b/anta/tests/avt.py index b0f1a465b..365a2f72a 100644 --- a/anta/tests/avt.py +++ b/anta/tests/avt.py @@ -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. """Module related to Adaptive virtual topology tests.""" diff --git a/anta/tests/bfd.py b/anta/tests/bfd.py index ba27f942b..a27a786cf 100644 --- a/anta/tests/bfd.py +++ b/anta/tests/bfd.py @@ -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. """Module related to BFD tests.""" diff --git a/anta/tests/configuration.py b/anta/tests/configuration.py index cff7ec610..6953d476c 100644 --- a/anta/tests/configuration.py +++ b/anta/tests/configuration.py @@ -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. """Module related to the device configuration tests.""" diff --git a/anta/tests/connectivity.py b/anta/tests/connectivity.py index afcfa118e..245baf46d 100644 --- a/anta/tests/connectivity.py +++ b/anta/tests/connectivity.py @@ -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. """Module related to various connectivity tests.""" diff --git a/anta/tests/cvx.py b/anta/tests/cvx.py index 61600829c..15c8355d9 100644 --- a/anta/tests/cvx.py +++ b/anta/tests/cvx.py @@ -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. """Module related to the CVX tests.""" diff --git a/anta/tests/field_notices.py b/anta/tests/field_notices.py index 41e81a840..0c093e796 100644 --- a/anta/tests/field_notices.py +++ b/anta/tests/field_notices.py @@ -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. """Module related to field notices tests.""" diff --git a/anta/tests/flow_tracking.py b/anta/tests/flow_tracking.py index 9b9acc670..245d1fd8c 100644 --- a/anta/tests/flow_tracking.py +++ b/anta/tests/flow_tracking.py @@ -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. """Module related to the flow tracking tests.""" diff --git a/anta/tests/greent.py b/anta/tests/greent.py index 67bb25beb..345f01b76 100644 --- a/anta/tests/greent.py +++ b/anta/tests/greent.py @@ -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. """Module related to GreenT (Postcard Telemetry) tests.""" diff --git a/anta/tests/hardware.py b/anta/tests/hardware.py index 1c562b000..8ffe4e50d 100644 --- a/anta/tests/hardware.py +++ b/anta/tests/hardware.py @@ -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. """Module related to the hardware or environment tests.""" diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index bc1acbb82..3191053fc 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -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. """Module related to the device interfaces tests.""" diff --git a/anta/tests/lanz.py b/anta/tests/lanz.py index 0995af7c9..33e5472ce 100644 --- a/anta/tests/lanz.py +++ b/anta/tests/lanz.py @@ -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. """Module related to LANZ tests.""" diff --git a/anta/tests/logging.py b/anta/tests/logging.py index c391947c2..d32701836 100644 --- a/anta/tests/logging.py +++ b/anta/tests/logging.py @@ -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. """Module related to the EOS various logging tests. diff --git a/anta/tests/mlag.py b/anta/tests/mlag.py index e353420c9..215630c91 100644 --- a/anta/tests/mlag.py +++ b/anta/tests/mlag.py @@ -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. """Module related to Multi-chassis Link Aggregation (MLAG) tests.""" diff --git a/anta/tests/multicast.py b/anta/tests/multicast.py index f6e84babc..64dad896f 100644 --- a/anta/tests/multicast.py +++ b/anta/tests/multicast.py @@ -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. """Module related to multicast and IGMP tests.""" diff --git a/anta/tests/path_selection.py b/anta/tests/path_selection.py index 15b06aef2..58b86860d 100644 --- a/anta/tests/path_selection.py +++ b/anta/tests/path_selection.py @@ -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. """Test functions related to various router path-selection settings.""" diff --git a/anta/tests/profiles.py b/anta/tests/profiles.py index 93edacd59..f9c3c2622 100644 --- a/anta/tests/profiles.py +++ b/anta/tests/profiles.py @@ -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. """Module related to ASIC profile tests.""" diff --git a/anta/tests/ptp.py b/anta/tests/ptp.py index 687f17517..e38d58ef8 100644 --- a/anta/tests/ptp.py +++ b/anta/tests/ptp.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. """Module related to PTP tests.""" diff --git a/anta/tests/routing/__init__.py b/anta/tests/routing/__init__.py index d4b378697..85ca1ab69 100644 --- a/anta/tests/routing/__init__.py +++ b/anta/tests/routing/__init__.py @@ -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. """Package related to routing tests.""" diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py index 2a140ddb2..fb17cbc8c 100644 --- a/anta/tests/routing/bgp.py +++ b/anta/tests/routing/bgp.py @@ -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. """Module related to BGP tests.""" diff --git a/anta/tests/routing/generic.py b/anta/tests/routing/generic.py index 7b916a3bc..97709aa40 100644 --- a/anta/tests/routing/generic.py +++ b/anta/tests/routing/generic.py @@ -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. """Module related to generic routing tests.""" diff --git a/anta/tests/routing/isis.py b/anta/tests/routing/isis.py index 54a4f14ec..562ff6d65 100644 --- a/anta/tests/routing/isis.py +++ b/anta/tests/routing/isis.py @@ -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. """Module related to IS-IS tests.""" diff --git a/anta/tests/routing/ospf.py b/anta/tests/routing/ospf.py index d5d12e29e..08bed8f89 100644 --- a/anta/tests/routing/ospf.py +++ b/anta/tests/routing/ospf.py @@ -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. """Module related to OSPF tests.""" diff --git a/anta/tests/security.py b/anta/tests/security.py index 38bf2409e..de78ea18c 100644 --- a/anta/tests/security.py +++ b/anta/tests/security.py @@ -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. """Module related to the EOS various security tests.""" diff --git a/anta/tests/services.py b/anta/tests/services.py index dab1b3a56..89a7f2636 100644 --- a/anta/tests/services.py +++ b/anta/tests/services.py @@ -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. """Module related to the EOS various services tests.""" diff --git a/anta/tests/snmp.py b/anta/tests/snmp.py index b8bd73d2e..36b97ba2f 100644 --- a/anta/tests/snmp.py +++ b/anta/tests/snmp.py @@ -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. """Module related to the EOS various SNMP tests.""" diff --git a/anta/tests/software.py b/anta/tests/software.py index 9a41881ab..113f2a4fc 100644 --- a/anta/tests/software.py +++ b/anta/tests/software.py @@ -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. """Module related to the EOS software tests.""" diff --git a/anta/tests/stp.py b/anta/tests/stp.py index 7a625ff8e..87e3cd104 100644 --- a/anta/tests/stp.py +++ b/anta/tests/stp.py @@ -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. """Module related to various Spanning Tree Protocol (STP) tests.""" diff --git a/anta/tests/stun.py b/anta/tests/stun.py index 2be13c4b2..ac4f0ea86 100644 --- a/anta/tests/stun.py +++ b/anta/tests/stun.py @@ -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. """Test functions related to various STUN settings.""" diff --git a/anta/tests/system.py b/anta/tests/system.py index cceced694..85235f2fc 100644 --- a/anta/tests/system.py +++ b/anta/tests/system.py @@ -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. """Module related to system-level features and protocols tests.""" diff --git a/anta/tests/vlan.py b/anta/tests/vlan.py index b7b1bd4cb..f2a1934cc 100644 --- a/anta/tests/vlan.py +++ b/anta/tests/vlan.py @@ -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. """Module related to VLAN tests.""" diff --git a/anta/tests/vxlan.py b/anta/tests/vxlan.py index e5f0a5436..a856d88eb 100644 --- a/anta/tests/vxlan.py +++ b/anta/tests/vxlan.py @@ -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. """Module related to VXLAN tests.""" diff --git a/anta/tools.py b/anta/tools.py index 8b116a0e0..a0a21a673 100644 --- a/anta/tools.py +++ b/anta/tools.py @@ -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. """Common functions used in ANTA tests.""" diff --git a/asynceapi/__init__.py b/asynceapi/__init__.py index 6d5a23bf6..fedb07f8e 100644 --- a/asynceapi/__init__.py +++ b/asynceapi/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. # Initially written by Jeremy Schulman at https://github.com/jeremyschulman/aio-eapi diff --git a/asynceapi/aio_portcheck.py b/asynceapi/aio_portcheck.py index deac0431a..be9a79fe2 100644 --- a/asynceapi/aio_portcheck.py +++ b/asynceapi/aio_portcheck.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. # Initially written by Jeremy Schulman at https://github.com/jeremyschulman/aio-eapi diff --git a/asynceapi/config_session.py b/asynceapi/config_session.py index 7f83da41f..470a0d69c 100644 --- a/asynceapi/config_session.py +++ b/asynceapi/config_session.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. # Initially written by Jeremy Schulman at https://github.com/jeremyschulman/aio-eapi diff --git a/asynceapi/device.py b/asynceapi/device.py index c423c366c..9b68dc586 100644 --- a/asynceapi/device.py +++ b/asynceapi/device.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. # Initially written by Jeremy Schulman at https://github.com/jeremyschulman/aio-eapi diff --git a/asynceapi/errors.py b/asynceapi/errors.py index 5fce9db08..ee1faf2ea 100644 --- a/asynceapi/errors.py +++ b/asynceapi/errors.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. # Initially written by Jeremy Schulman at https://github.com/jeremyschulman/aio-eapi diff --git a/docs/README.md b/docs/README.md index 07ac3d28b..b6e00c71d 100755 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ diff --git a/docs/advanced_usages/as-python-lib.md b/docs/advanced_usages/as-python-lib.md index fce5e7eea..29424c6cd 100644 --- a/docs/advanced_usages/as-python-lib.md +++ b/docs/advanced_usages/as-python-lib.md @@ -1,5 +1,5 @@ diff --git a/docs/advanced_usages/caching.md b/docs/advanced_usages/caching.md index 8b089cec3..a9c18182c 100644 --- a/docs/advanced_usages/caching.md +++ b/docs/advanced_usages/caching.md @@ -1,5 +1,5 @@ diff --git a/docs/advanced_usages/custom-tests.md b/docs/advanced_usages/custom-tests.md index 2fc61ccc4..fc5bec099 100644 --- a/docs/advanced_usages/custom-tests.md +++ b/docs/advanced_usages/custom-tests.md @@ -1,5 +1,5 @@ diff --git a/docs/api/catalog.md b/docs/api/catalog.md index 44cc4dfb7..2f61e8dd1 100644 --- a/docs/api/catalog.md +++ b/docs/api/catalog.md @@ -1,5 +1,5 @@ diff --git a/docs/api/csv_reporter.md b/docs/api/csv_reporter.md index 0432c4590..916840db1 100644 --- a/docs/api/csv_reporter.md +++ b/docs/api/csv_reporter.md @@ -2,7 +2,7 @@ anta_title: CSV Reporter --- diff --git a/docs/api/device.md b/docs/api/device.md index 136fec75b..e4e50579c 100644 --- a/docs/api/device.md +++ b/docs/api/device.md @@ -1,5 +1,5 @@ diff --git a/docs/api/inventory.md b/docs/api/inventory.md index b826b9ff5..66ee6d491 100644 --- a/docs/api/inventory.md +++ b/docs/api/inventory.md @@ -1,5 +1,5 @@ diff --git a/docs/api/inventory.models.input.md b/docs/api/inventory.models.input.md index a15c20e3d..01d33bff7 100644 --- a/docs/api/inventory.models.input.md +++ b/docs/api/inventory.models.input.md @@ -1,5 +1,5 @@ diff --git a/docs/api/md_reporter.md b/docs/api/md_reporter.md index 7fa1a1537..9d1750e99 100644 --- a/docs/api/md_reporter.md +++ b/docs/api/md_reporter.md @@ -2,7 +2,7 @@ anta_title: Markdown Reporter --- diff --git a/docs/api/models.md b/docs/api/models.md index 1b360de98..16fb040a8 100644 --- a/docs/api/models.md +++ b/docs/api/models.md @@ -1,5 +1,5 @@ diff --git a/docs/api/reporters.md b/docs/api/reporters.md index a72e107e2..aaf672f6f 100644 --- a/docs/api/reporters.md +++ b/docs/api/reporters.md @@ -1,5 +1,5 @@ diff --git a/docs/api/result_manager.md b/docs/api/result_manager.md index 9fc978a0b..6b017dca4 100644 --- a/docs/api/result_manager.md +++ b/docs/api/result_manager.md @@ -1,5 +1,5 @@ diff --git a/docs/api/result_manager_models.md b/docs/api/result_manager_models.md index 42e264899..daaa2aba1 100644 --- a/docs/api/result_manager_models.md +++ b/docs/api/result_manager_models.md @@ -1,5 +1,5 @@ diff --git a/docs/api/runner.md b/docs/api/runner.md index a2de00758..b0114d74f 100644 --- a/docs/api/runner.md +++ b/docs/api/runner.md @@ -1,5 +1,5 @@ diff --git a/docs/api/tests.aaa.md b/docs/api/tests.aaa.md index e5c4b9174..62b3f0d62 100644 --- a/docs/api/tests.aaa.md +++ b/docs/api/tests.aaa.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for AAA tests --- diff --git a/docs/api/tests.avt.md b/docs/api/tests.avt.md index a55fcce14..a44ff438a 100644 --- a/docs/api/tests.avt.md +++ b/docs/api/tests.avt.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for Adaptive Virtual Topology (AVT) tests --- diff --git a/docs/api/tests.bfd.md b/docs/api/tests.bfd.md index ee950875d..c5527c377 100644 --- a/docs/api/tests.bfd.md +++ b/docs/api/tests.bfd.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for BFD tests --- diff --git a/docs/api/tests.configuration.md b/docs/api/tests.configuration.md index 9b24ea78c..db40bf587 100644 --- a/docs/api/tests.configuration.md +++ b/docs/api/tests.configuration.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for device configuration tests --- diff --git a/docs/api/tests.connectivity.md b/docs/api/tests.connectivity.md index 439cec89d..ad8adfe7e 100644 --- a/docs/api/tests.connectivity.md +++ b/docs/api/tests.connectivity.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for connectivity tests --- diff --git a/docs/api/tests.cvx.md b/docs/api/tests.cvx.md index c9ff53dd2..9a0d6d424 100644 --- a/docs/api/tests.cvx.md +++ b/docs/api/tests.cvx.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for CVX tests --- diff --git a/docs/api/tests.field_notices.md b/docs/api/tests.field_notices.md index fe95bf588..4a09a5cb2 100644 --- a/docs/api/tests.field_notices.md +++ b/docs/api/tests.field_notices.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for Field Notices tests --- diff --git a/docs/api/tests.flow_tracking.md b/docs/api/tests.flow_tracking.md index 0df0b1dc8..e6e9df2d2 100644 --- a/docs/api/tests.flow_tracking.md +++ b/docs/api/tests.flow_tracking.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for flow tracking tests --- diff --git a/docs/api/tests.greent.md b/docs/api/tests.greent.md index 01900a957..9959745fa 100644 --- a/docs/api/tests.greent.md +++ b/docs/api/tests.greent.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for GreenT tests --- diff --git a/docs/api/tests.hardware.md b/docs/api/tests.hardware.md index ad06a5014..cc84c0d91 100644 --- a/docs/api/tests.hardware.md +++ b/docs/api/tests.hardware.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for hardware tests --- diff --git a/docs/api/tests.interfaces.md b/docs/api/tests.interfaces.md index 3d863ee2d..e9dc1ba7a 100644 --- a/docs/api/tests.interfaces.md +++ b/docs/api/tests.interfaces.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for interfaces tests --- diff --git a/docs/api/tests.lanz.md b/docs/api/tests.lanz.md index 068571791..fd329a70e 100644 --- a/docs/api/tests.lanz.md +++ b/docs/api/tests.lanz.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for LANZ tests --- diff --git a/docs/api/tests.logging.md b/docs/api/tests.logging.md index 2c4dec0bf..925fd1f73 100644 --- a/docs/api/tests.logging.md +++ b/docs/api/tests.logging.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for logging tests --- diff --git a/docs/api/tests.md b/docs/api/tests.md index a36c9eb89..9b4a1ff8a 100644 --- a/docs/api/tests.md +++ b/docs/api/tests.md @@ -2,7 +2,7 @@ anta_title: ANTA Tests Landing Page --- diff --git a/docs/api/tests.mlag.md b/docs/api/tests.mlag.md index 5470bcdc5..15ab71967 100644 --- a/docs/api/tests.mlag.md +++ b/docs/api/tests.mlag.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for MLAG tests --- diff --git a/docs/api/tests.multicast.md b/docs/api/tests.multicast.md index 707279657..c89383dba 100644 --- a/docs/api/tests.multicast.md +++ b/docs/api/tests.multicast.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for multicast and IGMP tests --- diff --git a/docs/api/tests.path_selection.md b/docs/api/tests.path_selection.md index b7f6b46dd..f4d41d6f2 100644 --- a/docs/api/tests.path_selection.md +++ b/docs/api/tests.path_selection.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for Router path-selection tests --- diff --git a/docs/api/tests.profiles.md b/docs/api/tests.profiles.md index a022c6ab4..54bb9d98b 100644 --- a/docs/api/tests.profiles.md +++ b/docs/api/tests.profiles.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for profiles tests --- diff --git a/docs/api/tests.ptp.md b/docs/api/tests.ptp.md index 3b03ac048..dbb620e77 100644 --- a/docs/api/tests.ptp.md +++ b/docs/api/tests.ptp.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for PTP tests --- diff --git a/docs/api/tests.routing.bgp.md b/docs/api/tests.routing.bgp.md index b40ff7b2d..f187c163d 100644 --- a/docs/api/tests.routing.bgp.md +++ b/docs/api/tests.routing.bgp.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for BGP tests --- diff --git a/docs/api/tests.routing.generic.md b/docs/api/tests.routing.generic.md index bbc89040a..cfeaaac9c 100644 --- a/docs/api/tests.routing.generic.md +++ b/docs/api/tests.routing.generic.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for generic routing tests --- diff --git a/docs/api/tests.routing.isis.md b/docs/api/tests.routing.isis.md index 16ca7ffeb..90e6d25d9 100644 --- a/docs/api/tests.routing.isis.md +++ b/docs/api/tests.routing.isis.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for IS-IS tests --- diff --git a/docs/api/tests.routing.ospf.md b/docs/api/tests.routing.ospf.md index 12bb3ec1f..eb9c735a9 100644 --- a/docs/api/tests.routing.ospf.md +++ b/docs/api/tests.routing.ospf.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for OSPF tests --- diff --git a/docs/api/tests.security.md b/docs/api/tests.security.md index 599783236..62d9a220c 100644 --- a/docs/api/tests.security.md +++ b/docs/api/tests.security.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for security tests --- diff --git a/docs/api/tests.services.md b/docs/api/tests.services.md index cd371489f..da8e1736b 100644 --- a/docs/api/tests.services.md +++ b/docs/api/tests.services.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for services tests --- diff --git a/docs/api/tests.snmp.md b/docs/api/tests.snmp.md index be2da4832..85c147e2a 100644 --- a/docs/api/tests.snmp.md +++ b/docs/api/tests.snmp.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for SNMP tests --- diff --git a/docs/api/tests.software.md b/docs/api/tests.software.md index 760047675..c421d8fb0 100644 --- a/docs/api/tests.software.md +++ b/docs/api/tests.software.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for Software tests --- diff --git a/docs/api/tests.stp.md b/docs/api/tests.stp.md index 50a004bae..5692a74c6 100644 --- a/docs/api/tests.stp.md +++ b/docs/api/tests.stp.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for STP tests --- diff --git a/docs/api/tests.stun.md b/docs/api/tests.stun.md index 6a73b8880..f4247dceb 100644 --- a/docs/api/tests.stun.md +++ b/docs/api/tests.stun.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for STUN tests --- diff --git a/docs/api/tests.system.md b/docs/api/tests.system.md index 26568e205..21e780246 100644 --- a/docs/api/tests.system.md +++ b/docs/api/tests.system.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for System tests --- diff --git a/docs/api/tests.vlan.md b/docs/api/tests.vlan.md index 74cb0037f..60970c9e5 100644 --- a/docs/api/tests.vlan.md +++ b/docs/api/tests.vlan.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for VLAN tests --- diff --git a/docs/api/tests.vxlan.md b/docs/api/tests.vxlan.md index 4c3859a21..131e0a317 100644 --- a/docs/api/tests.vxlan.md +++ b/docs/api/tests.vxlan.md @@ -2,7 +2,7 @@ anta_title: ANTA catalog for VXLAN tests --- diff --git a/docs/api/types.md b/docs/api/types.md index a633e0430..8398fe8bb 100644 --- a/docs/api/types.md +++ b/docs/api/types.md @@ -1,5 +1,5 @@ diff --git a/docs/cli/check.md b/docs/cli/check.md index c230722bb..4c414dc56 100644 --- a/docs/cli/check.md +++ b/docs/cli/check.md @@ -2,7 +2,7 @@ anta_title: ANTA check commands --- diff --git a/docs/cli/debug.md b/docs/cli/debug.md index 45ad791f5..3cdc78456 100644 --- a/docs/cli/debug.md +++ b/docs/cli/debug.md @@ -2,7 +2,7 @@ anta_title: ANTA debug commands --- diff --git a/docs/cli/exec.md b/docs/cli/exec.md index a7a0fe330..e658b36af 100644 --- a/docs/cli/exec.md +++ b/docs/cli/exec.md @@ -2,7 +2,7 @@ anta_title: Executing Commands on Devices --- diff --git a/docs/cli/get-inventory-information.md b/docs/cli/get-inventory-information.md index d45cb6af3..9e80445ef 100644 --- a/docs/cli/get-inventory-information.md +++ b/docs/cli/get-inventory-information.md @@ -2,7 +2,7 @@ anta_title: Retrieving Inventory Information --- diff --git a/docs/cli/get-tests.md b/docs/cli/get-tests.md index 3c2b369c0..2ccccc610 100644 --- a/docs/cli/get-tests.md +++ b/docs/cli/get-tests.md @@ -2,7 +2,7 @@ anta_title: Retrieving Tests information --- diff --git a/docs/cli/inv-from-ansible.md b/docs/cli/inv-from-ansible.md index c891693fc..7d5848eb7 100644 --- a/docs/cli/inv-from-ansible.md +++ b/docs/cli/inv-from-ansible.md @@ -2,7 +2,7 @@ anta_title: Create an Inventory from Ansible inventory --- diff --git a/docs/cli/inv-from-cvp.md b/docs/cli/inv-from-cvp.md index e08ffd616..0b4c71547 100644 --- a/docs/cli/inv-from-cvp.md +++ b/docs/cli/inv-from-cvp.md @@ -2,7 +2,7 @@ anta_title: Create an Inventory from CloudVision --- diff --git a/docs/cli/nrfu.md b/docs/cli/nrfu.md index 667eb5f9a..745e4d51f 100644 --- a/docs/cli/nrfu.md +++ b/docs/cli/nrfu.md @@ -2,7 +2,7 @@ anta_title: Execute Network Readiness For Use (NRFU) Testing --- diff --git a/docs/cli/overview.md b/docs/cli/overview.md index be6b1f43e..573df1106 100644 --- a/docs/cli/overview.md +++ b/docs/cli/overview.md @@ -2,7 +2,7 @@ anta_title: Overview of ANTA's Command-Line Interface (CLI) --- diff --git a/docs/cli/tag-management.md b/docs/cli/tag-management.md index b07e0c9e0..d0699c989 100644 --- a/docs/cli/tag-management.md +++ b/docs/cli/tag-management.md @@ -1,5 +1,5 @@ diff --git a/docs/contribution.md b/docs/contribution.md index 50aed4466..3d5704bfb 100644 --- a/docs/contribution.md +++ b/docs/contribution.md @@ -2,7 +2,7 @@ anta_title: How to contribute to ANTA --- diff --git a/docs/faq.md b/docs/faq.md index ee823b491..204972452 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -3,7 +3,7 @@ toc_depth: 3 anta_title: Frequently Asked Questions (FAQ) --- diff --git a/docs/getting-started.md b/docs/getting-started.md index bcd5a2c51..b36ea74c7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,5 +1,5 @@ diff --git a/docs/requirements-and-installation.md b/docs/requirements-and-installation.md index e9fbbc7e1..a3c2ed6b8 100644 --- a/docs/requirements-and-installation.md +++ b/docs/requirements-and-installation.md @@ -1,5 +1,5 @@ diff --git a/docs/scripts/__init__.py b/docs/scripts/__init__.py index c6adabbde..e702a5103 100644 --- a/docs/scripts/__init__.py +++ b/docs/scripts/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. """Scripts for ANTA documentation.""" diff --git a/docs/scripts/generate_examples_tests.py b/docs/scripts/generate_examples_tests.py index a88d9d6e5..6bf77e27c 100755 --- a/docs/scripts/generate_examples_tests.py +++ b/docs/scripts/generate_examples_tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. """Generates examples/tests.py.""" diff --git a/docs/scripts/generate_svg.py b/docs/scripts/generate_svg.py index 2eca6ac4a..0add9f1b2 100644 --- a/docs/scripts/generate_svg.py +++ b/docs/scripts/generate_svg.py @@ -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. """A script to generate svg files from anta command. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index a422f7cc0..f12f33ae7 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,5 +1,5 @@ diff --git a/docs/usage-inventory-catalog.md b/docs/usage-inventory-catalog.md index 7baebfbee..c2058484f 100644 --- a/docs/usage-inventory-catalog.md +++ b/docs/usage-inventory-catalog.md @@ -1,5 +1,5 @@ diff --git a/tests/__init__.py b/tests/__init__.py index 0a2486a25..7945787ce 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -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.""" diff --git a/tests/benchmark/__init__.py b/tests/benchmark/__init__.py index 7714c95e7..0f081fe25 100644 --- a/tests/benchmark/__init__.py +++ b/tests/benchmark/__init__.py @@ -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. """Benchmark tests for ANTA.""" diff --git a/tests/benchmark/conftest.py b/tests/benchmark/conftest.py index 04ce54c24..79930dc1b 100644 --- a/tests/benchmark/conftest.py +++ b/tests/benchmark/conftest.py @@ -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. """Fixtures for benchmarking ANTA.""" diff --git a/tests/benchmark/test_anta.py b/tests/benchmark/test_anta.py index 7d1f21c60..91d3b3ff2 100644 --- a/tests/benchmark/test_anta.py +++ b/tests/benchmark/test_anta.py @@ -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. """Benchmark tests for ANTA.""" diff --git a/tests/benchmark/test_reporter.py b/tests/benchmark/test_reporter.py index ea74fb5da..c6d0b295f 100644 --- a/tests/benchmark/test_reporter.py +++ b/tests/benchmark/test_reporter.py @@ -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. """Benchmark tests for anta.reporter.""" diff --git a/tests/benchmark/test_runner.py b/tests/benchmark/test_runner.py index a8639af3e..9aa54df27 100644 --- a/tests/benchmark/test_runner.py +++ b/tests/benchmark/test_runner.py @@ -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. """Benchmark tests for anta.runner.""" diff --git a/tests/benchmark/utils.py b/tests/benchmark/utils.py index 1017cfe0a..2a8443033 100644 --- a/tests/benchmark/utils.py +++ b/tests/benchmark/utils.py @@ -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. """Utils for the ANTA benchmark tests.""" diff --git a/tests/conftest.py b/tests/conftest.py index 7858e401c..362d9d0ab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/data/__init__.py b/tests/data/__init__.py index 864da68bf..eb44c552a 100644 --- a/tests/data/__init__.py +++ b/tests/data/__init__.py @@ -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. """Data for unit tests.""" diff --git a/tests/data/syntax_error.py b/tests/data/syntax_error.py index 051ef3327..e3cec345d 100644 --- a/tests/data/syntax_error.py +++ b/tests/data/syntax_error.py @@ -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. # pylint: skip-file diff --git a/tests/units/__init__.py b/tests/units/__init__.py index 6b2d4ace6..1ef6d0e75 100644 --- a/tests/units/__init__.py +++ b/tests/units/__init__.py @@ -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. """Unit tests for ANTA.""" diff --git a/tests/units/anta_tests/README.md b/tests/units/anta_tests/README.md index 6e4c5f01c..fa88b8fc2 100644 --- a/tests/units/anta_tests/README.md +++ b/tests/units/anta_tests/README.md @@ -1,5 +1,5 @@ diff --git a/tests/units/anta_tests/__init__.py b/tests/units/anta_tests/__init__.py index bfebc6d22..9bfb5f815 100644 --- a/tests/units/anta_tests/__init__.py +++ b/tests/units/anta_tests/__init__.py @@ -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 module.""" diff --git a/tests/units/anta_tests/conftest.py b/tests/units/anta_tests/conftest.py index 5e0c11b71..32964308e 100644 --- a/tests/units/anta_tests/conftest.py +++ b/tests/units/anta_tests/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/units/anta_tests/routing/__init__.py b/tests/units/anta_tests/routing/__init__.py index aef127484..a0682befa 100644 --- a/tests/units/anta_tests/routing/__init__.py +++ b/tests/units/anta_tests/routing/__init__.py @@ -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. """Test for anta.tests.routing submodule.""" diff --git a/tests/units/anta_tests/routing/test_bgp.py b/tests/units/anta_tests/routing/test_bgp.py index 59a67191c..d58054170 100644 --- a/tests/units/anta_tests/routing/test_bgp.py +++ b/tests/units/anta_tests/routing/test_bgp.py @@ -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.routing.bgp.py.""" diff --git a/tests/units/anta_tests/routing/test_generic.py b/tests/units/anta_tests/routing/test_generic.py index 4e9d654dc..a24b80b2c 100644 --- a/tests/units/anta_tests/routing/test_generic.py +++ b/tests/units/anta_tests/routing/test_generic.py @@ -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.routing.generic.py.""" diff --git a/tests/units/anta_tests/routing/test_isis.py b/tests/units/anta_tests/routing/test_isis.py index 84f5bdcf7..9c379eae3 100644 --- a/tests/units/anta_tests/routing/test_isis.py +++ b/tests/units/anta_tests/routing/test_isis.py @@ -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.routing.ospf.py.""" diff --git a/tests/units/anta_tests/routing/test_ospf.py b/tests/units/anta_tests/routing/test_ospf.py index 1555af6e6..644cd76fa 100644 --- a/tests/units/anta_tests/routing/test_ospf.py +++ b/tests/units/anta_tests/routing/test_ospf.py @@ -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.routing.ospf.py.""" diff --git a/tests/units/anta_tests/test_aaa.py b/tests/units/anta_tests/test_aaa.py index 119e20696..8589b5955 100644 --- a/tests/units/anta_tests/test_aaa.py +++ b/tests/units/anta_tests/test_aaa.py @@ -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.aaa.py.""" diff --git a/tests/units/anta_tests/test_avt.py b/tests/units/anta_tests/test_avt.py index d9cdaa1fa..bb6c6b903 100644 --- a/tests/units/anta_tests/test_avt.py +++ b/tests/units/anta_tests/test_avt.py @@ -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.avt.py.""" diff --git a/tests/units/anta_tests/test_bfd.py b/tests/units/anta_tests/test_bfd.py index 952e8388d..af1329f94 100644 --- a/tests/units/anta_tests/test_bfd.py +++ b/tests/units/anta_tests/test_bfd.py @@ -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.bfd.py.""" diff --git a/tests/units/anta_tests/test_configuration.py b/tests/units/anta_tests/test_configuration.py index d8f86beaa..9e676a93f 100644 --- a/tests/units/anta_tests/test_configuration.py +++ b/tests/units/anta_tests/test_configuration.py @@ -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. """Data for testing anta.tests.configuration.""" diff --git a/tests/units/anta_tests/test_connectivity.py b/tests/units/anta_tests/test_connectivity.py index eac3084d9..0e37e053b 100644 --- a/tests/units/anta_tests/test_connectivity.py +++ b/tests/units/anta_tests/test_connectivity.py @@ -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.connectivity.py.""" diff --git a/tests/units/anta_tests/test_cvx.py b/tests/units/anta_tests/test_cvx.py index 46d83b02a..6d0d2421d 100644 --- a/tests/units/anta_tests/test_cvx.py +++ b/tests/units/anta_tests/test_cvx.py @@ -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. """Data for testing anta.tests.cvx.""" diff --git a/tests/units/anta_tests/test_field_notices.py b/tests/units/anta_tests/test_field_notices.py index 8e7c9d8b3..13dd66095 100644 --- a/tests/units/anta_tests/test_field_notices.py +++ b/tests/units/anta_tests/test_field_notices.py @@ -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. """Test inputs for anta.tests.field_notices.""" diff --git a/tests/units/anta_tests/test_flow_tracking.py b/tests/units/anta_tests/test_flow_tracking.py index f50a76b5d..19f4d325b 100644 --- a/tests/units/anta_tests/test_flow_tracking.py +++ b/tests/units/anta_tests/test_flow_tracking.py @@ -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. """Test inputs for anta.tests.flow_tracking.""" diff --git a/tests/units/anta_tests/test_greent.py b/tests/units/anta_tests/test_greent.py index 16f36165e..3afb240e2 100644 --- a/tests/units/anta_tests/test_greent.py +++ b/tests/units/anta_tests/test_greent.py @@ -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. """Data for testing anta.tests.configuration.""" diff --git a/tests/units/anta_tests/test_hardware.py b/tests/units/anta_tests/test_hardware.py index 646ca5829..d6993c5f2 100644 --- a/tests/units/anta_tests/test_hardware.py +++ b/tests/units/anta_tests/test_hardware.py @@ -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. """Test inputs for anta.tests.hardware.""" diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index f3b4ee0c2..9e5a87190 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -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. """Test inputs for anta.tests.interfaces.""" diff --git a/tests/units/anta_tests/test_lanz.py b/tests/units/anta_tests/test_lanz.py index 03694d4e4..99a57712c 100644 --- a/tests/units/anta_tests/test_lanz.py +++ b/tests/units/anta_tests/test_lanz.py @@ -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. """Data for testing anta.tests.lanz.""" diff --git a/tests/units/anta_tests/test_logging.py b/tests/units/anta_tests/test_logging.py index b4294367e..6aeac4a21 100644 --- a/tests/units/anta_tests/test_logging.py +++ b/tests/units/anta_tests/test_logging.py @@ -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. """Data for testing anta.tests.logging.""" diff --git a/tests/units/anta_tests/test_mlag.py b/tests/units/anta_tests/test_mlag.py index 193d69c2d..387c88979 100644 --- a/tests/units/anta_tests/test_mlag.py +++ b/tests/units/anta_tests/test_mlag.py @@ -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.mlag.py.""" diff --git a/tests/units/anta_tests/test_multicast.py b/tests/units/anta_tests/test_multicast.py index 1fdcadd23..753cd10a6 100644 --- a/tests/units/anta_tests/test_multicast.py +++ b/tests/units/anta_tests/test_multicast.py @@ -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. """Test inputs for anta.tests.multicast.""" diff --git a/tests/units/anta_tests/test_path_selection.py b/tests/units/anta_tests/test_path_selection.py index d1882d04b..08377e675 100644 --- a/tests/units/anta_tests/test_path_selection.py +++ b/tests/units/anta_tests/test_path_selection.py @@ -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.""" diff --git a/tests/units/anta_tests/test_profiles.py b/tests/units/anta_tests/test_profiles.py index f822d09d3..81ef4f9f5 100644 --- a/tests/units/anta_tests/test_profiles.py +++ b/tests/units/anta_tests/test_profiles.py @@ -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.profiles.py.""" diff --git a/tests/units/anta_tests/test_ptp.py b/tests/units/anta_tests/test_ptp.py index fc94480da..112e33475 100644 --- a/tests/units/anta_tests/test_ptp.py +++ b/tests/units/anta_tests/test_ptp.py @@ -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. """Data for testing anta.tests.ptp.""" diff --git a/tests/units/anta_tests/test_security.py b/tests/units/anta_tests/test_security.py index 472eb7e18..4d51c96fc 100644 --- a/tests/units/anta_tests/test_security.py +++ b/tests/units/anta_tests/test_security.py @@ -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.security.py.""" diff --git a/tests/units/anta_tests/test_services.py b/tests/units/anta_tests/test_services.py index 639c5c685..439b8ea4f 100644 --- a/tests/units/anta_tests/test_services.py +++ b/tests/units/anta_tests/test_services.py @@ -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.services.py.""" diff --git a/tests/units/anta_tests/test_snmp.py b/tests/units/anta_tests/test_snmp.py index e7d8da8ba..195ef298e 100644 --- a/tests/units/anta_tests/test_snmp.py +++ b/tests/units/anta_tests/test_snmp.py @@ -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.snmp.py.""" diff --git a/tests/units/anta_tests/test_software.py b/tests/units/anta_tests/test_software.py index d2172bb6f..f0e5ea94d 100644 --- a/tests/units/anta_tests/test_software.py +++ b/tests/units/anta_tests/test_software.py @@ -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. """Test inputs for anta.tests.hardware.""" diff --git a/tests/units/anta_tests/test_stp.py b/tests/units/anta_tests/test_stp.py index bcd83f11d..5de5df468 100644 --- a/tests/units/anta_tests/test_stp.py +++ b/tests/units/anta_tests/test_stp.py @@ -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.stp.py.""" diff --git a/tests/units/anta_tests/test_stun.py b/tests/units/anta_tests/test_stun.py index 23834831a..1001af8a2 100644 --- a/tests/units/anta_tests/test_stun.py +++ b/tests/units/anta_tests/test_stun.py @@ -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. """Test inputs for anta.tests.stun.py.""" diff --git a/tests/units/anta_tests/test_system.py b/tests/units/anta_tests/test_system.py index f610a8e5b..858b793d1 100644 --- a/tests/units/anta_tests/test_system.py +++ b/tests/units/anta_tests/test_system.py @@ -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. """Test inputs for anta.tests.system.""" diff --git a/tests/units/anta_tests/test_vlan.py b/tests/units/anta_tests/test_vlan.py index 6bbfac496..e68bd06dc 100644 --- a/tests/units/anta_tests/test_vlan.py +++ b/tests/units/anta_tests/test_vlan.py @@ -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.vlan.py.""" diff --git a/tests/units/anta_tests/test_vxlan.py b/tests/units/anta_tests/test_vxlan.py index 4278a5945..ce9973e71 100644 --- a/tests/units/anta_tests/test_vxlan.py +++ b/tests/units/anta_tests/test_vxlan.py @@ -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.vxlan.py.""" diff --git a/tests/units/asynceapi/__init__.py b/tests/units/asynceapi/__init__.py index d4282a31b..bd6e96d34 100644 --- a/tests/units/asynceapi/__init__.py +++ b/tests/units/asynceapi/__init__.py @@ -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. """Unit tests for the asynceapi client package used by ANTA.""" diff --git a/tests/units/asynceapi/conftest.py b/tests/units/asynceapi/conftest.py index 812d5b9cd..d5ab502bd 100644 --- a/tests/units/asynceapi/conftest.py +++ b/tests/units/asynceapi/conftest.py @@ -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. """Fixtures for the asynceapi client package.""" diff --git a/tests/units/asynceapi/test_data.py b/tests/units/asynceapi/test_data.py index 908d6084b..f164c1178 100644 --- a/tests/units/asynceapi/test_data.py +++ b/tests/units/asynceapi/test_data.py @@ -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. """Unit tests data for the asynceapi client package.""" diff --git a/tests/units/asynceapi/test_device.py b/tests/units/asynceapi/test_device.py index 2c6375a85..da7af1233 100644 --- a/tests/units/asynceapi/test_device.py +++ b/tests/units/asynceapi/test_device.py @@ -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. """Unit tests the asynceapi.device module.""" diff --git a/tests/units/cli/__init__.py b/tests/units/cli/__init__.py index 1d4cf6c55..bdbfaf288 100644 --- a/tests/units/cli/__init__.py +++ b/tests/units/cli/__init__.py @@ -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. """Test anta.cli submodule.""" diff --git a/tests/units/cli/check/__init__.py b/tests/units/cli/check/__init__.py index a116af468..81c24365f 100644 --- a/tests/units/cli/check/__init__.py +++ b/tests/units/cli/check/__init__.py @@ -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. """Test anta.cli.check submodule.""" diff --git a/tests/units/cli/check/test__init__.py b/tests/units/cli/check/test__init__.py index 2501dc869..94fd49e62 100644 --- a/tests/units/cli/check/test__init__.py +++ b/tests/units/cli/check/test__init__.py @@ -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.cli.check.""" diff --git a/tests/units/cli/check/test_commands.py b/tests/units/cli/check/test_commands.py index 11c2b5ff2..abf76b81d 100644 --- a/tests/units/cli/check/test_commands.py +++ b/tests/units/cli/check/test_commands.py @@ -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.cli.check.commands.""" diff --git a/tests/units/cli/conftest.py b/tests/units/cli/conftest.py index 71c23e9c3..326b2c071 100644 --- a/tests/units/cli/conftest.py +++ b/tests/units/cli/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/units/cli/debug/__init__.py b/tests/units/cli/debug/__init__.py index ccce49cb9..129b162b4 100644 --- a/tests/units/cli/debug/__init__.py +++ b/tests/units/cli/debug/__init__.py @@ -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. """Test anta.cli.debug submodule.""" diff --git a/tests/units/cli/debug/test__init__.py b/tests/units/cli/debug/test__init__.py index fd3663fa9..2114f7ca7 100644 --- a/tests/units/cli/debug/test__init__.py +++ b/tests/units/cli/debug/test__init__.py @@ -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.cli.debug.""" diff --git a/tests/units/cli/debug/test_commands.py b/tests/units/cli/debug/test_commands.py index c802b0de8..35e871aaf 100644 --- a/tests/units/cli/debug/test_commands.py +++ b/tests/units/cli/debug/test_commands.py @@ -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.cli.debug.commands.""" diff --git a/tests/units/cli/exec/__init__.py b/tests/units/cli/exec/__init__.py index 4ed48bceb..77e4d8229 100644 --- a/tests/units/cli/exec/__init__.py +++ b/tests/units/cli/exec/__init__.py @@ -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. """Test anta.cli.exec submodule.""" diff --git a/tests/units/cli/exec/test__init__.py b/tests/units/cli/exec/test__init__.py index 124d4af0d..53544c54f 100644 --- a/tests/units/cli/exec/test__init__.py +++ b/tests/units/cli/exec/test__init__.py @@ -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.cli.exec.""" diff --git a/tests/units/cli/exec/test_commands.py b/tests/units/cli/exec/test_commands.py index 4a72d6387..73d7de73e 100644 --- a/tests/units/cli/exec/test_commands.py +++ b/tests/units/cli/exec/test_commands.py @@ -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.cli.exec.commands.""" diff --git a/tests/units/cli/exec/test_utils.py b/tests/units/cli/exec/test_utils.py index 503327ab7..2222d07c5 100644 --- a/tests/units/cli/exec/test_utils.py +++ b/tests/units/cli/exec/test_utils.py @@ -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.cli.exec.utils.""" diff --git a/tests/units/cli/get/__init__.py b/tests/units/cli/get/__init__.py index 5517deda4..d4c7c945f 100644 --- a/tests/units/cli/get/__init__.py +++ b/tests/units/cli/get/__init__.py @@ -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. """Test anta.cli.get submodule.""" diff --git a/tests/units/cli/get/local_module/__init__.py b/tests/units/cli/get/local_module/__init__.py index f93ff2bdf..b61cf70d9 100644 --- a/tests/units/cli/get/local_module/__init__.py +++ b/tests/units/cli/get/local_module/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Arista Networks, Inc. +# Copyright (c) 2024-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. """Module used for test purposes.""" diff --git a/tests/units/cli/get/test__init__.py b/tests/units/cli/get/test__init__.py index 1ef65c2ba..0ece05be4 100644 --- a/tests/units/cli/get/test__init__.py +++ b/tests/units/cli/get/test__init__.py @@ -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.cli.get.""" diff --git a/tests/units/cli/get/test_commands.py b/tests/units/cli/get/test_commands.py index 0e263f7d2..775dcbf66 100644 --- a/tests/units/cli/get/test_commands.py +++ b/tests/units/cli/get/test_commands.py @@ -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.cli.get.commands.""" diff --git a/tests/units/cli/get/test_utils.py b/tests/units/cli/get/test_utils.py index 9cff4ce15..b6eebcf7e 100644 --- a/tests/units/cli/get/test_utils.py +++ b/tests/units/cli/get/test_utils.py @@ -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.cli.get.utils.""" diff --git a/tests/units/cli/nrfu/__init__.py b/tests/units/cli/nrfu/__init__.py index db71b4d69..ff709550f 100644 --- a/tests/units/cli/nrfu/__init__.py +++ b/tests/units/cli/nrfu/__init__.py @@ -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. """Test anta.cli.nrfu submodule.""" diff --git a/tests/units/cli/nrfu/test__init__.py b/tests/units/cli/nrfu/test__init__.py index d08499c6a..f81c67e9e 100644 --- a/tests/units/cli/nrfu/test__init__.py +++ b/tests/units/cli/nrfu/test__init__.py @@ -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.cli.nrfu.""" diff --git a/tests/units/cli/nrfu/test_commands.py b/tests/units/cli/nrfu/test_commands.py index 372c86a8f..52caf5e15 100644 --- a/tests/units/cli/nrfu/test_commands.py +++ b/tests/units/cli/nrfu/test_commands.py @@ -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.cli.nrfu.commands.""" diff --git a/tests/units/cli/test__init__.py b/tests/units/cli/test__init__.py index 6e326643e..308516f87 100644 --- a/tests/units/cli/test__init__.py +++ b/tests/units/cli/test__init__.py @@ -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.cli._main.""" diff --git a/tests/units/cli/test_main.py b/tests/units/cli/test_main.py index 31a5e78c3..856470728 100644 --- a/tests/units/cli/test_main.py +++ b/tests/units/cli/test_main.py @@ -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.cli._main.""" diff --git a/tests/units/conftest.py b/tests/units/conftest.py index 665075c6f..49c786f00 100644 --- a/tests/units/conftest.py +++ b/tests/units/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/units/input_models/__init__.py b/tests/units/input_models/__init__.py index 62747a681..301442789 100644 --- a/tests/units/input_models/__init__.py +++ b/tests/units/input_models/__init__.py @@ -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.input_models module.""" diff --git a/tests/units/input_models/routing/__init__.py b/tests/units/input_models/routing/__init__.py index b56adb5fe..b8cb0995b 100644 --- a/tests/units/input_models/routing/__init__.py +++ b/tests/units/input_models/routing/__init__.py @@ -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. """Test for anta.input_models.routing submodule.""" diff --git a/tests/units/input_models/routing/test_bgp.py b/tests/units/input_models/routing/test_bgp.py index 66c37af61..b12b621f9 100644 --- a/tests/units/input_models/routing/test_bgp.py +++ b/tests/units/input_models/routing/test_bgp.py @@ -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.input_models.routing.bgp.py.""" diff --git a/tests/units/input_models/test_interfaces.py b/tests/units/input_models/test_interfaces.py index 87d742d53..ee850ee7a 100644 --- a/tests/units/input_models/test_interfaces.py +++ b/tests/units/input_models/test_interfaces.py @@ -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.input_models.interfaces.py.""" diff --git a/tests/units/inventory/__init__.py b/tests/units/inventory/__init__.py index 70fbdda9d..3b03ef0fb 100644 --- a/tests/units/inventory/__init__.py +++ b/tests/units/inventory/__init__.py @@ -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 inventory submodule.""" diff --git a/tests/units/inventory/test__init__.py b/tests/units/inventory/test__init__.py index 20a794a76..9eee88036 100644 --- a/tests/units/inventory/test__init__.py +++ b/tests/units/inventory/test__init__.py @@ -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. """ANTA Inventory unit tests.""" diff --git a/tests/units/inventory/test_models.py b/tests/units/inventory/test_models.py index dfe9722d5..63ce7a786 100644 --- a/tests/units/inventory/test_models.py +++ b/tests/units/inventory/test_models.py @@ -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. """ANTA Inventory models unit tests.""" diff --git a/tests/units/reporter/__init__.py b/tests/units/reporter/__init__.py index 6e606e564..508daa046 100644 --- a/tests/units/reporter/__init__.py +++ b/tests/units/reporter/__init__.py @@ -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.reporter submodule.""" diff --git a/tests/units/reporter/conftest.py b/tests/units/reporter/conftest.py index d0eed3639..0baa5c39b 100644 --- a/tests/units/reporter/conftest.py +++ b/tests/units/reporter/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/units/reporter/test__init__.py b/tests/units/reporter/test__init__.py index 71cccdd67..cc34cce4f 100644 --- a/tests/units/reporter/test__init__.py +++ b/tests/units/reporter/test__init__.py @@ -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. """Test anta.report.__init__.py.""" diff --git a/tests/units/reporter/test_csv.py b/tests/units/reporter/test_csv.py index d88098e13..824495111 100644 --- a/tests/units/reporter/test_csv.py +++ b/tests/units/reporter/test_csv.py @@ -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. """Test anta.report.csv_reporter.py.""" diff --git a/tests/units/reporter/test_md_reporter.py b/tests/units/reporter/test_md_reporter.py index c0676bb62..26b97ea76 100644 --- a/tests/units/reporter/test_md_reporter.py +++ b/tests/units/reporter/test_md_reporter.py @@ -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. """Test anta.reporter.md_reporter.py.""" diff --git a/tests/units/result_manager/__init__.py b/tests/units/result_manager/__init__.py index 861145b7f..fe9e668f5 100644 --- a/tests/units/result_manager/__init__.py +++ b/tests/units/result_manager/__init__.py @@ -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.result_manager submodule.""" diff --git a/tests/units/result_manager/conftest.py b/tests/units/result_manager/conftest.py index 2c5dc8a69..0586d63cb 100644 --- a/tests/units/result_manager/conftest.py +++ b/tests/units/result_manager/conftest.py @@ -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. """See https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files.""" diff --git a/tests/units/result_manager/test__init__.py b/tests/units/result_manager/test__init__.py index e41a436f6..760b6916d 100644 --- a/tests/units/result_manager/test__init__.py +++ b/tests/units/result_manager/test__init__.py @@ -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. """Test anta.result_manager.__init__.py.""" diff --git a/tests/units/result_manager/test_models.py b/tests/units/result_manager/test_models.py index 0561dffd2..1846af435 100644 --- a/tests/units/result_manager/test_models.py +++ b/tests/units/result_manager/test_models.py @@ -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. """ANTA Result Manager models unit tests.""" diff --git a/tests/units/test_catalog.py b/tests/units/test_catalog.py index 57a8e2f3b..17212a953 100644 --- a/tests/units/test_catalog.py +++ b/tests/units/test_catalog.py @@ -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. """test anta.device.py.""" diff --git a/tests/units/test_custom_types.py b/tests/units/test_custom_types.py index 95c52344a..69c0d40d4 100644 --- a/tests/units/test_custom_types.py +++ b/tests/units/test_custom_types.py @@ -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.custom_types`. diff --git a/tests/units/test_decorators.py b/tests/units/test_decorators.py index c267df1d1..a857b2c41 100644 --- a/tests/units/test_decorators.py +++ b/tests/units/test_decorators.py @@ -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. """test anta.decorators.py.""" diff --git a/tests/units/test_device.py b/tests/units/test_device.py index 17669df2a..d7b25d4eb 100644 --- a/tests/units/test_device.py +++ b/tests/units/test_device.py @@ -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. """test anta.device.py.""" diff --git a/tests/units/test_logger.py b/tests/units/test_logger.py index 706591fac..d26932001 100644 --- a/tests/units/test_logger.py +++ b/tests/units/test_logger.py @@ -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.logger.""" diff --git a/tests/units/test_models.py b/tests/units/test_models.py index d12d85941..cf2f1539c 100644 --- a/tests/units/test_models.py +++ b/tests/units/test_models.py @@ -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. """test anta.models.py.""" diff --git a/tests/units/test_runner.py b/tests/units/test_runner.py index 23f410216..b3ac1b56a 100644 --- a/tests/units/test_runner.py +++ b/tests/units/test_runner.py @@ -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. """test anta.runner.py.""" diff --git a/tests/units/test_tools.py b/tests/units/test_tools.py index b1f96a50c..396b0c840 100644 --- a/tests/units/test_tools.py +++ b/tests/units/test_tools.py @@ -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.tools`.""" From b765907531cc0a30efb2b53d607139b4c72bf775 Mon Sep 17 00:00:00 2001 From: Carl Baillargeon Date: Thu, 2 Jan 2025 10:41:37 -0500 Subject: [PATCH 3/4] feat(anta.tests): Add VerifyBGPPeerSession + minor fixes on other BGP tests (#987) --- anta/input_models/routing/bgp.py | 6 +- anta/tests/routing/bgp.py | 213 +++++++++------ examples/tests.yaml | 28 +- tests/units/anta_tests/routing/test_bgp.py | 299 +++++++++++++++++---- 4 files changed, 411 insertions(+), 135 deletions(-) diff --git a/anta/input_models/routing/bgp.py b/anta/input_models/routing/bgp.py index 04ced3853..2eb14e4bb 100644 --- a/anta/input_models/routing/bgp.py +++ b/anta/input_models/routing/bgp.py @@ -169,9 +169,11 @@ class BgpPeer(BaseModel): outbound_route_map: str | None = None """Outbound route map applied, defaults to None. Required field in the `VerifyBgpRouteMaps` test.""" maximum_routes: int | None = Field(default=None, ge=0, le=4294967294) - """The maximum allowable number of BGP routes, `0` means unlimited. Required field in the `VerifyBGPPeerRouteLimit` test""" + """The maximum allowable number of BGP routes. `0` means unlimited. Required field in the `VerifyBGPPeerRouteLimit` test""" warning_limit: int | None = Field(default=None, ge=0, le=4294967294) - """Optional maximum routes warning limit. If not provided, it defaults to `0` meaning no warning limit.""" + """The warning limit for the maximum routes. `0` means no warning. + + Optional field in the `VerifyBGPPeerRouteLimit` test. If not provided, the test will not verify the warning limit.""" def __str__(self) -> str: """Return a human-readable string representation of the BgpPeer for reporting.""" diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py index fb17cbc8c..a2863c6e0 100644 --- a/anta/tests/routing/bgp.py +++ b/anta/tests/routing/bgp.py @@ -330,8 +330,88 @@ def test(self) -> None: self.result.is_failure(f"{address_family} Peer: {peer_ip} - Session has non-empty message queues - InQ: {inq}, OutQ: {outq}") +class VerifyBGPPeerSession(AntaTest): + """Verifies the session state of BGP IPv4 peer(s). + + This test performs the following checks for each specified peer: + + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Checks that the BGP session is in the `Established` state. + 3. Ensures that both input and output TCP message queues are empty. + Can be disabled by setting `check_tcp_queues` global flag to `False`. + + Expected Results + ---------------- + * Success: If all of the following conditions are met: + - All specified peers are found in the BGP configuration. + - All peers sessions state are `Established`. + - All peers have empty TCP message queues if `check_tcp_queues` is `True` (default). + * Failure: If any of the following occur: + - A specified peer is not found in the BGP configuration. + - A peer's session state is not `Established`. + - A peer has non-empty TCP message queues (input or output) when `check_tcp_queues` is `True`. + + Examples + -------- + ```yaml + anta.tests.routing: + bgp: + - VerifyBGPPeerSession: + check_tcp_queues: false + bgp_peers: + - peer_address: 10.1.0.1 + vrf: default + - peer_address: 10.1.0.2 + vrf: default + - peer_address: 10.1.255.2 + vrf: DEV + - peer_address: 10.1.255.4 + vrf: DEV + ``` + """ + + categories: ClassVar[list[str]] = ["bgp"] + commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bgp neighbors vrf all", revision=3)] + + class Input(AntaTest.Input): + """Input model for the VerifyBGPPeerSession test.""" + + check_tcp_queues: bool = True + """Flag to check if the TCP session queues are empty for all BGP peers. Defaults to `True`.""" + bgp_peers: list[BgpPeer] + """List of BGP IPv4 peers.""" + + @AntaTest.anta_test + def test(self) -> None: + """Main test function for VerifyBGPPeerSession.""" + self.result.is_success() + + output = self.instance_commands[0].json_output + + for peer in self.inputs.bgp_peers: + peer_ip = str(peer.peer_address) + peer_list = get_value(output, f"vrfs.{peer.vrf}.peerList", default=[]) + + # Check if the peer is found + if (peer_data := get_item(peer_list, "peerAddress", peer_ip)) is None: + self.result.is_failure(f"{peer} - Not found") + continue + + # Check if the BGP session is established + if peer_data["state"] != "Established": + self.result.is_failure(f"{peer} - Session state is not established - State: {peer_data['state']}") + continue + + # Check the TCP session message queues + if self.inputs.check_tcp_queues: + inq = peer_data["peerTcpInfo"]["inputQueueLength"] + outq = peer_data["peerTcpInfo"]["outputQueueLength"] + if inq != 0 or outq != 0: + self.result.is_failure(f"{peer} - Session has non-empty message queues - InQ: {inq}, OutQ: {outq}") + + class VerifyBGPExchangedRoutes(AntaTest): - """Verifies the advertised and received routes of BGP peers. + """Verifies the advertised and received routes of BGP IPv4 peer(s). This test performs the following checks for each specified peer: @@ -381,13 +461,13 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPExchangedRoutes test.""" bgp_peers: list[BgpPeer] - """List of BGP peers.""" + """List of BGP IPv4 peers.""" BgpNeighbor: ClassVar[type[BgpNeighbor]] = BgpNeighbor @field_validator("bgp_peers") @classmethod def validate_bgp_peers(cls, bgp_peers: list[BgpPeer]) -> list[BgpPeer]: - """Validate that 'advertised_routes' or 'received_routes' field is provided in each address family.""" + """Validate that 'advertised_routes' or 'received_routes' field is provided in each BGP peer.""" for peer in bgp_peers: if peer.advertised_routes is None or peer.received_routes is None: msg = f"{peer} 'advertised_routes' or 'received_routes' field missing in the input" @@ -435,28 +515,25 @@ def test(self) -> None: class VerifyBGPPeerMPCaps(AntaTest): - """Verifies the multiprotocol capabilities of BGP peers. + """Verifies the multiprotocol capabilities of BGP IPv4 peer(s). This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. For each specified capability: + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. For each specified capability: - Validates that the capability is present in the peer configuration. - Confirms that the capability is advertised, received, and enabled. - 4. When strict mode is enabled (`strict: true`): + 3. When strict mode is enabled (`strict: true`): - Verifies that only the specified capabilities are configured. - Ensures an exact match between configured and expected capabilities. Expected Results ---------------- * Success: If all of the following conditions are met: - - The specified VRF is configured. - All specified peers are found in the BGP configuration. - All specified capabilities are present and properly negotiated. - In strict mode, only the specified capabilities are configured. * Failure: If any of the following occur: - - The specified VRF is not configured. - A specified peer is not found in the BGP configuration. - A specified capability is not found. - A capability is not properly negotiated (not advertised, received, or enabled). @@ -484,13 +561,13 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerMPCaps test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @field_validator("bgp_peers") @classmethod def validate_bgp_peers(cls, bgp_peers: list[T]) -> list[T]: - """Validate that 'capabilities' field is provided in each address family.""" + """Validate that 'capabilities' field is provided in each BGP peer.""" for peer in bgp_peers: if peer.capabilities is None: msg = f"{peer} 'capabilities' field missing in the input" @@ -506,14 +583,10 @@ def test(self) -> None: for peer in self.inputs.bgp_peers: peer_ip = str(peer.peer_address) - - # Check if the VRF is configured - if (vrf_output := get_value(output, f"vrfs.{peer.vrf}")) is None: - self.result.is_failure(f"{peer} - VRF not configured") - continue + peer_list = get_value(output, f"vrfs.{peer.vrf}.peerList", default=[]) # Check if the peer is found - if (peer_data := get_item(vrf_output["peerList"], "peerAddress", peer_ip)) is None: + if (peer_data := get_item(peer_list, "peerAddress", peer_ip)) is None: self.result.is_failure(f"{peer} - Not found") continue @@ -537,14 +610,13 @@ def test(self) -> None: class VerifyBGPPeerASNCap(AntaTest): - """Verifies the four octet ASN capability of BGP peers. + """Verifies the four octet ASN capability of BGP IPv4 peer(s). This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates that the capability is present in the peer configuration. - 4. Confirms that the capability is advertised, received, and enabled. + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates that the capability is present in the peer configuration. + 3. Confirms that the capability is advertised, received, and enabled. Expected Results ---------------- @@ -576,7 +648,7 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerASNCap test.""" bgp_peers: list[BgpPeer] - """List of BGP peers.""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @AntaTest.anta_test @@ -606,14 +678,13 @@ def test(self) -> None: class VerifyBGPPeerRouteRefreshCap(AntaTest): - """Verifies the route refresh capabilities of a BGP peer in a specified VRF. + """Verifies the route refresh capabilities of IPv4 BGP peer(s) in a specified VRF. This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates that the route refresh capability is present in the peer configuration. - 4. Confirms that the capability is advertised, received, and enabled. + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates that the route refresh capability is present in the peer configuration. + 3. Confirms that the capability is advertised, received, and enabled. Expected Results ---------------- @@ -645,7 +716,7 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerRouteRefreshCap test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @AntaTest.anta_test @@ -675,14 +746,13 @@ def test(self) -> None: class VerifyBGPPeerMD5Auth(AntaTest): - """Verifies the MD5 authentication and state of IPv4 BGP peers in a specified VRF. + """Verifies the MD5 authentication and state of IPv4 BGP peer(s) in a specified VRF. This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates that the BGP session is in `Established` state. - 4. Confirms that MD5 authentication is enabled for the peer. + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates that the BGP session is in `Established` state. + 3. Confirms that MD5 authentication is enabled for the peer. Expected Results ---------------- @@ -814,13 +884,12 @@ def test(self) -> None: class VerifyBGPAdvCommunities(AntaTest): - """Verifies that advertised communities are standard, extended and large for BGP peers. + """Verifies that advertised communities are standard, extended and large for BGP IPv4 peer(s). This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates that all required community types are advertised: + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates that all required community types are advertised: - Standard communities - Extended communities - Large communities @@ -855,7 +924,7 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPAdvCommunities test.""" bgp_peers: list[BgpPeer] - """List of BGP peers.""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @AntaTest.anta_test @@ -880,13 +949,12 @@ def test(self) -> None: class VerifyBGPTimers(AntaTest): - """Verifies the timers of BGP peers. + """Verifies the timers of BGP IPv4 peer(s). This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Confirms the BGP session hold time/keepalive timers match the expected value. + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Confirms the BGP session hold time/keepalive timers match the expected value. Expected Results ---------------- @@ -922,13 +990,13 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPTimers test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @field_validator("bgp_peers") @classmethod def validate_bgp_peers(cls, bgp_peers: list[T]) -> list[T]: - """Validate that 'hold_time' or 'keep_alive_time' field is provided in each address family.""" + """Validate that 'hold_time' or 'keep_alive_time' field is provided in each BGP peer.""" for peer in bgp_peers: if peer.hold_time is None or peer.keep_alive_time is None: msg = f"{peer} 'hold_time' or 'keep_alive_time' field missing in the input" @@ -963,9 +1031,8 @@ class VerifyBGPPeerDropStats(AntaTest): This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates the BGP drop statistics: + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates the BGP drop statistics: - If specific drop statistics are provided, checks only those counters. - If no specific drop statistics are provided, checks all available counters. - Confirms that all checked counters have a value of zero. @@ -1002,7 +1069,7 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerDropStats test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @AntaTest.anta_test @@ -1040,9 +1107,8 @@ class VerifyBGPPeerUpdateErrors(AntaTest): This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates the BGP update error counters: + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates the BGP update error counters: - If specific update error counters are provided, checks only those counters. - If no update error counters are provided, checks all available counters. - Confirms that all checked counters have a value of zero. @@ -1080,7 +1146,7 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerUpdateErrors test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @AntaTest.anta_test @@ -1118,9 +1184,8 @@ class VerifyBgpRouteMaps(AntaTest): This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Validates the correct BGP route maps are applied in the correct direction (inbound or outbound). + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Validates the correct BGP route maps are applied in the correct direction (inbound or outbound). Expected Results ---------------- @@ -1152,16 +1217,13 @@ class Input(AntaTest.Input): """Input model for the VerifyBgpRouteMaps test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @field_validator("bgp_peers") @classmethod def validate_bgp_peers(cls, bgp_peers: list[T]) -> list[T]: - """Validate that 'peers' field is provided in each address family. - - At least one of 'inbound' or 'outbound' route-map must be provided. - """ + """Validate that 'inbound_route_map' or 'outbound_route_map' field is provided in each BGP peer.""" for peer in bgp_peers: if not (peer.inbound_route_map or peer.outbound_route_map): msg = f"{peer}; At least one of 'inbound_route_map' or 'outbound_route_map' must be provided." @@ -1196,22 +1258,21 @@ def test(self) -> None: class VerifyBGPPeerRouteLimit(AntaTest): - """Verifies maximum routes and outbound route-maps of BGP IPv4 peer(s). + """Verifies maximum routes and warning limit for BGP IPv4 peer(s). This test performs the following checks for each specified peer: - 1. Confirms that the specified VRF is configured. - 2. Verifies that the peer exists in the BGP configuration. - 3. Confirms the Maximum routes and maximum routes warning limit, if provided match the expected value. + 1. Verifies that the peer is found in its VRF in the BGP configuration. + 2. Confirms the maximum routes and maximum routes warning limit, if provided, match the expected value. Expected Results ---------------- * Success: If all of the following conditions are met: - All specified peers are found in the BGP configuration. - - The maximum routese/maximum routes warning limit match the expected value for a peer. + - The maximum routes/maximum routes warning limit match the expected value for a peer. * Failure: If any of the following occur: - A specified peer is not found in the BGP configuration. - - The maximum routese/maximum routes warning limit do not match the expected value for a peer. + - The maximum routes/maximum routes warning limit do not match the expected value for a peer. Examples -------- @@ -1234,13 +1295,13 @@ class Input(AntaTest.Input): """Input model for the VerifyBGPPeerRouteLimit test.""" bgp_peers: list[BgpPeer] - """List of BGP peers""" + """List of BGP IPv4 peers.""" BgpPeer: ClassVar[type[BgpPeer]] = BgpPeer @field_validator("bgp_peers") @classmethod def validate_bgp_peers(cls, bgp_peers: list[T]) -> list[T]: - """Validate that 'peers' field is provided in each address family.""" + """Validate that 'maximum_routes' field is provided in each BGP peer.""" for peer in bgp_peers: if peer.maximum_routes is None: msg = f"{peer}; 'maximum_routes' field missing in the input" @@ -1265,10 +1326,10 @@ def test(self) -> None: self.result.is_failure(f"{peer} - Not found") continue - # Verify maximum routes configured. - if (actual_routes := peer_data.get("maxTotalRoutes", "Not Found")) != maximum_routes: - self.result.is_failure(f"{peer} - Maximum routes mismatch - Expected: {maximum_routes}, Actual: {actual_routes}") + # Verify maximum routes + if (actual_maximum_routes := peer_data.get("maxTotalRoutes", "Not Found")) != maximum_routes: + self.result.is_failure(f"{peer} - Maximum routes mismatch - Expected: {maximum_routes}, Actual: {actual_maximum_routes}") - # Verify warning limit if given. - if warning_limit and (actual_warning_limit := peer_data.get("totalRoutesWarnLimit", "Not Found")) != warning_limit: - self.result.is_failure(f"{peer} - Maximum route warning limit mismatch - Expected: {warning_limit}, Actual: {actual_warning_limit}") + # Verify warning limit if provided. By default, EOS does not have a warning limit and `totalRoutesWarnLimit` is not present in the output. + if warning_limit is not None and (actual_warning_limit := peer_data.get("totalRoutesWarnLimit", 0)) != warning_limit: + self.result.is_failure(f"{peer} - Maximum routes warning limit mismatch - Expected: {warning_limit}, Actual: {actual_warning_limit}") diff --git a/examples/tests.yaml b/examples/tests.yaml index 6e1fc5b85..a4bc1fabf 100644 --- a/examples/tests.yaml +++ b/examples/tests.yaml @@ -366,14 +366,14 @@ anta.tests.ptp: # Verifies the PTP interfaces state. anta.tests.routing.bgp: - VerifyBGPAdvCommunities: - # Verifies that advertised communities are standard, extended and large for BGP peers. + # Verifies that advertised communities are standard, extended and large for BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.11.17 vrf: default - peer_address: 172.30.11.21 vrf: default - VerifyBGPExchangedRoutes: - # Verifies the advertised and received routes of BGP peers. + # Verifies the advertised and received routes of BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.255.5 vrf: default @@ -389,7 +389,7 @@ anta.tests.routing.bgp: received_routes: - 192.0.254.3/32 - VerifyBGPPeerASNCap: - # Verifies the four octet ASN capability of BGP peers. + # Verifies the four octet ASN capability of BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.11.1 vrf: default @@ -419,14 +419,14 @@ anta.tests.routing.bgp: - inDropAsloop - prefixEvpnDroppedUnsupportedRouteType - VerifyBGPPeerMD5Auth: - # Verifies the MD5 authentication and state of IPv4 BGP peers in a specified VRF. + # Verifies the MD5 authentication and state of IPv4 BGP peer(s) in a specified VRF. bgp_peers: - peer_address: 172.30.11.1 vrf: default - peer_address: 172.30.11.5 vrf: default - VerifyBGPPeerMPCaps: - # Verifies the multiprotocol capabilities of BGP peers. + # Verifies the multiprotocol capabilities of BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.11.1 vrf: default @@ -434,17 +434,29 @@ anta.tests.routing.bgp: capabilities: - ipv4Unicast - VerifyBGPPeerRouteLimit: - # Verifies maximum routes and outbound route-maps of BGP IPv4 peer(s). + # Verifies maximum routes and warning limit for BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.11.1 vrf: default maximum_routes: 12000 warning_limit: 10000 - VerifyBGPPeerRouteRefreshCap: - # Verifies the route refresh capabilities of a BGP peer in a specified VRF. + # Verifies the route refresh capabilities of IPv4 BGP peer(s) in a specified VRF. bgp_peers: - peer_address: 172.30.11.1 vrf: default + - VerifyBGPPeerSession: + # Verifies the session state of BGP IPv4 peer(s). + check_tcp_queues: false + bgp_peers: + - peer_address: 10.1.0.1 + vrf: default + - peer_address: 10.1.0.2 + vrf: default + - peer_address: 10.1.255.2 + vrf: DEV + - peer_address: 10.1.255.4 + vrf: DEV - VerifyBGPPeerUpdateErrors: # Verifies BGP update error counters for the provided BGP IPv4 peer(s). bgp_peers: @@ -478,7 +490,7 @@ anta.tests.routing.bgp: - 10.1.255.2 - 10.1.255.4 - VerifyBGPTimers: - # Verifies the timers of BGP peers. + # Verifies the timers of BGP IPv4 peer(s). bgp_peers: - peer_address: 172.30.11.1 vrf: default diff --git a/tests/units/anta_tests/routing/test_bgp.py b/tests/units/anta_tests/routing/test_bgp.py index d58054170..4d9e3c026 100644 --- a/tests/units/anta_tests/routing/test_bgp.py +++ b/tests/units/anta_tests/routing/test_bgp.py @@ -21,6 +21,7 @@ VerifyBGPPeerMPCaps, VerifyBGPPeerRouteLimit, VerifyBGPPeerRouteRefreshCap, + VerifyBGPPeerSession, VerifyBGPPeersHealth, VerifyBGPPeerUpdateErrors, VerifyBgpRouteMaps, @@ -1389,50 +1390,6 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo }, "expected": {"result": "success"}, }, - { - "name": "failure-no-vrf", - "test": VerifyBGPPeerMPCaps, - "eos_data": [ - { - "vrfs": { - "default": { - "peerList": [ - { - "peerAddress": "172.30.11.1", - "neighborCapabilities": { - "multiprotocolCaps": { - "ipv4Unicast": { - "advertised": True, - "received": True, - "enabled": True, - }, - "ipv4MplsVpn": { - "advertised": True, - "received": True, - "enabled": True, - }, - } - }, - } - ] - } - } - } - ], - "inputs": { - "bgp_peers": [ - { - "peer_address": "172.30.11.1", - "vrf": "MGMT", - "capabilities": ["ipv4 Unicast", "ipv4mplslabels"], - } - ] - }, - "expected": { - "result": "failure", - "messages": ["Peer: 172.30.11.1 VRF: MGMT - VRF not configured"], - }, - }, { "name": "failure-no-peer", "test": VerifyBGPPeerMPCaps, @@ -3740,6 +3697,39 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo }, "expected": {"result": "success"}, }, + { + "name": "success-no-warning-limit", + "test": VerifyBGPPeerRouteLimit, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "maxTotalRoutes": 12000, + } + ] + }, + "MGMT": { + "peerList": [ + { + "peerAddress": "10.100.0.9", + "maxTotalRoutes": 10000, + } + ] + }, + }, + }, + ], + "inputs": { + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default", "maximum_routes": 12000, "warning_limit": 0}, + {"peer_address": "10.100.0.9", "vrf": "MGMT", "maximum_routes": 10000}, + ] + }, + "expected": {"result": "success"}, + }, { "name": "failure-peer-not-found", "test": VerifyBGPPeerRouteLimit, @@ -3802,9 +3792,9 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo "result": "failure", "messages": [ "Peer: 10.100.0.8 VRF: default - Maximum routes mismatch - Expected: 12000, Actual: 13000", - "Peer: 10.100.0.8 VRF: default - Maximum route warning limit mismatch - Expected: 10000, Actual: 11000", + "Peer: 10.100.0.8 VRF: default - Maximum routes warning limit mismatch - Expected: 10000, Actual: 11000", "Peer: 10.100.0.9 VRF: MGMT - Maximum routes mismatch - Expected: 10000, Actual: 11000", - "Peer: 10.100.0.9 VRF: MGMT - Maximum route warning limit mismatch - Expected: 9000, Actual: 10000", + "Peer: 10.100.0.9 VRF: MGMT - Maximum routes warning limit mismatch - Expected: 9000, Actual: 10000", ], }, }, @@ -3826,6 +3816,7 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo "peerList": [ { "peerAddress": "10.100.0.9", + "maxTotalRoutes": 10000, } ] }, @@ -3841,9 +3832,219 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo "expected": { "result": "failure", "messages": [ - "Peer: 10.100.0.8 VRF: default - Maximum route warning limit mismatch - Expected: 10000, Actual: Not Found", - "Peer: 10.100.0.9 VRF: MGMT - Maximum routes mismatch - Expected: 10000, Actual: Not Found", - "Peer: 10.100.0.9 VRF: MGMT - Maximum route warning limit mismatch - Expected: 9000, Actual: Not Found", + "Peer: 10.100.0.8 VRF: default - Maximum routes warning limit mismatch - Expected: 10000, Actual: 0", + "Peer: 10.100.0.9 VRF: MGMT - Maximum routes warning limit mismatch - Expected: 9000, Actual: 0", + ], + }, + }, + { + "name": "success-no-check-tcp-queues", + "test": VerifyBGPPeerSession, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 10, + "inputQueueLength": 5, + }, + } + ] + }, + "MGMT": { + "peerList": [ + { + "peerAddress": "10.100.0.9", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 10, + "inputQueueLength": 5, + }, + } + ] + }, + }, + }, + ], + "inputs": { + "check_tcp_queues": False, + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default"}, + {"peer_address": "10.100.0.9", "vrf": "MGMT"}, + ], + }, + "expected": {"result": "success"}, + }, + { + "name": "success-check-tcp-queues", + "test": VerifyBGPPeerSession, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + "MGMT": { + "peerList": [ + { + "peerAddress": "10.100.0.9", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + }, + }, + ], + "inputs": { + "check_tcp_queues": True, + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default"}, + {"peer_address": "10.100.0.9", "vrf": "MGMT"}, + ], + }, + "expected": {"result": "success"}, + }, + { + "name": "failure-peer-not-found", + "test": VerifyBGPPeerSession, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + }, + }, + ], + "inputs": { + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default"}, + {"peer_address": "10.100.0.9", "vrf": "MGMT"}, + ] + }, + "expected": { + "result": "failure", + "messages": [ + "Peer: 10.100.0.9 VRF: MGMT - Not found", + ], + }, + }, + { + "name": "failure-not-established", + "test": VerifyBGPPeerSession, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "state": "Active", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + "MGMT": { + "peerList": [ + { + "peerAddress": "10.100.0.9", + "state": "Active", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + }, + }, + ], + "inputs": { + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default"}, + {"peer_address": "10.100.0.9", "vrf": "MGMT"}, + ] + }, + "expected": { + "result": "failure", + "messages": [ + "Peer: 10.100.0.8 VRF: default - Session state is not established - State: Active", + "Peer: 10.100.0.9 VRF: MGMT - Session state is not established - State: Active", + ], + }, + }, + { + "name": "failure-check-tcp-queues", + "test": VerifyBGPPeerSession, + "eos_data": [ + { + "vrfs": { + "default": { + "peerList": [ + { + "peerAddress": "10.100.0.8", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 10, + "inputQueueLength": 5, + }, + } + ] + }, + "MGMT": { + "peerList": [ + { + "peerAddress": "10.100.0.9", + "state": "Established", + "peerTcpInfo": { + "outputQueueLength": 0, + "inputQueueLength": 0, + }, + } + ] + }, + }, + }, + ], + "inputs": { + "bgp_peers": [ + {"peer_address": "10.100.0.8", "vrf": "default"}, + {"peer_address": "10.100.0.9", "vrf": "MGMT"}, + ] + }, + "expected": { + "result": "failure", + "messages": [ + "Peer: 10.100.0.8 VRF: default - Session has non-empty message queues - InQ: 5, OutQ: 10", ], }, }, From 0d68318004f7bea30bd16f9724cd83b35808665e Mon Sep 17 00:00:00 2001 From: Carl Baillargeon Date: Fri, 3 Jan 2025 04:15:32 -0500 Subject: [PATCH 4/4] fix(anta): Fix various issues in CSV and Markdown reporters (#990) * fix(anta): Fix various issues in CSV and Markdown reporters * Add sorting in unit test * Fix per review comments --- anta/cli/nrfu/utils.py | 2 +- anta/constants.py | 21 ++++- anta/reporter/__init__.py | 4 +- anta/reporter/csv_reporter.py | 2 + anta/reporter/md_reporter.py | 13 +-- anta/result_manager/__init__.py | 45 ++++++++-- tests/data/test_md_report.md | 30 +++---- tests/units/reporter/test_md_reporter.py | 6 +- tests/units/result_manager/test__init__.py | 99 ++++++++++++++++++++-- 9 files changed, 180 insertions(+), 42 deletions(-) diff --git a/anta/cli/nrfu/utils.py b/anta/cli/nrfu/utils.py index 0552fb411..60c0d2976 100644 --- a/anta/cli/nrfu/utils.py +++ b/anta/cli/nrfu/utils.py @@ -157,7 +157,7 @@ def save_markdown_report(ctx: click.Context, md_output: pathlib.Path) -> None: Path to save the markdown report. """ try: - MDReportGenerator.generate(results=_get_result_manager(ctx), md_filename=md_output) + MDReportGenerator.generate(results=_get_result_manager(ctx).sort(["name", "categories", "test"]), md_filename=md_output) console.print(f"Markdown report saved to {md_output} ✅", style="cyan") except OSError: console.print(f"Failed to save Markdown report to {md_output} ❌", style="cyan") diff --git a/anta/constants.py b/anta/constants.py index 7a2fc22e9..ae131dd1a 100644 --- a/anta/constants.py +++ b/anta/constants.py @@ -5,7 +5,26 @@ from __future__ import annotations -ACRONYM_CATEGORIES: set[str] = {"aaa", "mlag", "snmp", "bgp", "ospf", "vxlan", "stp", "igmp", "ip", "lldp", "ntp", "bfd", "ptp", "lanz", "stun", "vlan"} +ACRONYM_CATEGORIES: set[str] = { + "aaa", + "avt", + "bfd", + "bgp", + "igmp", + "ip", + "isis", + "lanz", + "lldp", + "mlag", + "ntp", + "ospf", + "ptp", + "snmp", + "stp", + "stun", + "vlan", + "vxlan", +} """A set of network protocol or feature acronyms that should be represented in uppercase.""" MD_REPORT_TOC = """**Table of Contents:** diff --git a/anta/reporter/__init__.py b/anta/reporter/__init__.py index 32a8192fc..696a499a6 100644 --- a/anta/reporter/__init__.py +++ b/anta/reporter/__init__.py @@ -168,7 +168,7 @@ def report_summary_tests( self.Headers.list_of_error_nodes, ] table = self._build_headers(headers=headers, table=table) - for test, stats in sorted(manager.test_stats.items()): + for test, stats in manager.test_stats.items(): if tests is None or test in tests: table.add_row( test, @@ -214,7 +214,7 @@ def report_summary_devices( self.Headers.list_of_error_tests, ] table = self._build_headers(headers=headers, table=table) - for device, stats in sorted(manager.device_stats.items()): + for device, stats in manager.device_stats.items(): if devices is None or device in devices: table.add_row( device, diff --git a/anta/reporter/csv_reporter.py b/anta/reporter/csv_reporter.py index 83292f344..2a0a4de2c 100644 --- a/anta/reporter/csv_reporter.py +++ b/anta/reporter/csv_reporter.py @@ -8,6 +8,7 @@ import csv import logging +import os from dataclasses import dataclass from typing import TYPE_CHECKING @@ -111,6 +112,7 @@ def generate(cls, results: ResultManager, csv_filename: pathlib.Path) -> None: csvwriter = csv.writer( csvfile, delimiter=",", + lineterminator=os.linesep, ) csvwriter.writerow(headers) for entry in results.results: diff --git a/anta/reporter/md_reporter.py b/anta/reporter/md_reporter.py index 69fc6640b..16db69f9d 100644 --- a/anta/reporter/md_reporter.py +++ b/anta/reporter/md_reporter.py @@ -237,7 +237,7 @@ class SummaryTotalsDeviceUnderTest(MDReportBase): def generate_rows(self) -> Generator[str, None, None]: """Generate the rows of the summary totals device under test table.""" for device, stat in self.results.device_stats.items(): - total_tests = stat.tests_success_count + stat.tests_skipped_count + stat.tests_failure_count + stat.tests_error_count + total_tests = stat.tests_success_count + stat.tests_skipped_count + stat.tests_failure_count + stat.tests_error_count + stat.tests_unset_count categories_skipped = ", ".join(sorted(convert_categories(list(stat.categories_skipped)))) categories_failed = ", ".join(sorted(convert_categories(list(stat.categories_failed)))) yield ( @@ -261,10 +261,11 @@ class SummaryTotalsPerCategory(MDReportBase): def generate_rows(self) -> Generator[str, None, None]: """Generate the rows of the summary totals per category table.""" - for category, stat in self.results.sorted_category_stats.items(): - total_tests = stat.tests_success_count + stat.tests_skipped_count + stat.tests_failure_count + stat.tests_error_count + for category, stat in self.results.category_stats.items(): + converted_category = convert_categories([category])[0] + total_tests = stat.tests_success_count + stat.tests_skipped_count + stat.tests_failure_count + stat.tests_error_count + stat.tests_unset_count yield ( - f"| {category} | {total_tests} | {stat.tests_success_count} | {stat.tests_skipped_count} | {stat.tests_failure_count} " + f"| {converted_category} | {total_tests} | {stat.tests_success_count} | {stat.tests_skipped_count} | {stat.tests_failure_count} " f"| {stat.tests_error_count} |\n" ) @@ -284,9 +285,9 @@ class TestResults(MDReportBase): def generate_rows(self) -> Generator[str, None, None]: """Generate the rows of the all test results table.""" - for result in self.results.get_results(sort_by=["name", "test"]): + for result in self.results.results: messages = self.safe_markdown(", ".join(result.messages)) - categories = ", ".join(convert_categories(result.categories)) + categories = ", ".join(sorted(convert_categories(result.categories))) yield ( f"| {result.name or '-'} | {categories or '-'} | {result.test or '-'} " f"| {result.description or '-'} | {self.safe_markdown(result.custom_field) or '-'} | {result.result or '-'} | {messages or '-'} |\n" diff --git a/anta/result_manager/__init__.py b/anta/result_manager/__init__.py index 8c535224a..17d445cf9 100644 --- a/anta/result_manager/__init__.py +++ b/anta/result_manager/__init__.py @@ -7,6 +7,7 @@ import json import logging +import warnings from collections import defaultdict from functools import cached_property from itertools import chain @@ -143,28 +144,41 @@ def json(self) -> str: return json.dumps(self.dump, indent=4) @property - def device_stats(self) -> defaultdict[str, DeviceStats]: + def device_stats(self) -> dict[str, DeviceStats]: """Get the device statistics.""" self._ensure_stats_in_sync() - return self._device_stats + return dict(sorted(self._device_stats.items())) @property - def category_stats(self) -> defaultdict[str, CategoryStats]: + def category_stats(self) -> dict[str, CategoryStats]: """Get the category statistics.""" self._ensure_stats_in_sync() - return self._category_stats + return dict(sorted(self._category_stats.items())) @property - def test_stats(self) -> defaultdict[str, TestStats]: + def test_stats(self) -> dict[str, TestStats]: """Get the test statistics.""" self._ensure_stats_in_sync() - return self._test_stats + return dict(sorted(self._test_stats.items())) @property def sorted_category_stats(self) -> dict[str, CategoryStats]: - """A property that returns the category_stats dictionary sorted by key name.""" + """A property that returns the category_stats dictionary sorted by key name. + + Deprecated + ---------- + This property is deprecated and will be removed in ANTA v2.0.0. + Use `category_stats` instead as it is now sorted by default. + + TODO: Remove this property in ANTA v2.0.0. + """ + warnings.warn( + "sorted_category_stats is deprecated and will be removed in ANTA v2.0.0. Use category_stats instead as it is now sorted by default.", + DeprecationWarning, + stacklevel=2, + ) self._ensure_stats_in_sync() - return dict(sorted(self.category_stats.items())) + return self.category_stats @cached_property def results_by_status(self) -> dict[AntaTestStatus, list[TestResult]]: @@ -316,6 +330,21 @@ def get_status(self, *, ignore_error: bool = False) -> str: """Return the current status including error_status if ignore_error is False.""" return "error" if self.error_status and not ignore_error else self.status + def sort(self, sort_by: list[str]) -> ResultManager: + """Sort the ResultManager results based on TestResult fields. + + Parameters + ---------- + sort_by + List of TestResult fields to sort the results. + """ + accepted_fields = TestResult.model_fields.keys() + if not set(sort_by).issubset(set(accepted_fields)): + msg = f"Invalid sort_by fields: {sort_by}. Accepted fields are: {list(accepted_fields)}" + raise ValueError(msg) + self._result_entries.sort(key=lambda result: [getattr(result, field) for field in sort_by]) + return self + def filter(self, hide: set[AntaTestStatus]) -> ResultManager: """Get a filtered ResultManager based on test status. diff --git a/tests/data/test_md_report.md b/tests/data/test_md_report.md index 9360dbc74..db8d47f9a 100644 --- a/tests/data/test_md_report.md +++ b/tests/data/test_md_report.md @@ -21,8 +21,8 @@ | Device Under Test | Total Tests | Tests Success | Tests Skipped | Tests Failure | Tests Error | Categories Skipped | Categories Failed | | ------------------| ----------- | ------------- | ------------- | ------------- | ----------- | -------------------| ------------------| -| DC1-SPINE1 | 15 | 2 | 2 | 10 | 1 | MLAG, VXLAN | AAA, BFD, BGP, Connectivity, Routing, SNMP, STP, Services, Software, System | | DC1-LEAF1A | 15 | 5 | 0 | 9 | 1 | - | AAA, BFD, BGP, Connectivity, SNMP, STP, Services, Software, System | +| DC1-SPINE1 | 15 | 2 | 2 | 10 | 1 | MLAG, VXLAN | AAA, BFD, BGP, Connectivity, Routing, SNMP, STP, Services, Software, System | ### Summary Totals Per Category @@ -47,33 +47,33 @@ | Device Under Test | Categories | Test | Description | Custom Field | Result | Messages | | ----------------- | ---------- | ---- | ----------- | ------------ | ------ | -------- | +| DC1-LEAF1A | AAA | VerifyTacacsSourceIntf | Verifies TACACS source-interface for a specified VRF. | - | failure | Source-interface Management0 is not configured in VRF default | | DC1-LEAF1A | BFD | VerifyBFDSpecificPeers | Verifies the IPv4 BFD peer's sessions and remote disc in the specified VRF. | - | failure | Following BFD peers are not configured, status is not up or remote disc is zero: {'192.0.255.8': {'default': 'Not Configured'}, '192.0.255.7': {'default': 'Not Configured'}} | | DC1-LEAF1A | BGP | VerifyBGPPeerCount | Verifies the count of BGP peers. | - | failure | Failures: [{'afi': 'ipv4', 'safi': 'unicast', 'vrfs': {'PROD': 'Expected: 2, Actual: 1'}}, {'afi': 'ipv4', 'safi': 'multicast', 'vrfs': {'DEV': 'Expected: 3, Actual: 0'}}] | -| DC1-LEAF1A | Software | VerifyEOSVersion | Verifies the EOS version of the device. | - | failure | device is running version "4.31.1F-34554157.4311F (engineering build)" not in expected versions: ['4.25.4M', '4.26.1F'] | -| DC1-LEAF1A | Services | VerifyHostname | Verifies the hostname of a device. | - | failure | Expected 's1-spine1' as the hostname, but found 'DC1-LEAF1A' instead. | -| DC1-LEAF1A | Interfaces | VerifyInterfaceUtilization | Verifies that the utilization of interfaces is below a certain threshold. | - | success | - | | DC1-LEAF1A | Connectivity | VerifyLLDPNeighbors | Verifies that the provided LLDP neighbors are connected properly. | - | failure | Wrong LLDP neighbor(s) on port(s): Ethernet1 DC1-SPINE1_Ethernet1 Ethernet2 DC1-SPINE2_Ethernet1 Port(s) not configured: Ethernet7 | -| DC1-LEAF1A | MLAG | VerifyMlagStatus | Verifies the health status of the MLAG configuration. | - | success | - | -| DC1-LEAF1A | System | VerifyNTP | Verifies if NTP is synchronised. | - | failure | The device is not synchronized with the configured NTP server(s): 'NTP is disabled.' | | DC1-LEAF1A | Connectivity | VerifyReachability | Test the network reachability to one or many destination IP(s). | - | error | ping vrf MGMT 1.1.1.1 source Management1 repeat 2 has failed: No source interface Management1 | +| DC1-LEAF1A | Interfaces | VerifyInterfaceUtilization | Verifies that the utilization of interfaces is below a certain threshold. | - | success | - | +| DC1-LEAF1A | MLAG | VerifyMlagStatus | Verifies the health status of the MLAG configuration. | - | success | - | | DC1-LEAF1A | Routing | VerifyRoutingTableEntry | Verifies that the provided routes are present in the routing table of a specified VRF. | - | success | - | -| DC1-LEAF1A | STP | VerifySTPMode | Verifies the configured STP mode for a provided list of VLAN(s). | - | failure | Wrong STP mode configured for the following VLAN(s): [10, 20] | | DC1-LEAF1A | SNMP | VerifySnmpStatus | Verifies if the SNMP agent is enabled. | - | failure | SNMP agent disabled in vrf default | -| DC1-LEAF1A | AAA | VerifyTacacsSourceIntf | Verifies TACACS source-interface for a specified VRF. | - | failure | Source-interface Management0 is not configured in VRF default | +| DC1-LEAF1A | STP | VerifySTPMode | Verifies the configured STP mode for a provided list of VLAN(s). | - | failure | Wrong STP mode configured for the following VLAN(s): [10, 20] | | DC1-LEAF1A | Security | VerifyTelnetStatus | Verifies if Telnet is disabled in the default VRF. | - | success | - | +| DC1-LEAF1A | Services | VerifyHostname | Verifies the hostname of a device. | - | failure | Expected 's1-spine1' as the hostname, but found 'DC1-LEAF1A' instead. | +| DC1-LEAF1A | Software | VerifyEOSVersion | Verifies the EOS version of the device. | - | failure | device is running version "4.31.1F-34554157.4311F (engineering build)" not in expected versions: ['4.25.4M', '4.26.1F'] | +| DC1-LEAF1A | System | VerifyNTP | Verifies if NTP is synchronised. | - | failure | The device is not synchronized with the configured NTP server(s): 'NTP is disabled.' | | DC1-LEAF1A | VXLAN | VerifyVxlan1Interface | Verifies the Vxlan1 interface status. | - | success | - | +| DC1-SPINE1 | AAA | VerifyTacacsSourceIntf | Verifies TACACS source-interface for a specified VRF. | - | failure | Source-interface Management0 is not configured in VRF default | | DC1-SPINE1 | BFD | VerifyBFDSpecificPeers | Verifies the IPv4 BFD peer's sessions and remote disc in the specified VRF. | - | failure | Following BFD peers are not configured, status is not up or remote disc is zero: {'192.0.255.8': {'default': 'Not Configured'}, '192.0.255.7': {'default': 'Not Configured'}} | | DC1-SPINE1 | BGP | VerifyBGPPeerCount | Verifies the count of BGP peers. | - | failure | Failures: [{'afi': 'ipv4', 'safi': 'unicast', 'vrfs': {'PROD': 'Not Configured', 'default': 'Expected: 3, Actual: 4'}}, {'afi': 'ipv4', 'safi': 'multicast', 'vrfs': {'DEV': 'Not Configured'}}, {'afi': 'evpn', 'vrfs': {'default': 'Expected: 2, Actual: 4'}}] | -| DC1-SPINE1 | Software | VerifyEOSVersion | Verifies the EOS version of the device. | - | failure | device is running version "4.31.1F-34554157.4311F (engineering build)" not in expected versions: ['4.25.4M', '4.26.1F'] | -| DC1-SPINE1 | Services | VerifyHostname | Verifies the hostname of a device. | - | failure | Expected 's1-spine1' as the hostname, but found 'DC1-SPINE1' instead. | -| DC1-SPINE1 | Interfaces | VerifyInterfaceUtilization | Verifies that the utilization of interfaces is below a certain threshold. | - | success | - | | DC1-SPINE1 | Connectivity | VerifyLLDPNeighbors | Verifies that the provided LLDP neighbors are connected properly. | - | failure | Wrong LLDP neighbor(s) on port(s): Ethernet1 DC1-LEAF1A_Ethernet1 Ethernet2 DC1-LEAF1B_Ethernet1 Port(s) not configured: Ethernet7 | -| DC1-SPINE1 | MLAG | VerifyMlagStatus | Verifies the health status of the MLAG configuration. | - | skipped | MLAG is disabled | -| DC1-SPINE1 | System | VerifyNTP | Verifies if NTP is synchronised. | - | failure | The device is not synchronized with the configured NTP server(s): 'NTP is disabled.' | | DC1-SPINE1 | Connectivity | VerifyReachability | Test the network reachability to one or many destination IP(s). | - | error | ping vrf MGMT 1.1.1.1 source Management1 repeat 2 has failed: No source interface Management1 | +| DC1-SPINE1 | Interfaces | VerifyInterfaceUtilization | Verifies that the utilization of interfaces is below a certain threshold. | - | success | - | +| DC1-SPINE1 | MLAG | VerifyMlagStatus | Verifies the health status of the MLAG configuration. | - | skipped | MLAG is disabled | | DC1-SPINE1 | Routing | VerifyRoutingTableEntry | Verifies that the provided routes are present in the routing table of a specified VRF. | - | failure | The following route(s) are missing from the routing table of VRF default: ['10.1.0.2'] | -| DC1-SPINE1 | STP | VerifySTPMode | Verifies the configured STP mode for a provided list of VLAN(s). | - | failure | STP mode 'rapidPvst' not configured for the following VLAN(s): [10, 20] | | DC1-SPINE1 | SNMP | VerifySnmpStatus | Verifies if the SNMP agent is enabled. | - | failure | SNMP agent disabled in vrf default | -| DC1-SPINE1 | AAA | VerifyTacacsSourceIntf | Verifies TACACS source-interface for a specified VRF. | - | failure | Source-interface Management0 is not configured in VRF default | +| DC1-SPINE1 | STP | VerifySTPMode | Verifies the configured STP mode for a provided list of VLAN(s). | - | failure | STP mode 'rapidPvst' not configured for the following VLAN(s): [10, 20] | | DC1-SPINE1 | Security | VerifyTelnetStatus | Verifies if Telnet is disabled in the default VRF. | - | success | - | +| DC1-SPINE1 | Services | VerifyHostname | Verifies the hostname of a device. | - | failure | Expected 's1-spine1' as the hostname, but found 'DC1-SPINE1' instead. | +| DC1-SPINE1 | Software | VerifyEOSVersion | Verifies the EOS version of the device. | - | failure | device is running version "4.31.1F-34554157.4311F (engineering build)" not in expected versions: ['4.25.4M', '4.26.1F'] | +| DC1-SPINE1 | System | VerifyNTP | Verifies if NTP is synchronised. | - | failure | The device is not synchronized with the configured NTP server(s): 'NTP is disabled.' | | DC1-SPINE1 | VXLAN | VerifyVxlan1Interface | Verifies the Vxlan1 interface status. | - | skipped | Vxlan1 interface is not configured | diff --git a/tests/units/reporter/test_md_reporter.py b/tests/units/reporter/test_md_reporter.py index 26b97ea76..f5d2423ec 100644 --- a/tests/units/reporter/test_md_reporter.py +++ b/tests/units/reporter/test_md_reporter.py @@ -5,7 +5,7 @@ from __future__ import annotations -from io import BytesIO, TextIOWrapper +from io import StringIO from pathlib import Path import pytest @@ -22,7 +22,7 @@ def test_md_report_generate(tmp_path: Path, result_manager: ResultManager) -> No expected_report = "test_md_report.md" # Generate the Markdown report - MDReportGenerator.generate(result_manager, md_filename) + MDReportGenerator.generate(result_manager.sort(sort_by=["name", "categories", "test"]), md_filename) assert md_filename.exists() # Load the existing Markdown report to compare with the generated one @@ -46,7 +46,7 @@ def generate_section(self) -> None: results = ResultManager() - with TextIOWrapper(BytesIO(b"1 2 3")) as mock_file: + with StringIO() as mock_file: report = FakeMDReportBase(mock_file, results) assert report.generate_heading_name() == "Fake MD Report Base" diff --git a/tests/units/result_manager/test__init__.py b/tests/units/result_manager/test__init__.py index 760b6916d..c84e39b9a 100644 --- a/tests/units/result_manager/test__init__.py +++ b/tests/units/result_manager/test__init__.py @@ -20,6 +20,7 @@ from anta.result_manager.models import TestResult +# pylint: disable=too-many-public-methods class TestResultManager: """Test ResultManager class.""" @@ -86,13 +87,14 @@ def test_sorted_category_stats(self, list_result_factory: Callable[[int], list[T result_manager.results = results - # Check the current categories order - expected_order = ["ospf", "bgp", "vxlan", "system"] + # Check that category_stats returns sorted order by default + expected_order = ["bgp", "ospf", "system", "vxlan"] assert list(result_manager.category_stats.keys()) == expected_order - # Check the sorted categories order - expected_order = ["bgp", "ospf", "system", "vxlan"] - assert list(result_manager.sorted_category_stats.keys()) == expected_order + # Verify deprecation warning for sorted_category_stats + with pytest.warns(DeprecationWarning, match="sorted_category_stats is deprecated and will be removed in ANTA v2.0.0"): + deprecated_stats = result_manager.sorted_category_stats + assert list(deprecated_stats.keys()) == expected_order @pytest.mark.parametrize( ("starting_status", "test_status", "expected_status", "expected_raise"), @@ -465,7 +467,6 @@ def test_stats_property_computation(self, test_result_factory: Callable[[], Test with caplog.at_level(logging.INFO): _ = result_manager.category_stats _ = result_manager.test_stats - _ = result_manager.sorted_category_stats assert "Computing statistics" not in caplog.text # Add another result - should mark stats as unsynced @@ -480,3 +481,89 @@ def test_stats_property_computation(self, test_result_factory: Callable[[], Test _ = result_manager.device_stats assert "Computing statistics for all results" in caplog.text assert result_manager._stats_in_sync is True + + def test_sort_by_result(self, test_result_factory: Callable[[], TestResult]) -> None: + """Test sorting by result.""" + result_manager = ResultManager() + test1 = test_result_factory() + test1.result = AntaTestStatus.SUCCESS + test2 = test_result_factory() + test2.result = AntaTestStatus.FAILURE + test3 = test_result_factory() + test3.result = AntaTestStatus.ERROR + + result_manager.results = [test1, test2, test3] + sorted_manager = result_manager.sort(["result"]) + assert [r.result for r in sorted_manager.results] == ["error", "failure", "success"] + + def test_sort_by_name(self, test_result_factory: Callable[[], TestResult]) -> None: + """Test sorting by name.""" + result_manager = ResultManager() + test1 = test_result_factory() + test1.name = "Device3" + test2 = test_result_factory() + test2.name = "Device1" + test3 = test_result_factory() + test3.name = "Device2" + + result_manager.results = [test1, test2, test3] + sorted_manager = result_manager.sort(["name"]) + assert [r.name for r in sorted_manager.results] == ["Device1", "Device2", "Device3"] + + def test_sort_by_categories(self, test_result_factory: Callable[[], TestResult]) -> None: + """Test sorting by categories.""" + result_manager = ResultManager() + test1 = test_result_factory() + test1.categories = ["VXLAN", "networking"] + test2 = test_result_factory() + test2.categories = ["BGP", "routing"] + test3 = test_result_factory() + test3.categories = ["system", "hardware"] + + result_manager.results = [test1, test2, test3] + sorted_manager = result_manager.sort(["categories"]) + results = sorted_manager.results + + assert results[0].categories == ["BGP", "routing"] + assert results[1].categories == ["VXLAN", "networking"] + assert results[2].categories == ["system", "hardware"] + + def test_sort_multiple_fields(self, test_result_factory: Callable[[], TestResult]) -> None: + """Test sorting by multiple fields.""" + result_manager = ResultManager() + test1 = test_result_factory() + test1.result = AntaTestStatus.ERROR + test1.test = "Test3" + test2 = test_result_factory() + test2.result = AntaTestStatus.ERROR + test2.test = "Test1" + test3 = test_result_factory() + test3.result = AntaTestStatus.FAILURE + test3.test = "Test2" + + result_manager.results = [test1, test2, test3] + sorted_manager = result_manager.sort(["result", "test"]) + results = sorted_manager.results + + assert results[0].result == "error" + assert results[0].test == "Test1" + assert results[1].result == "error" + assert results[1].test == "Test3" + assert results[2].result == "failure" + assert results[2].test == "Test2" + + def test_sort_invalid_field(self) -> None: + """Test that sort method raises ValueError for invalid sort_by fields.""" + result_manager = ResultManager() + with pytest.raises( + ValueError, + match=re.escape( + "Invalid sort_by fields: ['bad_field']. Accepted fields are: ['name', 'test', 'categories', 'description', 'result', 'messages', 'custom_field']", + ), + ): + result_manager.sort(["bad_field"]) + + def test_sort_is_chainable(self) -> None: + """Test that the sort method is chainable.""" + result_manager = ResultManager() + assert isinstance(result_manager.sort(["name"]), ResultManager)