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

feat(anta): Added the test case to verify multiple routes with only specific nodes as next-hops #835

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vitthalmagadum
Copy link
Collaborator

Description

Verifies the route entries of given IPv4 network(s).

Supports `strict: True` to verify that only the specified nexthops by which routes are learned, requiring an exact match.

Expected Results
----------------
* Success: The test will pass if the route entry with given nexthop(s) present for given network(s).
* Failure: The test will fail if the routes not found or route entry with given nexthop(s) not present for given network(s).

Fixes #819

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have run pre-commit for code linting and typing (pre-commit run)
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (tox -e testenv)

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

codspeed-hq bot commented Oct 1, 2024

CodSpeed Performance Report

Merging #835 will not alter performance

Comparing vitthalmagadum:issue_819 (439a75d) with main (29e08cb)

Summary

✅ 4 untouched benchmarks

Copy link

sonarcloud bot commented Oct 7, 2024

name = "VerifyRouteEntry"
description = "Verifies the route entry(s) for the provided IPv4 Network(s)."
categories: ClassVar[list[str]] = ["routing"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaTemplate(template="show ip route {prefix}", revision=4)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can give the vrf information into command so that will again help to reduce the output if a network is configure with another vrf

],
"inputs": {
"route_entries": [
{"prefix": "10.10.0.1/32", "vrf": "default", "strict": True, "nexthops": ["10.100.0.8", "10.100.0.10", "10.100.0.11"]},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the unit tests where strict is false

"{'10.10.0.1/32': {'default': 'Expected only `10.100.0.8, 10.100.0.10, 10.100.0.11` nexthops should be listed but "
"found `10.100.0.8, 10.100.0.10` instead.'}, '10.100.0.128/31': {'MGMT': 'Expected only `10.100.0.8, 10.100.0.10, "
"10.100.0.11` nexthops should be listed but found `10.100.0.8, 10.100.0.10` instead.'}}"
],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the unit test where strict is true and length of actual and expected nexthop is also same but the addresses are not same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the test case to verify multiple routes with only specific nodes as next-hops
2 participants