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 the BGP route origin #813

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

Conversation

vitthalmagadum
Copy link
Collaborator

Description

Verifies BGP route origin for the provided IPv4 Network(s).

Expected Results
----------------
* Success: The test will pass if the BGP route's origin matches expected origin type.
* Failure: The test will fail if the BGP route's origin does not matches with expected origin type or BGP route entry(s) not found.

Fixes #811

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)

anta/tests/routing/bgp.py Outdated Show resolved Hide resolved
anta/tests/routing/bgp.py Outdated Show resolved Hide resolved
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.

anta/tests/routing/bgp.py Outdated Show resolved Hide resolved
examples/tests.yaml Outdated Show resolved Hide resolved
@vitthalmagadum
Copy link
Collaborator Author

Added pylint disable for no of line check (C0302) with TODO.
Thanks!!!

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 #813 will not alter performance

Comparing vitthalmagadum:issue_811 (fbad6d7) with main (68c664d)

Summary

✅ 22 untouched benchmarks

@vitthalmagadum vitthalmagadum requested a review from gmuloc October 11, 2024 03:40
Copy link

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.

"""Verifies BGP route origin.

This test performs the following checks for each specified bgp route entry:
1. Checks whether the specified BGP route entries exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. Checks whether the specified BGP route entries exist.
1. Checks whether the specified BGP route entry exists.


This test performs the following checks for each specified bgp route entry:
1. Checks whether the specified BGP route entries exist.
2. Confirms that the path exists and corresponds to the next-hop address.
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems there can be multiple paths for a given route so what happens if I have multiple - do all need to exist ? only
one? this should be specified here

Copy link
Collaborator

Choose a reason for hiding this comment

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

the code check that all paths for each route are valid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are verifying the given path(s) should exist in entries for that given prefix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes so we need to reword

Suggested change
2. Confirms that the path exists and corresponds to the next-hop address.
2. Confirms that each path for the route entry exists and corresponds to the next-hop address.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated. Thanks!!

----------------
* Success: The test will pass if:
- The BGP route entries exist for specified prefixes.
- Path exists and corresponds to the specified next-hop address.
Copy link
Collaborator

Choose a reason for hiding this comment

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

only one path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gmuloc
Yes we are verifying the path correspond to the given nexthop.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the point is that we have a list of paths so we shouuld reword that the success is only if every path exists. The sentence is currently singular

Suggested change
- Path exists and corresponds to the specified next-hop address.
- Every path exists and corresponds to the specified next-hop address.

Copy link
Collaborator

Choose a reason for hiding this comment

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

check also if this is required for failure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated. Thanks!!

@vitthalmagadum vitthalmagadum marked this pull request as ready for review December 19, 2024 12:12
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
Contributor

github-actions bot commented Jan 2, 2025

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

Copy link
Contributor

github-actions bot commented Jan 9, 2025

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

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 test case to verify the BGP route origin.
3 participants