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

fix(anta.tests): First round of cleaning up BGP tests module #888

Merged
merged 19 commits into from
Nov 14, 2024

Conversation

carl-baillargeon
Copy link
Contributor

@carl-baillargeon carl-baillargeon commented Oct 17, 2024

Description

Refactoring BGP tests module to address the following issues:

Focusing on VerifyBGPPeerCount, VerifyBGPPeersHealth, VerifyBGPSpecificPeers

Task list:

  • Update unit tests for VerifyBGPPeersHealth & VerifyBGPSpecificPeers
    • Success
    • VRF not configured
    • No peers found
    • Session not established
    • AFI/SAFI not negotiated
    • TCP session queues not empty if check_tcp_queues is True
  • Add unit tests for check_bgp_neighbor_capability (IMP: Added unit tests in test_tools.)
  • Add unit tests for format_data

Changes

  • Updated InQ & OutQ steps as or evaluates lazily, meaning if the first part (InQ := value) != 0 is True, the second part (OutQ := value) != 0 will not be evaluated, results OutQ is never assigned, leading to a NameError.
  • In VerifyBGPSpecificPeers test, added check for peers have correct AFI/SAFI negotiated.
  • Added _check_bgp_neighbor_capability to bgp module as intended to BGP module only.

Copy link

codspeed-hq bot commented Oct 29, 2024

CodSpeed Performance Report

Merging #888 will not alter performance

Comparing carl-baillargeon:feat/bgp_modules (b76236a) with main (8ac4477)

Summary

✅ 8 untouched benchmarks

@vitthalmagadum vitthalmagadum marked this pull request as ready for review October 30, 2024 08:07
@vitthalmagadum vitthalmagadum requested a review from gmuloc October 30, 2024 08:08
Copy link
Collaborator

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

This PR seems quite breaking for the tests as we are suddenly checking more things.
to get a success like Count is now dpeendent on the state of the peer when it did not used to be.

Ideally we could add a flag for this one to not be concerned with the the state (default being we are not) to be backward compatible

Copy link
Contributor

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

Copy link
Contributor

github-actions bot commented Nov 5, 2024

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

@vitthalmagadum vitthalmagadum requested a review from gmuloc November 7, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants