Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(eos_validate_state): Fix the VerifyLLDPNeighbors test to skip in case validate_state is set to False #4679

Merged
merged 7 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ ethernet_interfaces:
channel_group:
id: 3
mode: active
validate_state: false
- name: Ethernet4
peer: dc2-leaf3b.arista.com
peer_interface: Ethernet4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ anta.tests.configuration:
- VerifyZeroTouch: null
- VerifyRunningConfigDiffs: null
anta.tests.connectivity:
- VerifyLLDPNeighbors:
neighbors:
- neighbor_device: dc2-leaf3b.arista.com
neighbor_port: Ethernet3
port: Ethernet3
result_overwrite:
custom_field: 'Local: Ethernet3 - Remote: dc2-leaf3b.arista.com Ethernet3'
- VerifyLLDPNeighbors:
neighbors:
- neighbor_device: dc2-leaf3b.arista.com
Expand Down Expand Up @@ -309,12 +302,6 @@ anta.tests.hardware:
- ok
- VerifyAdverseDrops: null
anta.tests.interfaces:
- VerifyInterfacesStatus:
interfaces:
- name: Ethernet3
status: up
result_overwrite:
custom_field: Interface Ethernet3 - MLAG_dc2-leaf3b.arista.com_Ethernet3 = 'up'
- VerifyInterfacesStatus:
interfaces:
- name: Ethernet4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ custom_structured_configuration_ethernet_interfaces:
peer: dc2-leaf2b
peer_interface: Ethernet2
shutdown: false
# Test to skip the VerifyLLDPNeighbors testcase
- name: Ethernet3
validate_state: false

custom_structured_configuration_port_channel_interfaces:
- name: Port-Channel11
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@
"description": "Verifies that the provided LLDP neighbors are connected properly.",
"custom_field": "Local: Ethernet2 - Remote: dc2-spine2 Ethernet5"
},
{
"name": "dc2-leaf3a.arista.com",
"test": "VerifyLLDPNeighbors",
"categories": [
"connectivity"
],
"description": "Verifies that the provided LLDP neighbors are connected properly.",
"custom_field": "Local: Ethernet3 - Remote: dc2-leaf3b.arista.com Ethernet3"
},
{
"name": "dc2-leaf3a.arista.com",
"test": "VerifyLLDPNeighbors",
Expand Down Expand Up @@ -527,15 +518,6 @@
"description": "Verifies the status of the provided interfaces.",
"custom_field": "Interface Ethernet2 - P2P_dc2-spine2_Ethernet5 = 'up'"
},
{
"name": "dc2-leaf3a.arista.com",
"test": "VerifyInterfacesStatus",
"categories": [
"interfaces"
],
"description": "Verifies the status of the provided interfaces.",
"custom_field": "Interface Ethernet3 - MLAG_dc2-leaf3b.arista.com_Ethernet3 = 'up'"
},
{
"name": "dc2-leaf3a.arista.com",
"test": "VerifyInterfacesStatus",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ def test_definition(self) -> dict | None:
required_keys = ["name", "peer", "peer_interface"]

for idx, interface in enumerate(ethernet_interfaces):
if interface.get("validate_state", True) is False:
LOGGER.info("Interface '%s' variable 'validate_state' is set to False. %s is skipped.", interface["name"], self.__class__.__name__)
continue

if self.is_subinterface(interface):
LOGGER.info("Interface '%s' is a subinterface. %s is skipped.", interface["name"], self.__class__.__name__)
continue
Expand Down
Loading