tests: Adding test suites evpn_type5_test_topo1

1. Added 15 test cases to test evpn type5 functionality
2. Total execution time is ~9 mins

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
This commit is contained in:
Kuldeep Kashyap 2020-07-01 13:16:34 +00:00
parent 3c334c3915
commit 1b66072ce0
7 changed files with 4956 additions and 36 deletions

View File

@ -0,0 +1,887 @@
{
"address_types": ["ipv4","ipv6"],
"ipv4base": "10.0.0.0",
"ipv4mask": 30,
"ipv6base": "fd00::",
"ipv6mask": 64,
"link_ip_start": {
"ipv4": "10.0.0.0",
"v4mask": 30,
"ipv6": "fd00::",
"v6mask": 64
},
"lo_prefix": {
"ipv4": "1.0.",
"v4mask": 32,
"ipv6": "2001:db8:f::",
"v6mask": 128
},
"routers": {
"r1": {
"links": {
"e1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"}
},
"vrfs":[
{
"name": "RED",
"id": "1"
}
],
"bgp":
[
{
"local_as": "1",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r1": {}
}
}
}
}
}
}
}
],
"static_routes":[
{
"network":"10.1.1.1/32",
"next_hop":"Null0",
"vrf": "RED"
},
{
"network":"10::1/128",
"next_hop":"Null0",
"vrf": "RED"
}
]
},
"r2": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"e1-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "BLUE",
"id": "1"
},
{
"name": "GREEN",
"id": "2"
}
],
"bgp":
[
{
"local_as": "2",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link1": {}
}
}
}
}
}
}
},
{
"local_as": "2",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link2": {}
}
}
}
}
}
}
}
],
"static_routes":[
{
"network":"20.1.1.1/32",
"next_hop":"Null0",
"vrf": "BLUE"
},
{
"network":"20::1/128",
"next_hop":"Null0",
"vrf": "BLUE"
},
{
"network":"30.1.1.1/32",
"next_hop":"Null0",
"vrf": "GREEN"
},
{
"network":"30::1/128",
"next_hop":"Null0",
"vrf": "GREEN"
}
]
},
"e1": {
"links": {
"r1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r2-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r2-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"},
"d1-link1": {"ipv4": "auto", "ipv6": "auto"},
"d2-link1": {"ipv4": "auto", "ipv6": "auto"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "100",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"e1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"e1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"e1-link1": {
"deactivate": "ipv4"
}
}
},
"d2": {
"dest_link": {
"e1-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"d1": {
"ipv4":{
"e1-link1": "activate"
}
},
"d2": {
"ipv4":{
"e1-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
}
]
},
"d1": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto"},
"r3": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r4-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r4-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "100",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"e1": {
"dest_link": {
"d1-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"e1": {
"ipv4":{
"d1-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
},
{
"local_as": "100",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
}
]
},
"d2": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto"},
"r3": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r4-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r4-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "200",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"e1": {
"dest_link": {
"d2-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"e1": {
"ipv4":{
"d2-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
},
{
"local_as": "200",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "200",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "200",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
}
]
},
"r3": {
"links": {
"d1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"d2": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"}
},
"vrfs":[
{
"name": "RED",
"id": "1"
}
],
"bgp":
[
{
"local_as": "3",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r3": {}
}
},
"d2": {
"dest_link": {
"r3": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r3": {}
}
},
"d2": {
"dest_link": {
"r3": {}
}
}
}
}
}
}
}
]
},
"r4": {
"links": {
"d1-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"d1-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"},
"d2-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"d2-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "BLUE",
"id": "1"
},
{
"name": "GREEN",
"id": "2"
}
],
"bgp":
[
{
"local_as": "4",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link1": {}
}
},
"d2": {
"dest_link": {
"r4-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link1": {}
}
},
"d2": {
"dest_link": {
"r4-link1": {}
}
}
}
}
}
}
},
{
"local_as": "4",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link2": {}
}
},
"d2": {
"dest_link": {
"r4-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link2": {}
}
},
"d2": {
"dest_link": {
"r4-link2": {}
}
}
}
}
}
}
}
]
}
}
}

View File

