Feat(anta_runner): Add support for peer-specific filtering #5991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
Introduces a small DSL to the
run_testsandskip_testsfilters for AVD-generated catalogs. This enhancement provides more granular control to run or skip tests for specific fabric peers.Peer-filtering DSL is only implemented for the
VerifyReachabilitytest.Component(s) name
arista.avd.anta_runnerProposed changes
Previously, a filter like
skip_tests: [ "VerifyReachability" ]would disable all reachability tests. With this change, users can now target specific peers, such asskip_tests: [ "VerifyReachability(DC1-SPINE1)" ], which will only skip the reachability test towards that single device.The DSL supports a parenthesized comma-separated list of peer device hostnames appended to a test name.
Examples:
DC1group to peersDC2-BL1andDC2-BL2only. All other reachability tests will still be generated and run.DC1group to peersDC2-BL1andDC2-BL2. No other reachability tests will be included in the catalog for these devices.VerifyNTPtest is skipped, but only the reachability test towardsDC1-SPINE1is skipped.How to test
Run the
anta_runnerrole normally to establish a baseline and confirm all reachability tests are generated in the catalog.Uncomment and adapt the
avd_catalogs_filtersvariable in your playbook as shown above to apply a peer-specific filter.Run the role again and check the generated ANTA catalog for a device in the
DC1group.Confirm that the reachability test towards the specified peer (e.g., DC1-LEAF1A) has been removed from the catalog, while other reachability tests remain.
Checklist
User Checklist
Repository Checklist