aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
282 stars 203 forks source link

eos_validate_state/Anta - Interface Filtering based on peer_type #4505

Closed jonxstill closed 2 days ago

jonxstill commented 4 days ago

Enhancement summary

Allow interfaces to be omitted from tests based on the peer_type

Which component of AVD is impacted

eos_validate_state

Use case example

Currently the eos_validate_state Anta integration has the ability to skip tests based on test category/name. Customer would like to filter out tests for endpoint interfaces based on the type of peer. For example they would want to test interfaces facing firewalls, load balancers and 3rd party devices, but don't care about servers (they have no control over them, not their responsibility, etc).

Describe the solution you would like

The skip_tests schema should be extended to take a list of ethernet_interfaces peer_type keys. If a given ethernet_interface's peer_type is on this list, the test should not be included in the test catalog passed to Anta.

Schema could look like this:

skip_tests:
  - interface_peer_types: # Skip any interface-based tests for these interface peer_types
      - servers
      - phones
      - printers
      - etc
  - category: <str>
    # Optional tests
    tests:
      - <str>

Describe alternatives you have considered

None, but accept the schema above may need some work.

Additional context

Required because with legacy eos_validate_state, it takes 3 hours to run for this customer. Obviously Anta is much improved but the clutter in the resulting report from servers being down (maintenance, not deployed yet, etc) is distracting from genuine issues.

Contributing Guide

ClausHolbechArista commented 4 days ago

We already support setting validate_state: false on the adapter config or network_ports. This can be set using a port-profile to easily apply it to all ports.

jonxstill commented 2 days ago

Ah! Perfect - I missed that. I will close this Issue.