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.tests): Adding the test case to verify BFD session and timers #500

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

MaheshGSLAB
Copy link
Contributor

@MaheshGSLAB MaheshGSLAB commented Dec 20, 2023

Description

Add the test case to verify the BFD session and timers.

Run the testcase by adding catalog as below:

anta.tests.bfd:
  - VerifyBFDSpecificPeers:
      bfd_peers:
        - peer_address: 192.0.255.8
          vrf: default
        - peer_address: 192.0.255.7
          vrf: default
  - VerifyBFDPeersIntervals:
      bfd_peers:
        - peer_address: 192.0.255.8
          vrf: default
          tx_interval: 1200000
          rx_interval: 1200000
          multiplier: 3
        - peer_address: 192.0.255.7
          vrf: default
          tx_interval: 1200000
          rx_interval: 1200000
          multiplier: 3
  1. Testcase pass when details are correct.
                                                                    All tests results                                                                     
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name               ┃ Test Status ┃ Message(s) ┃ Test description                                                       ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBFDPeersIntervals │ success     │            │ Verifies the timers of the BFD peers in the specified VRF.             │ bfd           │
├───────────┼─────────────────────────┼─────────────┼────────────┼────────────────────────────────────────────────────────────────────────┼───────────────┤
│ s1-spine1 │ VerifyBFDSpecificPeers  │ success     │            │ Verifies the BFD peer's sessions and remote disc in the specified VRF. │ bfd           │
└───────────┴─────────────────────────┴─────────────┴────────────┴────────────────────────────────────────────────────────────────────────┴───────────────┘
  1. Testcase fails when bfd neighbor not found.

                                                                                          All tests results                                                                                           
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name               ┃ Test Status ┃ Message(s)                                                     ┃ Test description                                              ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBFDSpecificPeers  │ failure     │ Following BFD peers are not configured, status is not up or    │ Verifies the BFD peer's sessions and remote disc in the       │ bfd           │
│           │                         │             │ remote disc is zero:                                           │ specified VRF.                                                │               │
│           │                         │             │ {'192.0.255.81': {'MGMT': 'Not Configured'}, '192.0.255.71':   │                                                               │               │
│           │                         │             │ {'default': 'Not Configured'}}                                 │                                                               │               │
├───────────┼─────────────────────────┼─────────────┼────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────┼───────────────┤
│ s1-spine1 │ VerifyBFDPeersIntervals │ failure     │ Following BFD peers are not configured or timers are not       │ Verifies the timers of the BFD peers in the specified VRF.    │ bfd           │
│           │                         │             │ correct:                                                       │                                                               │               │
│           │                         │             │ {'192.0.255.81': {'MGMT': 'Not Configured'}, '192.0.255.71':   │                                                               │               │
│           │                         │             │ {'default': 'Not Configured'}}                                 │                                                               │               │
└───────────┴─────────────────────────┴─────────────┴────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────┴───────────────┘
  1. Testcase fails when BDF neighbor session is not up and timers are not correct.
 
                                                                                          All tests results                                                                                           
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name               ┃ Test Status ┃ Message(s)                                                     ┃ Test description                                              ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBFDPeersIntervals │ failure     │ Following BFD peers are not configured or timers are not       │ Verifies the timers of the BFD peers in the specified VRF.    │ bfd           │
│           │                         │             │ correct:                                                       │                                                               │               │
│           │                         │             │ {'192.0.255.8': {'default': {'tx_interval': 1200000,           │                                                               │               │
│           │                         │             │ 'rx_interval': 1200000, 'multiplier': 3}}, '192.0.255.7':      │                                                               │               │
│           │                         │             │ {'default': {'tx_interval': 1200000, 'rx_interval': 1200000,   │                                                               │               │
│           │                         │             │ 'multiplier': 3}}}                                             │                                                               │               │
├───────────┼─────────────────────────┼─────────────┼────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────┼───────────────┤
│ s1-spine1 │ VerifyBFDSpecificPeers  │ failure     │ Following BFD peers are not configured, status is not up or    │ Verifies the BFD peer's sessions and remote disc in the       │ bfd           │
│           │                         │             │ remote disc is zero:                                           │ specified VRF.                                                │               │
│           │                         │             │ {'192.0.255.8': {'default': {'status': 'down', 'remote_disc':  │                                                               │               │
│           │                         │             │ 0}}, '192.0.255.7': {'default': {'status': 'down',             │                                                               │               │
│           │                         │             │ 'remote_disc': 0}}}                                            │                                                               │               │
└───────────┴─────────────────────────┴─────────────┴────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────┴───────────────┘

Fixes #499

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)

@MaheshGSLAB MaheshGSLAB self-assigned this Dec 20, 2023
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review December 20, 2023 09:35
anta/tests/bfd.py Show resolved Hide resolved
anta/tests/bfd.py Outdated Show resolved Hide resolved
@MaheshGSLAB MaheshGSLAB changed the title feat: Adding the test case to verify BFD session and timers feat(anta.tests)!: Adding the test case to verify BFD session and timers Jan 4, 2024
@gmuloc gmuloc changed the title feat(anta.tests)!: Adding the test case to verify BFD session and timers feat(anta.tests): Adding the test case to verify BFD session and timers Jan 5, 2024
Copy link
Contributor

@carl-baillargeon carl-baillargeon left a comment

Choose a reason for hiding this comment

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

LGTM. Please check my comment on inputs if it's possible or not.

anta/tests/bfd.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@titom73 titom73 left a comment

Choose a reason for hiding this comment

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

LGTM

@titom73 titom73 merged commit 62520e5 into aristanetworks:main Feb 7, 2024
19 checks passed
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.

Add the test case to verify the BFD session, timers and peers
4 participants