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): Cleaning up BGP tests module #904

Closed

Conversation

vitthalmagadum
Copy link
Collaborator

@vitthalmagadum vitthalmagadum commented Oct 29, 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
  • 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

sonarcloud bot commented Oct 29, 2024

@carl-baillargeon
Copy link
Contributor

Duplicate of #888

@carl-baillargeon carl-baillargeon marked this as a duplicate of #888 Oct 30, 2024
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.

2 participants