From 1fd6a618b60d7168fd8f37585d5d39d22d775afd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 28 Mar 2024 07:11:39 +0100 Subject: Adding upstream version 0.13.0. Signed-off-by: Daniel Baumann --- tests/units/anta_tests/test_profiles.py | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/units/anta_tests/test_profiles.py (limited to 'tests/units/anta_tests/test_profiles.py') diff --git a/tests/units/anta_tests/test_profiles.py b/tests/units/anta_tests/test_profiles.py new file mode 100644 index 0000000..c0ebb57 --- /dev/null +++ b/tests/units/anta_tests/test_profiles.py @@ -0,0 +1,47 @@ +# Copyright (c) 2023-2024 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 +""" +from __future__ import annotations + +from typing import Any + +from anta.tests.profiles import VerifyTcamProfile, VerifyUnifiedForwardingTableMode +from tests.lib.anta import test # noqa: F401; pylint: disable=W0611 + +DATA: list[dict[str, Any]] = [ + { + "name": "success", + "test": VerifyUnifiedForwardingTableMode, + "eos_data": [{"uftMode": "2", "urpfEnabled": False, "chipModel": "bcm56870", "l2TableSize": 163840, "l3TableSize": 147456, "lpmTableSize": 32768}], + "inputs": {"mode": 2}, + "expected": {"result": "success"}, + }, + { + "name": "failure", + "test": VerifyUnifiedForwardingTableMode, + "eos_data": [{"uftMode": "2", "urpfEnabled": False, "chipModel": "bcm56870", "l2TableSize": 163840, "l3TableSize": 147456, "lpmTableSize": 32768}], + "inputs": {"mode": 3}, + "expected": {"result": "failure", "messages": ["Device is not running correct UFT mode (expected: 3 / running: 2)"]}, + }, + { + "name": "success", + "test": VerifyTcamProfile, + "eos_data": [ + {"pmfProfiles": {"FixedSystem": {"config": "test", "configType": "System Profile", "status": "test", "mode": "tcam"}}, "lastProgrammingStatus": {}} + ], + "inputs": {"profile": "test"}, + "expected": {"result": "success"}, + }, + { + "name": "failure", + "test": VerifyTcamProfile, + "eos_data": [ + {"pmfProfiles": {"FixedSystem": {"config": "test", "configType": "System Profile", "status": "default", "mode": "tcam"}}, "lastProgrammingStatus": {}} + ], + "inputs": {"profile": "test"}, + "expected": {"result": "failure", "messages": ["Incorrect profile running on device: default"]}, + }, +] -- cgit v1.2.3