@ -0,0 +1,887 @@
{
"address_types": ["ipv4","ipv6"],
"ipv4base": "10.0.0.0",
"ipv4mask": 30,
"ipv6base": "fd00::",
"ipv6mask": 64,
"link_ip_start": {
"ipv4": "10.0.0.0",
"v4mask": 30,
"ipv6": "fd00::",
"v6mask": 64
},
"lo_prefix": {
"ipv4": "1.0.",
"v4mask": 32,
"ipv6": "2001:db8:f::",
"v6mask": 128
},
"routers": {
"r1": {
"links": {
"e1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"}
},
"vrfs":[
{
"name": "RED",
"id": "1"
}
],
"bgp":
[
{
"local_as": "1",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r1": {}
}
}
}
}
}
}
}
],
"static_routes":[
{
"network":"10.1.1.1/32",
"next_hop":"Null0",
"vrf": "RED"
},
{
"network":"10::1/128",
"next_hop":"Null0",
"vrf": "RED"
}
]
},
"r2": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"e1-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "BLUE",
"id": "1"
},
{
"name": "GREEN",
"id": "2"
}
],
"bgp":
[
{
"local_as": "2",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link1": {}
}
}
}
}
}
}
},
{
"local_as": "2",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"redistribute": [
{"redist_type": "static"}
],
"neighbor": {
"e1": {
"dest_link": {
"r2-link2": {}
}
}
}
}
}
}
}
],
"static_routes":[
{
"network":"20.1.1.1/32",
"next_hop":"Null0",
"vrf": "BLUE"
},
{
"network":"20::1/128",
"next_hop":"Null0",
"vrf": "BLUE"
},
{
"network":"30.1.1.1/32",
"next_hop":"Null0",
"vrf": "GREEN"
},
{
"network":"30::1/128",
"next_hop":"Null0",
"vrf": "GREEN"
}
]
},
"e1": {
"links": {
"r1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r2-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r2-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"},
"d1-link1": {"ipv4": "auto", "ipv6": "auto"},
"d2-link1": {"ipv4": "auto", "ipv6": "auto"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "100",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"e1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"e1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"e1-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"e1-link1": {
"deactivate": "ipv4"
}
}
},
"d2": {
"dest_link": {
"e1-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"d1": {
"ipv4":{
"e1-link1": "activate"
}
},
"d2": {
"ipv4":{
"e1-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
}
]
},
"d1": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto"},
"r3": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r4-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r4-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "100",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"e1": {
"dest_link": {
"d1-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"e1": {
"ipv4":{
"d1-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
},
{
"local_as": "100",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "100",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d1-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
}
]
},
"d2": {
"links": {
"e1-link1": {"ipv4": "auto", "ipv6": "auto"},
"r3": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"r4-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"r4-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "RED",
"id": "1",
"vni": 75100
},
{
"name": "BLUE",
"id": "2",
"vni": 75200
},
{
"name": "GREEN",
"id": "3",
"vni": 75300
}
],
"bgp":
[
{
"local_as": "200",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"e1": {
"dest_link": {
"d2-link1": {
"deactivate": "ipv4"
}
}
}
}
}
},
"l2vpn": {
"evpn": {
"neighbor": {
"e1": {
"ipv4":{
"d2-link1": "activate"
}
}
},
"advertise-all-vni": true
}
}
}
},
{
"local_as": "200",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"d2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "200",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link1": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
},
{
"local_as": "200",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"d2-link2": {}
}
}
}
}
},
"l2vpn": {
"evpn": {
"advertise": {
"ipv4": {
"unicast": {}
},
"ipv6": {
"unicast": {}
}
}
}
}
}
}
]
},
"r3": {
"links": {
"d1": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"},
"d2": {"ipv4": "auto", "ipv6": "auto", "vrf": "RED"}
},
"vrfs":[
{
"name": "RED",
"id": "1"
}
],
"bgp":
[
{
"local_as": "3",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r3": {}
}
},
"d2": {
"dest_link": {
"r3": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r3": {}
}
},
"d2": {
"dest_link": {
"r3": {}
}
}
}
}
}
}
}
]
},
"r4": {
"links": {
"d1-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"d1-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"},
"d2-link1": {"ipv4": "auto", "ipv6": "auto", "vrf": "BLUE"},
"d2-link2": {"ipv4": "auto", "ipv6": "auto", "vrf": "GREEN"}
},
"vrfs":[
{
"name": "BLUE",
"id": "1"
},
{
"name": "GREEN",
"id": "2"
}
],
"bgp":
[
{
"local_as": "4",
"vrf": "BLUE",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link1": {}
}
},
"d2": {
"dest_link": {
"r4-link1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link1": {}
}
},
"d2": {
"dest_link": {
"r4-link1": {}
}
}
}
}
}
}
},
{
"local_as": "4",
"vrf": "GREEN",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link2": {}
}
},
"d2": {
"dest_link": {
"r4-link2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"d1": {
"dest_link": {
"r4-link2": {}
}
},
"d2": {
"dest_link": {
"r4-link2": {}
}
}
}
}
}
}
}
]
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1057,28 +1057,22 @@ def verify_bgp_convergence(tgen, topo, dut=None):
API will verify if BGP is converged with in the given time frame.
Running "show bgp summary json" command and verify bgp neighbor
state is established,
Parameters
----------
* `tgen`: topogen object
* `topo`: input json file data
* `dut`: device under test
Usage
-----
# To veriry is BGP is converged for all the routers used in
topology
results = verify_bgp_convergence(tgen, topo, dut="r1")
Returns
-------
errormsg(str) or True
"""
result = False
logger.debug("Entering lib API: {}".format(sys._getframe().f_code.co_name))
tgen = get_topogen()
logger.debug("Entering lib API: verify_bgp_convergence()")
for router, rnode in tgen.routers().iteritems():
if "bgp" not in topo["routers"][router]:
continue
@ -1141,14 +1135,13 @@ def verify_bgp_convergence(tgen, topo, dut=None):
)
return errormsg
if "l2VpnEvpn" in show_bgp_json[vrf]:
l2VpnEvpn_data = show_bgp_json[vrf]["l2VpnEvpn"][
"peers"
]
nh_state = l2VpnEvpn_data[neighbor_ip]["state"]
l2VpnEvpn_data = show_bgp_json[vrf]["l2VpnEvpn"][
"peers"
]
nh_state = l2VpnEvpn_data[neighbor_ip]["state"]
if nh_state == "Established":
no_of_evpn_peer += 1
if nh_state == "Established":
no_of_evpn_peer += 1
if no_of_evpn_peer == total_evpn_peer:
logger.info(
@ -1156,7 +1149,6 @@ def verify_bgp_convergence(tgen, topo, dut=None):
router,
vrf,
)
result = True
else:
errormsg = (
"[DUT: %s] VRF: %s, BGP is not converged "
@ -1164,22 +1156,22 @@ def verify_bgp_convergence(tgen, topo, dut=None):
)
return errormsg
else:
total_peer = 0
for addr_type in bgp_addr_type.keys():
if not check_address_types(addr_type):
continue
total_peer = 0
bgp_neighbors = bgp_addr_type[addr_type]["unicast"]["neighbor"]
for bgp_neighbor in bgp_neighbors:
total_peer += len(bgp_neighbors[bgp_neighbor]["dest_link"])
no_of_peer = 0
for addr_type in bgp_addr_type.keys():
if not check_address_types(addr_type):
continue
bgp_neighbors = bgp_addr_type[addr_type]["unicast"]["neighbor"]
no_of_peer = 0
for bgp_neighbor, peer_data in bgp_neighbors.items():
for dest_link in peer_data["dest_link"].keys():
data = topo["routers"][bgp_neighbor]["links"]
@ -1190,11 +1182,8 @@ def verify_bgp_convergence(tgen, topo, dut=None):
"neighbor_type" in peer_details
and peer_details["neighbor_type"] == "link-local"
):
intf = topo["routers"][bgp_neighbor]["links"][
dest_link
]["interface"]
neighbor_ip = get_frr_ipv6_linklocal(
tgen, bgp_neighbor, intf
neighbor_ip = get_ipv6_linklocal_address(
topo["routers"], bgp_neighbor, dest_link
)
elif "source_link" in peer_details:
neighbor_ip = topo["routers"][bgp_neighbor][
@ -1214,7 +1203,7 @@ def verify_bgp_convergence(tgen, topo, dut=None):
0
]
nh_state = None
neighbor_ip = neighbor_ip.lower()
if addr_type == "ipv4":
ipv4_data = show_bgp_json[vrf]["ipv4Unicast"][
"peers"
@ -1224,8 +1213,7 @@ def verify_bgp_convergence(tgen, topo, dut=None):
ipv6_data = show_bgp_json[vrf]["ipv6Unicast"][
"peers"
]
if neighbor_ip in ipv6_data:
nh_state = ipv6_data[neighbor_ip]["state"]
nh_state = ipv6_data[neighbor_ip]["state"]
if nh_state == "Established":
no_of_peer += 1
@ -1238,9 +1226,8 @@ def verify_bgp_convergence(tgen, topo, dut=None):
(router, vrf, addr_type))
return errormsg
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
return result
logger.debug("Exiting API: verify_bgp_convergence()")
return True
@retry(attempts=3, wait=4, return_is_str=True)

View File

@ -2352,7 +2352,7 @@ def configure_brctl(tgen, topo, input_dict):
):
ip_cmd_list = []
cmd = "brctl addbr {}".format(brctl_name)
cmd = "ip link add name {} type bridge stp_state {}".format(brctl_name, stp)
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
@ -2360,19 +2360,13 @@ def configure_brctl(tgen, topo, input_dict):
ip_cmd_list.append("{} up dev {}".format(ip_cmd, brctl_name))
if vxlan:
cmd = "brctl addif {} {}".format(brctl_name, vxlan)
cmd = "{} dev {} master {}".format(ip_cmd, vxlan, brctl_name)
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
ip_cmd_list.append("{} up dev {}".format(ip_cmd, vxlan))
if stp:
cmd = "brctl stp {} {}".format(brctl_name, stp)
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
if vrf:
ip_cmd_list.append(
"{} dev {} master {}".format(ip_cmd, brctl_name, vrf)