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

Running BGP health test on switch without multi-agent #943

Closed
kosichd opened this issue Dec 2, 2024 · 11 comments · Fixed by #1003
Closed

Running BGP health test on switch without multi-agent #943

kosichd opened this issue Dec 2, 2024 · 11 comments · Fixed by #1003
Assignees
Milestone

Comments

@kosichd
Copy link

kosichd commented Dec 2, 2024

On switches that do not have "service routing protocols model multi-agent" configured, the cmd "show bgp {afi} {safi} summary is not supported. When using VerifyBGPSpecificPeers or VerifyBGPHealth tests, it seems to only work if the switch in question is using mulit-agent. For switches that have "service routing protocols model ribd" configured, there should be a way for the test to run "show ip bgp sum'

It seems the problem may be here, as "show bgp {afi} sum' is not a valid EOS command:

commands: ClassVar[list[AntaCommand | AntaTemplate]] = [
    AntaTemplate(template="show bgp {afi} {safi} summary vrf {vrf}", revision=3),
    AntaTemplate(template="show bgp {afi} summary", revision=3),

From a switch running 4.31.5M, 'summary' is not an option

switch#sh bgp ipv4 ?
access-list Named access-list
labeled-unicast Display labeled-unicast information
multicast Display multicast information
unicast Display unicast information

Also from a switch not running multi-agent:

switch#sh bgp ipv4 unicast sum
% Not supported

@carl-baillargeon
Copy link
Contributor

Hi @kosichd,

These tests are indeed only supported on switches running with multi-agent. Multi-agent has been the default since 4.30.1, and starting with 4.32, you cannot configure ribd at all. Therefore, we don't have any plans to support ribd for these tests.

The show bgp {afi} summary command template is only used when the AFI is not IPv4 or IPv6 (e.g., evpn, vpn-ipv4, etc.). VRF is not needed here since these AFIs operate at a global level and do not use the VRF concept in the same way as IPv4/IPv6. On the other hand, show bgp {afi} {safi} summary vrf {vrf} template is used with IPv4 and IPv6 AFIs, where a SAFI is also needed with an optional VRF.

We have simpified the logic of this in PR #888, where we now use show bgp summary vrf all and show bgp neighbors vrf all commands instead, without impacting test inputs.

@kosichd kosichd closed this as completed Dec 3, 2024
@kosichd
Copy link
Author

kosichd commented Dec 3, 2024

Thanks for the quick reply @carl-baillargeon

@carl-baillargeon
Copy link
Contributor

Anytime @kosichd. I will add a note in our documentation around this.

Thanks!

@carl-baillargeon carl-baillargeon self-assigned this Dec 3, 2024
@kosichd kosichd changed the title Running BGP health test on switch wihthout multi-agent Running BGP health test on switch without multi-agent Jan 3, 2025
@gmuloc gmuloc reopened this Jan 7, 2025
@gmuloc gmuloc added this to the v1.3.0 milestone Jan 7, 2025
@gmuloc
Copy link
Collaborator

gmuloc commented Jan 8, 2025

The goal for this one would be to write two new tests in parallel of VerifyBGPSpecificPeers or VerifyBGPPeersHealth tailored for RIBD with new names (because they require different commands).

The documentation warning needs to be updated

@gmuloc
Copy link
Collaborator

gmuloc commented Jan 14, 2025

@kosichd please give these new tests a run and lets us know if that works for you! You need to install ANTA from main.

@kosichd
Copy link
Author

kosichd commented Jan 20, 2025

Hi @gmuloc the below works:

anta.tests.routing:
  bgp:
    - VerifyBGPPeerSessionRibd:
        check_tcp_queues: false
        bgp_peers:
          - peer_address:  1.1.1.1
            vrf: default

But does the neighbor have to be explicitly defined? Or can you just specify the VRF like in VerifyBGPPeersHealth and have it check all neighbors in that VRF?

anta.tests.routing:
  bgp:
    - VerifyBGPPeersHealth:
        address_families:
          - afi: "evpn"
          - afi: "ipv4"
            safi: "unicast"
            vrf: "default"
          - afi: "ipv6"
            safi: "unicast"
            vrf: "DEV"
            check_tcp_queues: false

@kosichd
Copy link
Author

kosichd commented Jan 20, 2025

Sorry @gmuloc i see there are two tests, VerifyBGPPeersHealthRibd AND VerifyBGPPeerSessionRibd. I will try PeersHealth right now

@gmuloc
Copy link
Collaborator

gmuloc commented Jan 20, 2025

Hello @kosichd - as it is implemented today you need to give the peer IP (following the test VerifyBGPSpecificPeers) feel free to open a new issue to ask for a test checking all the peers in a given VRF.
The input model today would not allow to do it in the VerifyBGPPeerSessionRibd.

@kosichd
Copy link
Author

kosichd commented Jan 20, 2025

@gmuloc is this the syntax for the new VerifyBGPPeersHealthRibd test?

- VerifyBGPPeersHealthRibd:
    address_families:
      - afi: "ipv4"
        safi: "unicast"
        vrf: "default"

     **VerifyBGPPeersHealthRibd test inputs are not valid: 1 validation error for Input                                                                                                                                                                                                      
                        address_families**    

@gmuloc
Copy link
Collaborator

gmuloc commented Jan 20, 2025

@gmuloc is this the syntax for the new VerifyBGPPeersHealthRibd test?

- VerifyBGPPeersHealthRibd:
    address_families:
      - afi: "ipv4"
        safi: "unicast"
        vrf: "default"

     **VerifyBGPPeersHealthRibd test inputs are not valid: 1 validation error for Input                                                                                                                                                                                                      
                        address_families**    

You can find the test documentation in the main doc on the website:

https://anta.arista.com/main/api/tests.routing.bgp/#anta.tests.routing.bgp.VerifyBGPPeersHealthRibd

you cannot give address families for ribd, nor any specific VRF - maybe this test can be augmented to filter on specific VRFs

@kosichd
Copy link
Author

kosichd commented Jan 20, 2025

I understand now, thanks @gmuloc. Thanks to the ANTA team for implementing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants