-
Notifications
You must be signed in to change notification settings - Fork 28
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 testcases to verifying Route Type #925
Draft
geetanjalimanegslab
wants to merge
14
commits into
aristanetworks:main
Choose a base branch
from
geetanjalimanegslab:issue_884
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
33aabce
Issue_884: Added testcases for verifying Route Type
c5f0eeb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 53bdf21
Issue_884: Fixed linting issues observed in pre-commit run
geetanjalimanegslab 841ffc5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ca30b7c
Merge branch 'main' into issue_884
gmuloc beddaa3
Issue_884: fixed linting issues.
geetanjalimanegslab 640e2d0
Merge branch 'main' into issue_884
gmuloc 0cc3709
Issue_884: fixed trailling white spaces
geetanjalimanegslab a8fa24e
Issue_884: Updated failure messages for testcases
geetanjalimanegslab 773dc39
Issue_884: Updated testcase with code optimization and renamed testca…
geetanjalimanegslab cede693
Issue_884: Updated documentation file
geetanjalimanegslab d3d3267
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b37059f
Merge branch 'main' into issue_884
gmuloc 52d6c1a
Update docs/api/tests.routing.generic.md
gmuloc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2023-2024 Arista Networks, Inc. | ||
# Use of this source code is governed by the Apache License 2.0 | ||
# that can be found in the LICENSE file. | ||
"""Module containing input models for generic routing tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Network | ||
|
||
from pydantic import BaseModel | ||
|
||
from anta.custom_types import IPv4RouteType | ||
|
||
|
||
class IPv4Routes(BaseModel): | ||
"""Model for a list of IPV4 route entries.""" | ||
|
||
prefix: IPv4Network | ||
""" IPV4network to validate the rout type. """ | ||
|
||
vrf: str = "default" | ||
""" VRF context. Defaults to `default` VRF.""" | ||
|
||
route_type: IPv4RouteType | ||
""" List of IPV4 Route type to validate the valid rout type. """ | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the route-type for reporting.""" | ||
return f"Prefix: {self.prefix} VRF: {self.vrf}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my information, how did you come up with this list of route-types?
This is good to help for the input but it may be tricky to maintain (though I suppose it is life)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @gmuloc ,
The mentioned route types are collected from the following command output.
Vitthal shared a JSON output with me, so with that help, I verified a few route types, such as connected, iBGP, and eBGP, to validate that the other route type needs some more configuration. Hence, I added TODO over there.