Skip to content

Commit

Permalink
topotests: add mpls l3vpn test with default vrf
Browse files Browse the repository at this point in the history
There is no MPLS VPN test with default VRF.
Add a test to ensure that the MPLS VPN MIB also
works with the default VRF.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Jun 8, 2023
1 parent 02831c6 commit 01e5c62
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
9 changes: 9 additions & 0 deletions tests/topotests/bgp_snmp_mplsl3vpn/r1/bgpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ router bgp 65000
neighbor 10.4.4.4 update-source 10.1.1.1
neighbor 10.4.4.4 timers connect 10
!
address-family ipv4 unicast
network 8.8.8.8/32
label vpn export 8888
rd vpn export 88:88
rt vpn both 88:99
export vpn
import vpn
exit-address-family
no bgp network import-check
address-family ipv4 vpn
neighbor 10.4.4.4 activate
exit-address-family
Expand Down
48 changes: 26 additions & 22 deletions tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,19 @@ def _convergence():


interfaces_up_test = {
"mplsL3VpnConfiguredVrfs": "2",
"mplsL3VpnActiveVrfs": "2",
"mplsL3VpnConnectedInterfaces": "3",
"mplsL3VpnConfiguredVrfs": "3",
"mplsL3VpnActiveVrfs": "3",
"mplsL3VpnConnectedInterfaces": "7",
"mplsL3VpnNotificationEnable": "true(1)",
"mplsL3VpnVrfConfMaxPossRts": "0",
"mplsL3VpnVrfConfRteMxThrshTime": "0 seconds",
"mplsL3VpnIlllblRcvThrsh": "0",
}

interfaces_down_test = {
"mplsL3VpnConfiguredVrfs": "2",
"mplsL3VpnActiveVrfs": "1",
"mplsL3VpnConnectedInterfaces": "3",
"mplsL3VpnConfiguredVrfs": "3",
"mplsL3VpnActiveVrfs": "2",
"mplsL3VpnConnectedInterfaces": "7",
"mplsL3VpnNotificationEnable": "true(1)",
"mplsL3VpnVrfConfMaxPossRts": "0",
"mplsL3VpnVrfConfRteMxThrshTime": "0 seconds",
Expand Down Expand Up @@ -325,7 +325,6 @@ def router_interface_get_ifindex(router, interface):


def generate_vrf_ifindex_oid(vrf, ifindex):

intoid = snmp_uint32_to_oid(int(ifindex))
vrfoid = snmp_str_to_oid(vrf)
oid = "{}.{}".format(vrfoid, intoid)
Expand Down Expand Up @@ -392,17 +391,17 @@ def test_r1_mplsvpn_IfTable():


vrftable_test = {
"mplsL3VpnVrfDescription": ["VRF-a", "VRF-b"],
"mplsL3VpnVrfRD": ['"10:1"', '"10:2"'],
"mplsL3VpnVrfOperStatus": ["up(1)", "up(1)"],
"mplsL3VpnVrfActiveInterfaces": ["2", "1"],
"mplsL3VpnVrfAssociatedInterfaces": ["2", "1"],
"mplsL3VpnVrfConfMidRteThresh": ["0", "0"],
"mplsL3VpnVrfConfHighRteThresh": ["0", "0"],
"mplsL3VpnVrfConfMaxRoutes": ["0", "0"],
"mplsL3VpnVrfConfRowStatus": ["active(1)", "active(1)"],
"mplsL3VpnVrfConfAdminStatus": ["up(1)", "up(1)"],
"mplsL3VpnVrfConfStorageType": ["volatile(2)", "volatile(2)"],
"mplsL3VpnVrfDescription": ["VRF-a", "VRF-b", "default"],
"mplsL3VpnVrfRD": ['"10:1"', '"10:2"', '"88:88"'],
"mplsL3VpnVrfOperStatus": ["up(1)", "up(1)", "up(1)"],
"mplsL3VpnVrfActiveInterfaces": ["2", "1", "3"],
"mplsL3VpnVrfAssociatedInterfaces": ["2", "1", "3"],
"mplsL3VpnVrfConfMidRteThresh": ["0", "0", "0"],
"mplsL3VpnVrfConfHighRteThresh": ["0", "0", "0"],
"mplsL3VpnVrfConfMaxRoutes": ["0", "0", "0"],
"mplsL3VpnVrfConfRowStatus": ["active(1)", "active(1)", "active(1)"],
"mplsL3VpnVrfConfAdminStatus": ["up(1)", "up(1)", "up(1)"],
"mplsL3VpnVrfConfStorageType": ["volatile(2)", "volatile(2)", "volatile(2)"],
}


Expand Down Expand Up @@ -499,10 +498,14 @@ def test_r1_mplsvpn_VrfTable():


rt_table_test = {
"mplsL3VpnVrfRT": ['"1:1"', '"1:2"'],
"mplsL3VpnVrfRTDescr": ["RT both for VRF VRF-a", "RT both for VRF VRF-b"],
"mplsL3VpnVrfRTRowStatus": ["active(1)", "active(1)"],
"mplsL3VpnVrfRTStorageType": ["volatile(2)", "volatile(2)"],
"mplsL3VpnVrfRT": ['"1:1"', '"1:2"', '"88:99"'],
"mplsL3VpnVrfRTDescr": [
"RT both for VRF VRF-a",
"RT both for VRF VRF-b",
"RT both for VRF default",
],
"mplsL3VpnVrfRTRowStatus": ["active(1)", "active(1)", "active(1)"],
"mplsL3VpnVrfRTStorageType": ["volatile(2)", "volatile(2)", "volatile(2)"],
}


Expand All @@ -516,6 +519,7 @@ def test_r1_mplsvpn_VrfRT_table():
oids = []
oids.append(generate_vrf_index_type_oid("VRF-a", 1, 3))
oids.append(generate_vrf_index_type_oid("VRF-b", 1, 3))
oids.append(generate_vrf_index_type_oid("default", 1, 3))

# check items
for item in rt_table_test.keys():
Expand Down

0 comments on commit 01e5c62

Please sign in to comment.