summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_vpnv4_noretain
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2023-09-12 13:30:57 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2023-09-12 15:18:02 +0200
commit7acdaff7e2d9d51c5475e04a71d23f14bfd1d532 (patch)
tree8d9205b93759d009ad6feec9ca67852e6cabb471 /tests/topotests/bgp_vpnv4_noretain
parent142c029725a00dafb30f6eef31439ee389d27ff9 (diff)
topotests: check route import in bgp_vpnv4_noretain
Check route import in bgp_vpnv4_noretain Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'tests/topotests/bgp_vpnv4_noretain')
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_init.json156
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r1_vrf1.json190
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf2.json188
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf3.json188
-rw-r--r--tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py93
5 files changed, 806 insertions, 9 deletions
diff --git a/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_init.json b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_init.json
new file mode 100644
index 0000000000..2769c6eb3f
--- /dev/null
+++ b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_init.json
@@ -0,0 +1,156 @@
+{
+ "default": {
+ "vrfName": "default",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.204.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.204.0.0",
+ "prefixLen": 24,
+ "network": "10.204.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf1": {
+ "vrfName": "vrf1",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.101.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.101.0.0",
+ "prefixLen": 24,
+ "network": "10.101.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ],
+ "10.201.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.201.0.0",
+ "prefixLen": 24,
+ "network": "10.201.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf3": {
+ "vrfName": "vrf3",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf4": {
+ "vrfName": "vrf4",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "vrf3",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r1_vrf1.json b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r1_vrf1.json
new file mode 100644
index 0000000000..488dc4aab9
--- /dev/null
+++ b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r1_vrf1.json
@@ -0,0 +1,190 @@
+{
+ "default": {
+ "vrfName": "default",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.204.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.204.0.0",
+ "prefixLen": 24,
+ "network": "10.204.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf1": {
+ "vrfName": "vrf1",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.101.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.101.0.0",
+ "prefixLen": 24,
+ "network": "10.101.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ],
+ "10.201.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.201.0.0",
+ "prefixLen": 24,
+ "network": "10.201.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf3": {
+ "vrfName": "vrf3",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf4": {
+ "vrfName": "vrf4",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "vrf3",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf2": {
+ "vrfName": "vrf2",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.101.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.101.0.0",
+ "prefixLen": 24,
+ "network": "10.101.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "vrf1",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf2.json b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf2.json
new file mode 100644
index 0000000000..b751756fce
--- /dev/null
+++ b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf2.json
@@ -0,0 +1,188 @@
+{
+ "default": {
+ "vrfName": "default",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.204.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.204.0.0",
+ "prefixLen": 24,
+ "network": "10.204.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf1": {
+ "vrfName": "vrf1",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.101.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.101.0.0",
+ "prefixLen": 24,
+ "network": "10.101.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ],
+ "10.201.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.201.0.0",
+ "prefixLen": 24,
+ "network": "10.201.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf3": {
+ "vrfName": "vrf3",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf4": {
+ "vrfName": "vrf4",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "vrf3",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf2": {
+ "vrfName": "vrf2",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.202.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.202.0.0",
+ "prefixLen": 24,
+ "network": "10.202.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf3.json b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf3.json
new file mode 100644
index 0000000000..49d4066e19
--- /dev/null
+++ b/tests/topotests/bgp_vpnv4_noretain/r1/ipv4_vrf_all_routes_plus_r2_vrf3.json
@@ -0,0 +1,188 @@
+{
+ "default": {
+ "vrfName": "default",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.204.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.204.0.0",
+ "prefixLen": 24,
+ "network": "10.204.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf1": {
+ "vrfName": "vrf1",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.101.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.101.0.0",
+ "prefixLen": 24,
+ "network": "10.101.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ],
+ "10.201.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.201.0.0",
+ "prefixLen": 24,
+ "network": "10.201.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf3": {
+ "vrfName": "vrf3",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf4": {
+ "vrfName": "vrf4",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.103.0.0/24": [
+ {
+ "valid": true,
+ "bestpath": true,
+ "selectionReason": "First path received",
+ "pathFrom": "external",
+ "prefix": "10.103.0.0",
+ "prefixLen": 24,
+ "network": "10.103.0.0/24",
+ "metric": 0,
+ "weight": 32768,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "vrf3",
+ "nexthops": [
+ {
+ "ip": "0.0.0.0",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "vrf2": {
+ "vrfName": "vrf2",
+ "routerId": "192.0.2.1",
+ "defaultLocPrf": 100,
+ "localAS": 65500,
+ "routes": {
+ "10.203.0.0/24": [
+ {
+ "pathFrom": "external",
+ "prefix": "10.203.0.0",
+ "prefixLen": 24,
+ "network": "10.203.0.0/24",
+ "metric": 0,
+ "locPrf": 100,
+ "weight": 0,
+ "peerId": "(unspec)",
+ "path": "",
+ "origin": "incomplete",
+ "announceNexthopSelf": true,
+ "nhVrfName": "default",
+ "nexthops": [
+ {
+ "ip": "10.125.0.2",
+ "hostname": "r1",
+ "afi": "ipv4",
+ "used": true
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py b/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
index 5a809987ff..037dd40390 100644
--- a/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
+++ b/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py
@@ -157,6 +157,36 @@ def router_json_cmp_exact_filter(router, cmd, expected):
return topotest.json_cmp(json_output, expected, exact=True)
+def router_vrf_json_cmp_exact_filter(router, cmd, expected):
+ output = router.vtysh_cmd(cmd)
+ logger.info("{}: {}\n{}".format(router.name, cmd, output))
+
+ json_output = json.loads(output)
+
+ # filter out tableVersion, version, nhVrfId and vrfId
+ for vrf, data in json_output.items():
+ if "vrfId" in data:
+ data.pop("vrfId")
+ if "tableVersion" in data:
+ data.pop("tableVersion")
+ if "routes" not in data:
+ continue
+ for route, attrs in data["routes"].items():
+ for attr in attrs:
+ if "nhVrfId" in attr:
+ attr.pop("nhVrfId")
+ if "version" in attr:
+ attr.pop("version")
+
+ # filter out VRF with no routes
+ json_tmp = deepcopy(json_output)
+ for vrf, data in json_tmp.items():
+ if "routes" not in data or len(data["routes"].keys()) == 0:
+ json_output.pop(vrf)
+
+ return topotest.json_cmp(json_output, expected, exact=True)
+
+
def check_show_bgp_ipv4_vpn(rname, json_file):
tgen = get_topogen()
if tgen.routers_have_failure():
@@ -178,6 +208,27 @@ def check_show_bgp_ipv4_vpn(rname, json_file):
assert result is None, assertmsg
+def check_show_bgp_vrf_ipv4(rname, json_file):
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+ router = tgen.gears[rname]
+
+ logger.info("Checking VRF IPv4 routes for convergence on {}".format(rname))
+
+ json_file = "{}/{}/{}".format(CWD, router.name, json_file)
+ expected = json.loads(open(json_file).read())
+ test_func = partial(
+ router_vrf_json_cmp_exact_filter,
+ router,
+ "show bgp vrf all ipv4 unicast json",
+ expected,
+ )
+ _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ assertmsg = '"{}" JSON output mismatches'.format(router.name)
+ assert result is None, assertmsg
+
+
def test_protocols_convergence_step0():
"""
Assert that all protocols have converged
@@ -211,6 +262,8 @@ def test_bgp_no_retain_step1():
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_retain_step2():
"""
@@ -234,6 +287,8 @@ router bgp 65500
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_all.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_no_retain_step3():
"""
@@ -253,10 +308,12 @@ def test_bgp_no_retain_step3():
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_no_retain_add_vrf2_step4():
"""
- Add vrf2 on r1 and check bgp vpnv4 table
+ Add vrf2 on r1 and check bgp tables
"""
rname = "r1"
@@ -283,10 +340,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init_plus_r2_vrf2.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_plus_r2_vrf2.json")
+
def test_bgp_no_retain_unimport_vrf2_step5():
"""
- Unimport to vrf2 on r1 and check bgp vpnv4 table
+ Unimport to vrf2 on r1 and check bgp tables
"""
rname = "r1"
@@ -308,10 +367,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_no_retain_import_vrf2_step6():
"""
- Re-import to vrf2 on r1 and check bgp vpnv4 table
+ Re-import to vrf2 on r1 and check bgp tables
"""
rname = "r1"
@@ -333,10 +394,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init_plus_r2_vrf2.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_plus_r2_vrf2.json")
+
def test_bgp_no_retain_import_vrf1_step7():
"""
- Import r1 vrf1 into r1 vrf2 and check bgp vpnv4 table
+ Import r1 vrf1 into r1 vrf2 and check bgp tables
"""
rname = "r1"
@@ -358,10 +421,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_plus_r1_vrf1.json")
+
def test_bgp_no_retain_import_vrf3_step8():
"""
- Import r2 vrf3 into r1 vrf2 and check bgp vpnv4 table
+ Import r2 vrf3 into r1 vrf2 and check bgp tables
"""
rname = "r1"
@@ -383,10 +448,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init_plus_r2_vrf3.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_plus_r2_vrf3.json")
+
def test_bgp_no_retain_unimport_vrf3_step9():
"""
- Un-import r2 vrf3 into r1 vrf2 and check bgp vpnv4 table
+ Un-import r2 vrf3 into r1 vrf2 and check bgp tables
"""
rname = "r1"
@@ -408,10 +475,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_no_retain_import_vrf3_step10():
"""
- Import r2 vrf3 into r1 vrf2 and check bgp vpnv4 table
+ Import r2 vrf3 into r1 vrf2 and check bgp tables
"""
rname = "r1"
@@ -433,10 +502,12 @@ router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init_plus_r2_vrf3.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_plus_r2_vrf3.json")
+
def test_bgp_no_retain_remove_vrf2_step11():
"""
- Remove BGP vrf2 on r1 and check bgp vpnv4 table
+ Remove BGP vrf2 on r1 and check bgp tables
"""
rname = "r1"
@@ -454,10 +525,12 @@ no router bgp 65500 vrf vrf2
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_bgp_retain_step12():
"""
- Configure retain and check bgp vpnv4 table
+ Configure retain and check bgp tables
"""
rname = "r1"
@@ -477,6 +550,8 @@ router bgp 65500
check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_all.json")
check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json")
+ check_show_bgp_vrf_ipv4(rname, "ipv4_vrf_all_routes_init.json")
+
def test_memory_leak():
"Run the memory leak test and report results."