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 test case to verify Spanning Tree (RPVST) state(stable topology) #791

Merged
merged 7 commits into from
Sep 26, 2024

Conversation

vitthalmagadum
Copy link
Collaborator

Description

Verifies the number of changes across all interfaces in the Spanning Tree Protocol (STP) topology is below a threshold.

Expected Results
----------------
* Success: The test will pass if the total number of changes across all interfaces is less than the specified threshold.
* Failure: The test will fail if the total number of changes across all interfaces meets or exceeds the specified threshold,
indicating potential instability in the topology.

Fixes #782

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/stp.py Outdated Show resolved Hide resolved
anta/tests/stp.py Outdated Show resolved Hide resolved
tests/units/anta_tests/test_stp.py Show resolved Hide resolved
tests/units/anta_tests/test_stp.py Outdated Show resolved Hide resolved
anta/tests/stp.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@MaheshGSLAB MaheshGSLAB left a comment

Choose a reason for hiding this comment

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

LGTM

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

Can you add unit tests with outputs from different configured spanning-tree modes (mstp, rapid-pvst, rstp, none)?

DC1-LEAF1A(config)#spanning-tree mode ?
  backup      Backup port mode
  mstp        Multiple spanning tree protocol
  none        Disable spanning tree
  rapid-pvst  Per VLAN rapid spanning tree protocol
  rstp        Rapid spanning tree protocol

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.

@vitthalmagadum
Copy link
Collaborator Author

Can you add unit tests with outputs from different configured spanning-tree modes (mstp, rapid-pvst, rstp, none)?

DC1-LEAF1A(config)#spanning-tree mode ?
  backup      Backup port mode
  mstp        Multiple spanning tree protocol
  none        Disable spanning tree
  rapid-pvst  Per VLAN rapid spanning tree protocol
  rstp        Rapid spanning tree protocol

Added unit test for rstp mode.

anta/tests/stp.py Outdated Show resolved Hide resolved
anta/tests/stp.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 26, 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

@carl-baillargeon carl-baillargeon merged commit 6923396 into aristanetworks:main Sep 26, 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 Test case to verify Spanning Tree (RPVST) state
3 participants