tests : bgp-default-originate in vrf scenerio

testcase in this script covers the default originate behavious in VRFs

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
This commit is contained in:
ARShreenidhi 2022-06-22 12:47:13 +00:00
parent f21ba4fbae
commit 034c15b946
3 changed files with 1720 additions and 3 deletions

View File

@ -0,0 +1,325 @@
{
"address_types": [
"ipv4",
"ipv6"
],
"ipv4base": "192.168.0.0",
"ipv4mask": 3024,
"ipv6base": "fd00::",
"ipv6mask": 64,
"link_ip_start": {
"ipv4": "192.168.0.0",
"v4mask": 24,
"ipv6": "fd00::",
"v6mask": 64
},
"lo_prefix": {
"ipv4": "1.0.",
"v4mask": 32,
"ipv6": "2001:db8:f::",
"v6mask": 128
},
"routers": {
"r0": {
"links": {
"lo": {
"ipv4": "auto",
"ipv6": "auto",
"type": "loopback"
},
"r1": {
"ipv4": "auto",
"ipv6": "auto"
}
},
"bgp": {
"local_as": "100",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"r0": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"r0": {}
}
}
}
}
}
}
}
},
"r1": {
"links": {
"lo": {
"ipv4": "auto",
"ipv6": "auto",
"type": "loopback"
},
"r0": {
"ipv4": "auto",
"ipv6": "auto"
},
"r2": {
"ipv4": "auto",
"ipv6": "auto"
}
},
"bgp": [
{
"local_as": "1000",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r0": {
"dest_link": {
"r1": {}
}
},
"r2": {
"dest_link": {
"r1": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r0": {
"dest_link": {
"r1": {}
}
},
"r2": {
"dest_link": {
"r1": {}
}
}
}
}
}
}
}
]
},
"r2": {
"links": {
"lo": {
"ipv4": "auto",
"ipv6": "auto",
"type": "loopback"
},
"r1": {
"ipv4": "auto",
"ipv6": "auto"
},
"r3": {
"ipv4": "auto",
"ipv6": "auto",
"vrf": "RED"
}
},
"vrfs": [
{
"name": "RED",
"id": "1"
}
],
"bgp": [
{
"local_as": "2000",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"r2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"r2": {}
}
}
}
}
}
}
},
{
"local_as": "1000",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"r2": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r1": {
"dest_link": {
"r2": {}
}
}
}
}
}
}
}
]
},
"r3": {
"links": {
"lo": {
"ipv4": "auto",
"ipv6": "auto",
"type": "loopback",
"vrf": "RED"
},
"r2": {
"ipv4": "auto",
"ipv6": "auto",
"vrf": "RED"
},
"r4": {
"ipv4": "auto",
"ipv6": "auto"
}
},
"vrfs": [
{
"name": "RED",
"id": "1"
}
],
"bgp": [
{
"local_as": "3000",
"vrf": "RED",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"r3": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r2": {
"dest_link": {
"r3": {}
}
}
}
}
}
}
},
{
"local_as": "400",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"r3": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r4": {
"dest_link": {
"r3": {}
}
}
}
}
}
}
}
]
},
"r4": {
"links": {
"lo": {
"ipv4": "auto",
"ipv6": "auto",
"type": "loopback"
},
"r3": {
"ipv4": "auto",
"ipv6": "auto"
}
},
"bgp": [
{
"local_as": "500",
"address_family": {
"ipv4": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"r4": {}
}
}
}
}
},
"ipv6": {
"unicast": {
"neighbor": {
"r3": {
"dest_link": {
"r4": {}
}
}
}
}
}
}
}
]
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1630,9 +1630,14 @@ def modify_as_number(tgen, topo, input_dict):
# Remove bgp configuration
router_dict.update({router: {"bgp": {"delete": True}}})
new_topo[router]["bgp"]["local_as"] = input_dict[router]["bgp"]["local_as"]
try:
new_topo[router]["bgp"]["local_as"] = input_dict[router]["bgp"][
"local_as"
]
except TypeError:
new_topo[router]["bgp"][0]["local_as"] = input_dict[router]["bgp"][
"local_as"
]
logger.info("Removing bgp configuration")
create_router_bgp(tgen, topo, router_dict)