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

MultiProtocolCaps custom type should be more restrictive #1015

Open
carl-baillargeon opened this issue Jan 20, 2025 · 0 comments
Open

MultiProtocolCaps custom type should be more restrictive #1015

carl-baillargeon opened this issue Jan 20, 2025 · 0 comments
Assignees

Comments

@carl-baillargeon
Copy link
Contributor

carl-baillargeon commented Jan 20, 2025

Even though MultiProtocolCaps has support for abbreviations (IPv4 Unicast, etc.), it supports any string today:

anta.tests.routing:
  bgp:
    - VerifyBGPPeerMPCaps:
        bgp_peers:
          - peer_address: 10.1.254.21
            vrf: default
            strict: False
            capabilities:
              - ipv4Unicast
              - pizza

Result:
DC1-LEAF1A :: VerifyBGPPeerMPCaps :: FAILURE(Peer: 10.1.254.21 VRF: default - pizza not found)

The custom type should be updated to support the following mapping (both formats):

MP_CAPABILITIES_MAPPING = {
   # Human readable format -> EOS format
   "Dynamic Path Selection": "dps",
   "IPv4 Unicast": "ipv4Unicast",
   "IPv6 Unicast": "ipv6Unicast",
   "IPv4 Multicast": "ipv4Multicast",
   "IPv6 Multicast": "ipv6Multicast",
   "IPv4 Labeled Unicast": "ipv4MplsLabels",
   "IPv6 Labeled Unicast": "ipv6MplsLabels",
   "IPv4 SR-TE": "ipv4SrTe",
   "IPv6 SR-TE": "ipv6SrTe",
   "IPv4 MPLS Label": "ipv4MplsVpn",
   "IPv6 MPLS Label": "ipv6MplsVpn", 
   "IPv4 Flowspec": "ipv4FlowSpec",
   "IPv6 Flowspec": "ipv6FlowSpec",
   "IPv4 Flowspec VPN": "ipv4FlowSpecVpn",
   "IPv6 Flowspec VPN": "ipv6FlowSpecVpn",
   "L2VPN VPLS": "l2VpnVpls",
   "L2VPN EVPN": "l2VpnEvpn",
   "Link State": "linkState",
   "RT Membership": "rtMembership",
   "IPv4 RtMembership": "rtMembership",
   "IPv4 MVPN": "ipv4Mvpn",
}
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

No branches or pull requests

2 participants