From db46ec264a259604e11a308255bc47e0d41e1919 Mon Sep 17 00:00:00 2001 From: "Geetanjali.mane" Date: Wed, 9 Apr 2025 08:52:12 +0000 Subject: [PATCH 1/6] feat(anta.tests): Added fix for VerifyL3MTU and VerifyL2MTU - Support Interface Ignorance for Specific or All Interfaces of a Given Keyword --- anta/custom_types.py | 7 +++ anta/tests/interfaces.py | 75 ++++++++++++++++------- tests/units/anta_tests/test_interfaces.py | 4 +- 3 files changed, 61 insertions(+), 25 deletions(-) diff --git a/anta/custom_types.py b/anta/custom_types.py index 5c87e29bc..44c117e93 100644 --- a/anta/custom_types.py +++ b/anta/custom_types.py @@ -20,6 +20,8 @@ """Match Vxlan source interface like Loopback10.""" REGEX_TYPE_PORTCHANNEL = r"^Port-Channel[0-9]{1,6}$" """Match Port Channel interface like Port-Channel5.""" +REGEXP_TYPE_EOS_ALL_INTERFACE_PREFIX = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Tunnel|Vlan|Vxlan)$" +"""Match interface all prefix.""" REGEXP_TYPE_HOSTNAME = r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$" """Match hostname like `my-hostname`, `my-hostname-1`, `my-hostname-1-2`.""" @@ -216,6 +218,11 @@ def update_bgp_redistributed_proto_user(value: str) -> str: BeforeValidator(interface_autocomplete), BeforeValidator(interface_case_sensitivity), ] +AllInterfacePrefix = Annotated[ + str, + Field(pattern=REGEXP_TYPE_EOS_ALL_INTERFACE_PREFIX), + BeforeValidator(interface_case_sensitivity), +] Afi = Literal["ipv4", "ipv6", "vpn-ipv4", "vpn-ipv6", "evpn", "rt-membership", "path-selection", "link-state"] Safi = Literal["unicast", "multicast", "labeled-unicast", "sr-te"] EncryptionAlgorithm = Literal["RSA", "ECDSA"] diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index 282b9456f..e904bf3d0 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -13,7 +13,7 @@ from pydantic import Field, field_validator from pydantic_extra_types.mac_address import MacAddress -from anta.custom_types import Interface, Percent, PositiveInteger +from anta.custom_types import AllInterfacePrefix, Interface, Percent, PositiveInteger from anta.decorators import skip_on_platforms from anta.input_models.interfaces import InterfaceDetail, InterfaceState from anta.models import AntaCommand, AntaTemplate, AntaTest @@ -25,6 +25,34 @@ T = TypeVar("T", bound=InterfaceState) +def _get_ignore_interfaces_status(interface: str, ignored_interfaces: list[str] | None = None) -> bool: + """Verify if an actual interface is present in the ignored interface list. + + Parameters + ---------- + interface + This is a string containing the interface name. + ignored_interfaces + A list containing the interfaces or interface prefixes to ignore. + + Returns + ------- + bool + True if the interface is in the list of ignored interfaces, false otherwise. + Example + ------- + >>> _get_ignore_interfaces_status(interface: Ethernet1, ignored_interfaces: ["Ethernet", "Port-Channel1"]) + True + >>> _get_ignore_interfaces_status(interface: Ethernet2, ignored_interfaces: ["Ethernet1", "Port-Channel"]) + False + >>> _get_ignore_interfaces_status(interface: Port-Channel1, ignored_interfaces: ["Ethernet1", "Port-Channel"]) + True + """ + interface_prefix = re.findall(r"^[a-zA-Z-]+", interface, re.IGNORECASE)[0] + catch_interface = re.findall(r"[\w-]+", interface, re.IGNORECASE)[0] + return bool(ignored_interfaces and any([catch_interface in ignored_interfaces, interface_prefix in ignored_interfaces])) + + class VerifyInterfaceUtilization(AntaTest): """Verifies that the utilization of interfaces is below a certain threshold. @@ -474,8 +502,8 @@ class Input(AntaTest.Input): mtu: int = 1500 """Default MTU we should have configured on all non-excluded interfaces. Defaults to 1500.""" - ignored_interfaces: list[str] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L3 interfaces to ignore""" + ignored_interfaces: list[AllInterfacePrefix | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + """A list of L3 interfaces to ignore.""" specific_mtu: list[dict[str, int]] = Field(default=[]) """A list of dictionary of L3 interfaces with their specific MTU configured""" @@ -490,16 +518,17 @@ def test(self) -> None: for d in self.inputs.specific_mtu: specific_interfaces.extend(d) for interface, values in command_output["interfaces"].items(): - if re.findall(r"[a-z]+", interface, re.IGNORECASE)[0] not in self.inputs.ignored_interfaces and values["forwardingModel"] == "routed": - if interface in specific_interfaces: - invalid_mtu = next( - (values["mtu"] for custom_data in self.inputs.specific_mtu if values["mtu"] != (expected_mtu := custom_data[interface])), None - ) - if invalid_mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {expected_mtu} Actual: {invalid_mtu}") - # Comparison with generic setting - elif values["mtu"] != self.inputs.mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {self.inputs.mtu} Actual: {values['mtu']}") + # Verification is skipped if the interface is in the ignored interfaces list. + if _get_ignore_interfaces_status(interface, self.inputs.ignored_interfaces) or values["forwardingModel"] != "routed": + continue + + if interface in specific_interfaces: + invalid_mtu = next((values["mtu"] for custom_data in self.inputs.specific_mtu if values["mtu"] != (expected_mtu := custom_data[interface])), None) + if invalid_mtu: + self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {expected_mtu} Actual: {invalid_mtu}") + # Comparison with generic setting + elif values["mtu"] != self.inputs.mtu: + self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {self.inputs.mtu} Actual: {values['mtu']}") class VerifyIPProxyARP(AntaTest): @@ -579,8 +608,8 @@ class Input(AntaTest.Input): mtu: int = 9214 """Default MTU we should have configured on all non-excluded interfaces. Defaults to 9214.""" - ignored_interfaces: list[str] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L2 interfaces to ignore. Defaults to ["Management", "Loopback", "Vxlan", "Tunnel"]""" + ignored_interfaces: list[AllInterfacePrefix | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + """A list of L2 interfaces to ignore.""" specific_mtu: list[dict[Interface, int]] = Field(default=[]) """A list of dictionary of L2 interfaces with their specific MTU configured""" @@ -592,14 +621,14 @@ def test(self) -> None: specific_interfaces = {key: value for details in self.inputs.specific_mtu for key, value in details.items()} for interface, details in interface_output.items(): - catch_interface = re.findall(r"^[e,p][a-zA-Z]+[-,a-zA-Z]*\d+\/*\d*", interface, re.IGNORECASE) - if catch_interface and catch_interface not in self.inputs.ignored_interfaces and details["forwardingModel"] == "bridged": - if interface in specific_interfaces: - if (mtu := specific_interfaces[interface]) != (act_mtu := details["mtu"]): - self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {mtu} Actual: {act_mtu}") - - elif (act_mtu := details["mtu"]) != self.inputs.mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {self.inputs.mtu} Actual: {act_mtu}") + if _get_ignore_interfaces_status(interface, self.inputs.ignored_interfaces) or details["forwardingModel"] != "bridged": + continue + if interface in specific_interfaces: + if (mtu := specific_interfaces[interface]) != (act_mtu := details["mtu"]): + self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {mtu} Actual: {act_mtu}") + + elif (act_mtu := details["mtu"]) != self.inputs.mtu: + self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {self.inputs.mtu} Actual: {act_mtu}") class VerifyInterfaceIPv4(AntaTest): diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index 778133b24..846fc00d4 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -1789,7 +1789,7 @@ }, }, ], - "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Port-Channel", "Management", "Vxlan"], "specific_mtu": [{"Ethernet10": 1501}]}, + "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Port-Channel2", "Management", "Vxlan1"], "specific_mtu": [{"Ethernet10": 1501}]}, "expected": {"result": "failure", "messages": ["Interface: Ethernet10 - Incorrect MTU - Expected: 1501 Actual: 1502"]}, }, { @@ -1861,7 +1861,7 @@ }, }, ], - "inputs": {"mtu": 9214, "ignored_interfaces": ["Loopback", "Port-Channel", "Management", "Vxlan"], "specific_mtu": [{"Ethernet10": 9214}]}, + "inputs": {"mtu": 9214, "ignored_interfaces": ["Loopback0", "Port-Channel", "Management0", "Vxlan"], "specific_mtu": [{"Ethernet10": 9214}]}, "expected": {"result": "success"}, }, { From 343c8998e0d1d996c662e345b060f76ecb33679b Mon Sep 17 00:00:00 2001 From: "Geetanjali.mane" Date: Fri, 9 May 2025 13:08:40 +0000 Subject: [PATCH 2/6] Updated testcase with adding check for subinterfaces --- anta/custom_types.py | 8 +- anta/tests/interfaces.py | 71 ++++--- examples/tests.yaml | 4 +- tests/units/anta_tests/test_interfaces.py | 241 +++++++++++++++++++++- 4 files changed, 285 insertions(+), 39 deletions(-) diff --git a/anta/custom_types.py b/anta/custom_types.py index 7ae9a7a4d..6deca54fa 100644 --- a/anta/custom_types.py +++ b/anta/custom_types.py @@ -20,8 +20,8 @@ """Match Vxlan source interface like Loopback10.""" REGEX_TYPE_PORTCHANNEL = r"^Port-Channel[0-9]{1,6}$" """Match Port Channel interface like Port-Channel5.""" -REGEXP_TYPE_EOS_ALL_INTERFACE_PREFIX = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Tunnel|Vlan|Vxlan)$" -"""Match interface all prefix.""" +REGEXP_EOS_INTERFACE_TYPE = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Tunnel|Vlan|Vxlan)$" +"""Match an EOS interface type like Ethernet or Loopback.""" REGEXP_TYPE_HOSTNAME = r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$" """Match hostname like `my-hostname`, `my-hostname-1`, `my-hostname-1-2`.""" @@ -235,9 +235,9 @@ def convert_reload_cause(value: str) -> str: BeforeValidator(interface_autocomplete), BeforeValidator(interface_case_sensitivity), ] -AllInterfacePrefix = Annotated[ +InterfaceType = Annotated[ str, - Field(pattern=REGEXP_TYPE_EOS_ALL_INTERFACE_PREFIX), + Field(pattern=REGEXP_EOS_INTERFACE_TYPE), BeforeValidator(interface_case_sensitivity), ] Afi = Literal["ipv4", "ipv6", "vpn-ipv4", "vpn-ipv6", "evpn", "rt-membership", "path-selection", "link-state"] diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index e904bf3d0..10beb3235 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -13,7 +13,7 @@ from pydantic import Field, field_validator from pydantic_extra_types.mac_address import MacAddress -from anta.custom_types import AllInterfacePrefix, Interface, Percent, PositiveInteger +from anta.custom_types import Interface, InterfaceType, Percent, PositiveInteger from anta.decorators import skip_on_platforms from anta.input_models.interfaces import InterfaceDetail, InterfaceState from anta.models import AntaCommand, AntaTemplate, AntaTest @@ -25,15 +25,15 @@ T = TypeVar("T", bound=InterfaceState) -def _get_ignore_interfaces_status(interface: str, ignored_interfaces: list[str] | None = None) -> bool: - """Verify if an actual interface is present in the ignored interface list. +def _is_interface_ignored(interface: str, ignored_interfaces: list[str] | None = None) -> bool | None: + """Verify if an interface is present in the ignored interfaces list. Parameters ---------- interface This is a string containing the interface name. ignored_interfaces - A list containing the interfaces or interface prefixes to ignore. + A list containing the interfaces or interface types to ignore. Returns ------- @@ -41,16 +41,28 @@ def _get_ignore_interfaces_status(interface: str, ignored_interfaces: list[str] True if the interface is in the list of ignored interfaces, false otherwise. Example ------- - >>> _get_ignore_interfaces_status(interface: Ethernet1, ignored_interfaces: ["Ethernet", "Port-Channel1"]) + >>> _is_interface_ignored(interface="Ethernet1", ignored_interfaces=["Ethernet", "Port-Channel1"]) True - >>> _get_ignore_interfaces_status(interface: Ethernet2, ignored_interfaces: ["Ethernet1", "Port-Channel"]) + >>> _is_interface_ignored(interface="Ethernet2", ignored_interfaces=["Ethernet1", "Port-Channel"]) False - >>> _get_ignore_interfaces_status(interface: Port-Channel1, ignored_interfaces: ["Ethernet1", "Port-Channel"]) + >>> _is_interface_ignored(interface="Port-Channel1", ignored_interfaces=["Ethernet1", "Port-Channel"]) + True + >>> _is_interface_ignored(interface="Ethernet1/1", ignored_interfaces: ["Ethernet1/1", "Port-Channel"]) + True + >>> _is_interface_ignored(interface="Ethernet1/1", ignored_interfaces: ["Ethernet1", "Port-Channel"]) + False + >>> _is_interface_ignored(interface="Ethernet1.100", ignored_interfaces: ["Ethernet1.100", "Port-Channel"]) True """ interface_prefix = re.findall(r"^[a-zA-Z-]+", interface, re.IGNORECASE)[0] - catch_interface = re.findall(r"[\w-]+", interface, re.IGNORECASE)[0] - return bool(ignored_interfaces and any([catch_interface in ignored_interfaces, interface_prefix in ignored_interfaces])) + interface_exact_match = False + if ignored_interfaces: + for ignored_interface in ignored_interfaces: + if interface == ignored_interface: + interface_exact_match = True + break + return bool(any([interface_exact_match, interface_prefix in ignored_interfaces])) + return None class VerifyInterfaceUtilization(AntaTest): @@ -469,11 +481,9 @@ def test(self) -> None: class VerifyL3MTU(AntaTest): - """Verifies the global layer 3 Maximum Transfer Unit (MTU) for all L3 interfaces. - - Test that L3 interfaces are configured with the correct MTU. It supports Ethernet, Port Channel and VLAN interfaces. + """Verifies the L3 MTU of routed interfaces. - You can define a global MTU to check, or an MTU per interface and you can also ignored some interfaces. + Test that layer 3 (routed) interfaces are configured with the correct MTU. Expected Results ---------------- @@ -488,8 +498,10 @@ class VerifyL3MTU(AntaTest): mtu: 1500 ignored_interfaces: - Vxlan1 + - Ethernet2.100 + - Ethernet1/1 specific_mtu: - - Ethernet1: 2500 + - Ethernet10: 2500 ``` """ @@ -501,11 +513,14 @@ class Input(AntaTest.Input): """Input model for the VerifyL3MTU test.""" mtu: int = 1500 - """Default MTU we should have configured on all non-excluded interfaces. Defaults to 1500.""" - ignored_interfaces: list[AllInterfacePrefix | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L3 interfaces to ignore.""" + """Expected L3 MTU configured on all non-excluded interfaces.""" + ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + """A list of L3 interfaces example Loopback0, Ethernet1 or interface types such as Ethernet (It will ignore all the ethernet interface), + Port-Channel to ignore.""" specific_mtu: list[dict[str, int]] = Field(default=[]) - """A list of dictionary of L3 interfaces with their specific MTU configured""" + """A list of dictionary of L3 interfaces with their expected L3 MTU configured. + If an interface is marked as ignored, its MTU will not be checked, even if it is included in the specific_mtu input dictionary. + """ @AntaTest.anta_test def test(self) -> None: @@ -519,7 +534,7 @@ def test(self) -> None: specific_interfaces.extend(d) for interface, values in command_output["interfaces"].items(): # Verification is skipped if the interface is in the ignored interfaces list. - if _get_ignore_interfaces_status(interface, self.inputs.ignored_interfaces) or values["forwardingModel"] != "routed": + if _is_interface_ignored(interface, self.inputs.ignored_interfaces) or values["forwardingModel"] != "routed": continue if interface in specific_interfaces: @@ -575,10 +590,9 @@ def test(self) -> None: class VerifyL2MTU(AntaTest): - """Verifies the global layer 2 Maximum Transfer Unit (MTU) for all L2 interfaces. + """Verifies the L2 MTU of routed interfaces. - Test that L2 interfaces are configured with the correct MTU. It supports Ethernet, Port Channel and VLAN interfaces. - You can define a global MTU to check and also an MTU per interface and also ignored some interfaces. + Test that layer 2 (routed) interfaces are configured with the correct MTU. Expected Results ---------------- @@ -607,11 +621,14 @@ class Input(AntaTest.Input): """Input model for the VerifyL2MTU test.""" mtu: int = 9214 - """Default MTU we should have configured on all non-excluded interfaces. Defaults to 9214.""" - ignored_interfaces: list[AllInterfacePrefix | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L2 interfaces to ignore.""" + """Expected L2 MTU configured on all non-excluded interfaces.""" + ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + """A list of L2 interfaces, such as Loopback0, Ethernet1, or interface types like Ethernet (which will ignore all Ethernet interfaces) and Port-Channel, + to be ignored.""" specific_mtu: list[dict[Interface, int]] = Field(default=[]) - """A list of dictionary of L2 interfaces with their specific MTU configured""" + """A list of dictionary of L2 interfaces with their specific MTU configured + If an interface is marked as ignored, its MTU will not be checked, even if it is included in the specific_mtu input dictionary. + """ @AntaTest.anta_test def test(self) -> None: @@ -621,7 +638,7 @@ def test(self) -> None: specific_interfaces = {key: value for details in self.inputs.specific_mtu for key, value in details.items()} for interface, details in interface_output.items(): - if _get_ignore_interfaces_status(interface, self.inputs.ignored_interfaces) or details["forwardingModel"] != "bridged": + if _is_interface_ignored(interface, self.inputs.ignored_interfaces) or details["forwardingModel"] != "bridged": continue if interface in specific_interfaces: if (mtu := specific_interfaces[interface]) != (act_mtu := details["mtu"]): diff --git a/examples/tests.yaml b/examples/tests.yaml index 312dc3a00..0c47a628a 100644 --- a/examples/tests.yaml +++ b/examples/tests.yaml @@ -304,8 +304,10 @@ anta.tests.interfaces: mtu: 1500 ignored_interfaces: - Vxlan1 + - Ethernet2.100 + - Ethernet1/1 specific_mtu: - - Ethernet1: 2500 + - Ethernet10: 2500 - VerifyLACPInterfacesStatus: # Verifies the Link Aggregation Control Protocol (LACP) status of the interface. interfaces: diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index 846fc00d4..124610636 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -1792,6 +1792,233 @@ "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Port-Channel2", "Management", "Vxlan1"], "specific_mtu": [{"Ethernet10": 1501}]}, "expected": {"result": "failure", "messages": ["Interface: Ethernet10 - Incorrect MTU - Expected: 1501 Actual: 1502"]}, }, + { + "name": "failure-ignored-specified-interface-mtu", + "test": VerifyL3MTU, + "eos_data": [ + { + "interfaces": { + "Ethernet2": { + "name": "Ethernet2", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1503, + "l3MtuConfigured": True, + "l2Mru": 0, + }, + "Ethernet1/1": { + "name": "Ethernet1/1", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1502, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Ethernet1.100": { + "name": "Ethernet1.100", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1507, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Port-Channel2": { + "name": "Port-Channel2", + "forwardingModel": "bridged", + "lineProtocolStatus": "lowerLayerDown", + "interfaceStatus": "notconnect", + "hardware": "portChannel", + "mtu": 1500, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Loopback0": { + "name": "Loopback0", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "loopback", + "mtu": 65535, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Vxlan1": { + "name": "Vxlan1", + "forwardingModel": "bridged", + "lineProtocolStatus": "down", + "interfaceStatus": "notconnect", + "hardware": "vxlan", + "mtu": 0, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + }, + }, + ], + "inputs": { + "mtu": 1500, + "ignored_interfaces": ["Loopback", "Port-Channel2", "Management", "Vxlan1", "Ethernet1/1", "Ethernet1.100"], + "specific_mtu": [{"Ethernet1/1": 1501}], + }, + "expected": {"result": "failure", "messages": ["Interface: Ethernet2 - Incorrect MTU - Expected: 1500 Actual: 1503"]}, + }, + { + "name": "failure-ignored-specified-ethernet", + "test": VerifyL3MTU, + "eos_data": [ + { + "interfaces": { + "Ethernet2": { + "name": "Ethernet2", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1503, + "l3MtuConfigured": True, + "l2Mru": 0, + }, + "Ethernet1/1": { + "name": "Ethernet1/1", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1502, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Ethernet1.100": { + "name": "Ethernet1.100", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1507, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Port-Channel2": { + "name": "Port-Channel2", + "forwardingModel": "bridged", + "lineProtocolStatus": "lowerLayerDown", + "interfaceStatus": "notconnect", + "hardware": "portChannel", + "mtu": 1500, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Loopback0": { + "name": "Loopback0", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "loopback", + "mtu": 65535, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Vxlan1": { + "name": "Vxlan1", + "forwardingModel": "bridged", + "lineProtocolStatus": "down", + "interfaceStatus": "notconnect", + "hardware": "vxlan", + "mtu": 0, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + }, + }, + ], + "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Ethernet1"], "specific_mtu": [{"Ethernet1/1": 1501}]}, + "expected": { + "result": "failure", + "messages": [ + "Interface: Ethernet2 - Incorrect MTU - Expected: 1500 Actual: 1503", + "Interface: Ethernet1/1 - Incorrect MTU - Expected: 1501 Actual: 1502", + "Interface: Ethernet1.100 - Incorrect MTU - Expected: 1500 Actual: 1507", + ], + }, + }, + { + "name": "succuss-ethernet-all", + "test": VerifyL3MTU, + "eos_data": [ + { + "interfaces": { + "Ethernet2": { + "name": "Ethernet2", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1503, + "l3MtuConfigured": True, + "l2Mru": 0, + }, + "Ethernet1/1": { + "name": "Ethernet1/1", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1502, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Ethernet1.100": { + "name": "Ethernet1.100", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "ethernet", + "mtu": 1507, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Port-Channel2": { + "name": "Port-Channel2", + "forwardingModel": "bridged", + "lineProtocolStatus": "lowerLayerDown", + "interfaceStatus": "notconnect", + "hardware": "portChannel", + "mtu": 1500, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Loopback0": { + "name": "Loopback0", + "forwardingModel": "routed", + "lineProtocolStatus": "up", + "interfaceStatus": "connected", + "hardware": "loopback", + "mtu": 65535, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + "Vxlan1": { + "name": "Vxlan1", + "forwardingModel": "bridged", + "lineProtocolStatus": "down", + "interfaceStatus": "notconnect", + "hardware": "vxlan", + "mtu": 0, + "l3MtuConfigured": False, + "l2Mru": 0, + }, + }, + }, + ], + "inputs": {"mtu": 1500, "ignored_interfaces": ["Loopback", "Ethernet"], "specific_mtu": [{"Ethernet1/1": 1501}]}, + "expected": {"result": "success"}, + }, { "name": "success", "test": VerifyL2MTU, @@ -1800,11 +2027,11 @@ "interfaces": { "Ethernet2/1": { "name": "Ethernet2/1", - "forwardingModel": "routed", + "forwardingModel": "bridged", "lineProtocolStatus": "up", "interfaceStatus": "connected", "hardware": "ethernet", - "mtu": 1500, + "mtu": 9218, "l3MtuConfigured": True, "l2Mru": 0, }, @@ -1861,7 +2088,7 @@ }, }, ], - "inputs": {"mtu": 9214, "ignored_interfaces": ["Loopback0", "Port-Channel", "Management0", "Vxlan"], "specific_mtu": [{"Ethernet10": 9214}]}, + "inputs": {"mtu": 9214, "ignored_interfaces": ["Loopback0", "Port-Channel", "Management0", "Vxlan", "Ethernet2/1"], "specific_mtu": [{"Ethernet10": 9214}]}, "expected": {"result": "success"}, }, { @@ -1948,13 +2175,13 @@ "eos_data": [ { "interfaces": { - "Ethernet2": { + "Ethernet1.100": { "name": "Ethernet2", - "forwardingModel": "routed", + "forwardingModel": "bridged", "lineProtocolStatus": "up", "interfaceStatus": "connected", "hardware": "ethernet", - "mtu": 1600, + "mtu": 9218, "l3MtuConfigured": True, "l2Mru": 0, }, @@ -2011,7 +2238,7 @@ }, }, ], - "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}]}, + "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}], "ignored_interfaces": ["Ethernet"]}, "expected": {"result": "failure", "messages": ["Interface: Port-Channel2 - Incorrect MTU configured - Expected: 10000 Actual: 9214"]}, }, { From ea9e7b6e8dd84907652895fb42d361e780f73138 Mon Sep 17 00:00:00 2001 From: "Geetanjali.mane" Date: Fri, 9 May 2025 13:23:47 +0000 Subject: [PATCH 3/6] fixed unit testcase --- tests/units/anta_tests/test_interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index 124610636..6d30824e8 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -2238,7 +2238,7 @@ }, }, ], - "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}], "ignored_interfaces": ["Ethernet"]}, + "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}], "ignored_interfaces": ["Ethernet", "Vxlan1"]}, "expected": {"result": "failure", "messages": ["Interface: Port-Channel2 - Incorrect MTU configured - Expected: 10000 Actual: 9214"]}, }, { From fe96a9a8965afd50e3bd3f34f0f86b9b45c14457 Mon Sep 17 00:00:00 2001 From: Carl Baillargeon Date: Fri, 9 May 2025 12:54:13 -0400 Subject: [PATCH 4/6] Apply suggestions from code review --- anta/tests/interfaces.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index 10beb3235..ad69d7ff5 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -515,12 +515,10 @@ class Input(AntaTest.Input): mtu: int = 1500 """Expected L3 MTU configured on all non-excluded interfaces.""" ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L3 interfaces example Loopback0, Ethernet1 or interface types such as Ethernet (It will ignore all the ethernet interface), + """A list of L3 interfaces or interfaces types like Loopback, Tunnel which will ignore all Loopback and Tunnel interfaces. Takes precedence over the `specific_mtu` field. Port-Channel to ignore.""" specific_mtu: list[dict[str, int]] = Field(default=[]) - """A list of dictionary of L3 interfaces with their expected L3 MTU configured. - If an interface is marked as ignored, its MTU will not be checked, even if it is included in the specific_mtu input dictionary. - """ + """A list of dictionary of L3 interfaces with their expected L3 MTU configured.""" @AntaTest.anta_test def test(self) -> None: @@ -590,9 +588,9 @@ def test(self) -> None: class VerifyL2MTU(AntaTest): - """Verifies the L2 MTU of routed interfaces. + """Verifies the L2 MTU of bridged interfaces. - Test that layer 2 (routed) interfaces are configured with the correct MTU. + Test that layer 2 (bridged) interfaces are configured with the correct MTU. Expected Results ---------------- @@ -623,12 +621,10 @@ class Input(AntaTest.Input): mtu: int = 9214 """Expected L2 MTU configured on all non-excluded interfaces.""" ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L2 interfaces, such as Loopback0, Ethernet1, or interface types like Ethernet (which will ignore all Ethernet interfaces) and Port-Channel, + """A list of L2 interfaces or interface types like Ethernet, Port-Channel which will ignore all Ethernet and Port-Channel interfaces. Takes precedence over the `specific_mtu` field. to be ignored.""" specific_mtu: list[dict[Interface, int]] = Field(default=[]) - """A list of dictionary of L2 interfaces with their specific MTU configured - If an interface is marked as ignored, its MTU will not be checked, even if it is included in the specific_mtu input dictionary. - """ + """A list of dictionary of L2 interfaces with their expected L2 MTU configured.""" @AntaTest.anta_test def test(self) -> None: From 503fae20ea8bd8489de3c1a5a1f08ffbfcd13edc Mon Sep 17 00:00:00 2001 From: Carl Baillargeon Date: Fri, 9 May 2025 13:34:45 -0400 Subject: [PATCH 5/6] Simplify logic --- anta/tests/interfaces.py | 56 +++++++++++------------ examples/tests.yaml | 6 +-- tests/units/anta_tests/__init__.py | 2 +- tests/units/anta_tests/test_interfaces.py | 8 ++-- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index ad69d7ff5..6ecb74b2e 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -497,7 +497,7 @@ class VerifyL3MTU(AntaTest): - VerifyL3MTU: mtu: 1500 ignored_interfaces: - - Vxlan1 + - Management # Ignore all Management interfaces - Ethernet2.100 - Ethernet1/1 specific_mtu: @@ -515,9 +515,10 @@ class Input(AntaTest.Input): mtu: int = 1500 """Expected L3 MTU configured on all non-excluded interfaces.""" ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L3 interfaces or interfaces types like Loopback, Tunnel which will ignore all Loopback and Tunnel interfaces. Takes precedence over the `specific_mtu` field. - Port-Channel to ignore.""" - specific_mtu: list[dict[str, int]] = Field(default=[]) + """A list of L3 interfaces or interfaces types like Loopback, Tunnel which will ignore all Loopback and Tunnel interfaces. + + Takes precedence over the `specific_mtu` field.""" + specific_mtu: list[dict[Interface, int]] = Field(default=[]) """A list of dictionary of L3 interfaces with their expected L3 MTU configured.""" @AntaTest.anta_test @@ -525,23 +526,18 @@ def test(self) -> None: """Main test function for VerifyL3MTU.""" self.result.is_success() command_output = self.instance_commands[0].json_output - # Set list of interfaces with specific settings - specific_interfaces: list[str] = [] - if self.inputs.specific_mtu: - for d in self.inputs.specific_mtu: - specific_interfaces.extend(d) - for interface, values in command_output["interfaces"].items(): - # Verification is skipped if the interface is in the ignored interfaces list. - if _is_interface_ignored(interface, self.inputs.ignored_interfaces) or values["forwardingModel"] != "routed": + specific_interfaces = {intf: mtu for intf_mtu in self.inputs.specific_mtu for intf, mtu in intf_mtu.items()} + + for interface, details in command_output["interfaces"].items(): + # Verification is skipped if the interface is in the ignored interfaces list + if _is_interface_ignored(interface, self.inputs.ignored_interfaces) or details["forwardingModel"] != "routed": continue - if interface in specific_interfaces: - invalid_mtu = next((values["mtu"] for custom_data in self.inputs.specific_mtu if values["mtu"] != (expected_mtu := custom_data[interface])), None) - if invalid_mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {expected_mtu} Actual: {invalid_mtu}") - # Comparison with generic setting - elif values["mtu"] != self.inputs.mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {self.inputs.mtu} Actual: {values['mtu']}") + actual_mtu = details["mtu"] + expected_mtu = specific_interfaces.get(interface, self.inputs.mtu) + + if (actual_mtu := details["mtu"]) != expected_mtu: + self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {expected_mtu} Actual: {actual_mtu}") class VerifyIPProxyARP(AntaTest): @@ -604,8 +600,8 @@ class VerifyL2MTU(AntaTest): - VerifyL2MTU: mtu: 1500 ignored_interfaces: - - Management1 - - Vxlan1 + - Ethernet2/1 + - Port-Channel # Ignore all Port-Channel interfaces specific_mtu: - Ethernet1/1: 1500 ``` @@ -621,8 +617,9 @@ class Input(AntaTest.Input): mtu: int = 9214 """Expected L2 MTU configured on all non-excluded interfaces.""" ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) - """A list of L2 interfaces or interface types like Ethernet, Port-Channel which will ignore all Ethernet and Port-Channel interfaces. Takes precedence over the `specific_mtu` field. - to be ignored.""" + """A list of L2 interfaces or interface types like Ethernet, Port-Channel which will ignore all Ethernet and Port-Channel interfaces. + + Takes precedence over the `specific_mtu` field.""" specific_mtu: list[dict[Interface, int]] = Field(default=[]) """A list of dictionary of L2 interfaces with their expected L2 MTU configured.""" @@ -631,17 +628,18 @@ def test(self) -> None: """Main test function for VerifyL2MTU.""" self.result.is_success() interface_output = self.instance_commands[0].json_output["interfaces"] - specific_interfaces = {key: value for details in self.inputs.specific_mtu for key, value in details.items()} + specific_interfaces = {intf: mtu for intf_mtu in self.inputs.specific_mtu for intf, mtu in intf_mtu.items()} for interface, details in interface_output.items(): + # Verification is skipped if the interface is in the ignored interfaces list if _is_interface_ignored(interface, self.inputs.ignored_interfaces) or details["forwardingModel"] != "bridged": continue - if interface in specific_interfaces: - if (mtu := specific_interfaces[interface]) != (act_mtu := details["mtu"]): - self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {mtu} Actual: {act_mtu}") - elif (act_mtu := details["mtu"]) != self.inputs.mtu: - self.result.is_failure(f"Interface: {interface} - Incorrect MTU configured - Expected: {self.inputs.mtu} Actual: {act_mtu}") + actual_mtu = details["mtu"] + expected_mtu = specific_interfaces.get(interface, self.inputs.mtu) + + if (actual_mtu := details["mtu"]) != expected_mtu: + self.result.is_failure(f"Interface: {interface} - Incorrect MTU - Expected: {expected_mtu} Actual: {actual_mtu}") class VerifyInterfaceIPv4(AntaTest): diff --git a/examples/tests.yaml b/examples/tests.yaml index 3f5e605c8..95ce19ad4 100644 --- a/examples/tests.yaml +++ b/examples/tests.yaml @@ -295,15 +295,15 @@ anta.tests.interfaces: # Verifies the global L2 MTU of all L2 interfaces. mtu: 1500 ignored_interfaces: - - Management1 - - Vxlan1 + - Ethernet2/1 + - Port-Channel # Ignore all Port-Channel interfaces specific_mtu: - Ethernet1/1: 1500 - VerifyL3MTU: # Verifies the global L3 MTU of all L3 interfaces. mtu: 1500 ignored_interfaces: - - Vxlan1 + - Management # Ignore all Management interfaces - Ethernet2.100 - Ethernet1/1 specific_mtu: diff --git a/tests/units/anta_tests/__init__.py b/tests/units/anta_tests/__init__.py index 9bfb5f815..6a3307e04 100644 --- a/tests/units/anta_tests/__init__.py +++ b/tests/units/anta_tests/__init__.py @@ -21,7 +21,7 @@ def test(device: AntaDevice, data: dict[str, Any]) -> None: # Run the test() method asyncio.run(test_instance.test()) # Assert expected result - assert test_instance.result.result == data["expected"]["result"], f"Expected '{data['expected']['result']}' result, got '{test_instance.result.result}'" + assert test_instance.result.result == data["expected"]["result"], f"Expected '{data['expected']['result']}' result, got '{test_instance.result.messages}'" if "messages" in data["expected"]: # We expect messages in test result assert len(test_instance.result.messages) == len(data["expected"]["messages"]) diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index 6d30824e8..1e31ab1c5 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -1577,7 +1577,7 @@ "expected": {"result": "success"}, }, { - "name": "success", + "name": "success-2", "test": VerifyL3MTU, "eos_data": [ { @@ -2164,8 +2164,8 @@ "expected": { "result": "failure", "messages": [ - "Interface: Ethernet10 - Incorrect MTU configured - Expected: 1500 Actual: 9214", - "Interface: Port-Channel2 - Incorrect MTU configured - Expected: 1500 Actual: 9214", + "Interface: Ethernet10 - Incorrect MTU - Expected: 1500 Actual: 9214", + "Interface: Port-Channel2 - Incorrect MTU - Expected: 1500 Actual: 9214", ], }, }, @@ -2239,7 +2239,7 @@ }, ], "inputs": {"specific_mtu": [{"Et10": 9214}, {"Port-Channel2": 10000}], "ignored_interfaces": ["Ethernet", "Vxlan1"]}, - "expected": {"result": "failure", "messages": ["Interface: Port-Channel2 - Incorrect MTU configured - Expected: 10000 Actual: 9214"]}, + "expected": {"result": "failure", "messages": ["Interface: Port-Channel2 - Incorrect MTU - Expected: 10000 Actual: 9214"]}, }, { "name": "success", From dade82748a2b54e8445b9bdc97cbd55573e312fa Mon Sep 17 00:00:00 2001 From: Carl Baillargeon Date: Fri, 9 May 2025 14:17:12 -0400 Subject: [PATCH 6/6] Added more defaults --- anta/custom_types.py | 4 ++-- anta/tests/interfaces.py | 8 ++++---- examples/tests.yaml | 4 ++-- tests/units/anta_tests/test_interfaces.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/anta/custom_types.py b/anta/custom_types.py index 6deca54fa..a83756cdc 100644 --- a/anta/custom_types.py +++ b/anta/custom_types.py @@ -14,13 +14,13 @@ """Match directory path from string.""" REGEXP_INTERFACE_ID = r"\d+(\/\d+)*(\.\d+)?" """Match Interface ID lilke 1/1.1.""" -REGEXP_TYPE_EOS_INTERFACE = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Tunnel|Vlan|Vxlan)[0-9]+(\/[0-9]+)*(\.[0-9]+)?$" +REGEXP_TYPE_EOS_INTERFACE = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Recirc-Channel|Tunnel|Vlan|Vxlan)[0-9]+(\/[0-9]+)*(\.[0-9]+)?$" """Match EOS interface types like Ethernet1/1, Vlan1, Loopback1, etc.""" REGEXP_TYPE_VXLAN_SRC_INTERFACE = r"^(Loopback)([0-9]|[1-9][0-9]{1,2}|[1-7][0-9]{3}|8[01][0-9]{2}|819[01])$" """Match Vxlan source interface like Loopback10.""" REGEX_TYPE_PORTCHANNEL = r"^Port-Channel[0-9]{1,6}$" """Match Port Channel interface like Port-Channel5.""" -REGEXP_EOS_INTERFACE_TYPE = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Tunnel|Vlan|Vxlan)$" +REGEXP_EOS_INTERFACE_TYPE = r"^(Dps|Ethernet|Fabric|Loopback|Management|Port-Channel|Recirc-Channel|Tunnel|Vlan|Vxlan)$" """Match an EOS interface type like Ethernet or Loopback.""" REGEXP_TYPE_HOSTNAME = r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$" """Match hostname like `my-hostname`, `my-hostname-1`, `my-hostname-1-2`.""" diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index 6ecb74b2e..3c5ed8373 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -501,7 +501,7 @@ class VerifyL3MTU(AntaTest): - Ethernet2.100 - Ethernet1/1 specific_mtu: - - Ethernet10: 2500 + - Ethernet10: 9200 ``` """ @@ -514,7 +514,7 @@ class Input(AntaTest.Input): mtu: int = 1500 """Expected L3 MTU configured on all non-excluded interfaces.""" - ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Dps", "Fabric", "Loopback", "Management", "Recirc-Channel", "Tunnel", "Vxlan"]) """A list of L3 interfaces or interfaces types like Loopback, Tunnel which will ignore all Loopback and Tunnel interfaces. Takes precedence over the `specific_mtu` field.""" @@ -598,7 +598,7 @@ class VerifyL2MTU(AntaTest): ```yaml anta.tests.interfaces: - VerifyL2MTU: - mtu: 1500 + mtu: 9214 ignored_interfaces: - Ethernet2/1 - Port-Channel # Ignore all Port-Channel interfaces @@ -616,7 +616,7 @@ class Input(AntaTest.Input): mtu: int = 9214 """Expected L2 MTU configured on all non-excluded interfaces.""" - ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Management", "Loopback", "Vxlan", "Tunnel"]) + ignored_interfaces: list[InterfaceType | Interface] = Field(default=["Dps", "Fabric", "Loopback", "Management", "Recirc-Channel", "Tunnel", "Vlan", "Vxlan"]) """A list of L2 interfaces or interface types like Ethernet, Port-Channel which will ignore all Ethernet and Port-Channel interfaces. Takes precedence over the `specific_mtu` field.""" diff --git a/examples/tests.yaml b/examples/tests.yaml index 95ce19ad4..f591c5e24 100644 --- a/examples/tests.yaml +++ b/examples/tests.yaml @@ -293,7 +293,7 @@ anta.tests.interfaces: mac_address: 00:1c:73:00:dc:01 - VerifyL2MTU: # Verifies the global L2 MTU of all L2 interfaces. - mtu: 1500 + mtu: 9214 ignored_interfaces: - Ethernet2/1 - Port-Channel # Ignore all Port-Channel interfaces @@ -307,7 +307,7 @@ anta.tests.interfaces: - Ethernet2.100 - Ethernet1/1 specific_mtu: - - Ethernet10: 2500 + - Ethernet10: 9200 - VerifyLACPInterfacesStatus: # Verifies the Link Aggregation Control Protocol (LACP) status of the interface. interfaces: diff --git a/tests/units/anta_tests/test_interfaces.py b/tests/units/anta_tests/test_interfaces.py index 1e31ab1c5..740dc399b 100644 --- a/tests/units/anta_tests/test_interfaces.py +++ b/tests/units/anta_tests/test_interfaces.py @@ -1577,7 +1577,7 @@ "expected": {"result": "success"}, }, { - "name": "success-2", + "name": "success-ignored-interfaces", "test": VerifyL3MTU, "eos_data": [ {