10000 feat(anta.tests): Adding the test case to verify BGP neighbor capabilities by MaheshGSLAB · Pull Request #490 · aristanetworks/anta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(anta.tests): Adding the test case to verify BGP neighbor capabilities #490

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

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

MaheshGSLAB
Copy link
Collaborator
@MaheshGSLAB MaheshGSLAB commented Dec 11, 2023

Description

Add the test case to verify the BGP neighbor capabilities.

Run the testcase by adding catalog as below:

- VerifyBGPCapabilities:
        bgp_neighbors:
          - neighbor: 172.30.11.1
            vrf: default
            capabilities:
              - name: multiprotocolCaps
                sub_name: ipv4Unicast
              - name: fourOctetAsnCap
          - neighbor: 172.30.11.5
            vrf: default
            capabilities:
              - name: multiprotocolCaps
                sub_name: ipv4Unicast
  1. Testcase pass when neighbor capabilities are correct.
 All tests results                                                          
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name             ┃ Test Status ┃ Message(s) ┃ Test description                                   ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBGPCapabilities │ success     │            │ Verifies if BGP neighbors are configured with      │ routing, bgp  │
│           │                       │             │            │ correct capabilities in the specified VRF.         │               │
└───────────┴───────────────────────┴─────────────┴────────────┴────────────────────────────────────────────────────┴───────────────┘
  1. Testcase fails when there is no such neighbor or vrf.
  All tests results                                                          
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name             ┃ Test Status ┃ Message(s)                     ┃ Test description               ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBGPCapabilities │ failure     │ BGP neighbor 172.30.11.10 is   │ Verifies if BGP neighbors are  │ routing, bgp  │
│           │                       │             │ not configured for `default`   │ configured with correct        │               │
│           │                       │             │ VRF.                           │ capabilities in the specified  │               │
│           │                       │             │                                │ VRF.                           │               │
└───────────┴───────────────────────┴─────────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘
  1. Testcase fails when capabilities are missing or not found

                                                          All tests results                                                          
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Device    ┃ Test Name             ┃ Test Status ┃ Message(s)                     ┃ Test description               ┃ Test category ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ s1-spine1 │ VerifyBGPCapabilities │ failure     │ Following BGP neighbor         │ Verifies if BGP neighbors are  │ routing, bgp  │
│           │                       │             │ capabilities are not found or  │ configured with correct        │               │
│           │                       │             │ not ok:                        │ capabilities in the specified  │               │
│           │                       │             │ {'bgp_neighbors':              │ VRF.                           │               │
│           │                       │             │ {'172.30.11.1': {'default':    │                                │               │
│           │                       │             │ {'multiprotocolCaps':          │                                │               │
│           │                       │             │ {'ipv4Unicast': {'advertised': │                                │               │
│           │                       │             │ False, 'received': False,      │                                │               │
│           │                       │             │ 'enabled': False}},            │                                │               │
│           │                       │             │ 'missing_capabilities':        │                                │               │
│           │                       │             │ ['multiprotocolCaps            │                                │               │
│           │                       │             │ l2VpnEvpn', 'multiprotocolCaps │                                │               │
│           │                       │             │ ipv4MplsLabels',               │                                │               │
│           │                       │             │ 'multiprotocolCaps             │                                │               │
│           │                       │             │ ipv6MplsLabels',               │                                │               │
│           │                       │             │ 'multiprotocolCaps             │                                │               │
│           │                       │             │ ipv4MplsVpn',                  │                                │               │
│           │                       │             │ 'multiprotocolCaps             │                                │               │
│           │                       │             │ ipv6MplsVpn'],                 │                                │               │
│           │                       │             │ 'fourOctetAsnCap':             │                                │               │
│           │                       │             │ {'advertised': False,          │                                │               │
│           │                       │             │ 'received': False, 'enabled':  │                                │               │
│           │                       │             │ False}}}, '172.30.11.5':       │                                │               │
│           │                       │             │ {'default':                    │                                │               │
│           │                       │             │ {'multiprotocolCaps':          │                                │               │
│           │                       │             │ {'ipv4Unicast': {'advertised': │                                │               │
│           │                       │             │ False, 'received': False,      │                                │               │
│           │                       │             │ 'enabled': False}}}}}}         │                                │               │
└───────────┴───────────────────────┴─────────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘

Fixes #483

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 marked this pull request as ready for review December 13, 2023 09:12
@MaheshGSLAB MaheshGSLAB changed the title feat: Adding the test case to verify BGP neighbor capabilities feat(anta.tests)!: Adding the test case to verify BGP neighbor capabilities Jan 4, 2024
@gmuloc gmuloc changed the title feat(anta.tests)!: Adding the test case to verify BGP neighbor capabilities feat(anta.tests): Adding the test case to verify BGP neighbor capabilities Jan 5, 2024
Copy link
Contributor
github-actions bot commented Jan 9, 2024

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

Copy link
Contributor
github-actions bot commented Jan 9, 2024

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

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
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.

:shipit:

@gmuloc gmuloc dismissed carl-baillargeon’s stale review January 24, 2024 13:39

updated - take a new look ;)

issue-483: Updated the testcase with unit tests

issue-483: fix the unit tests

issue-483: Updated doc string for input class

issue-483: spilited testcase into parts

issue-483: fixed the typo

issue-483: updated custom types

issue-483: remove seprator

issue-483: updated neighbor with peer

issue-483: updated show command

issue-483: fixed the black for utils.py

issue-483: fixed all linting for utils.py

issue-483: updated unit tests and used get_item method

issue-483: removed utils file
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. Thank you Mahesh

@carl-baillargeon carl-baillargeon merged commit a43499d into aristanetworks:main Jan 24, 2024
MaheshGSLAB added a commit to MaheshGSLAB/anta that referenced this pull request Jan 30, 2024
…ities (aristanetworks#490)

* Added the testcase for BGP neighbor capabilities
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 BGP peering capabilities
4 participants
0