From 1a2b340892dba73444d121c1fabcbed8305c25e2 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Thu, 8 Jun 2023 14:34:22 +0200 Subject: [PATCH] topotests: check r2 vpn table in bgp_vpnv4_noretain Remove no retain in r2 and check that r2 VPN table remains the same after r1 configuration changes. Signed-off-by: Louis Scalbert --- .../topotests/bgp_vpnv4_noretain/r2/bgpd.conf | 5 +- .../r2/ipv4_vpn_routes_all.json | 94 +++++++++++++++++++ .../test_bgp_vpnv4_noretain.py | 2 + 3 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_routes_all.json diff --git a/tests/topotests/bgp_vpnv4_noretain/r2/bgpd.conf b/tests/topotests/bgp_vpnv4_noretain/r2/bgpd.conf index 13de0e520f..1ffbfe8b69 100644 --- a/tests/topotests/bgp_vpnv4_noretain/r2/bgpd.conf +++ b/tests/topotests/bgp_vpnv4_noretain/r2/bgpd.conf @@ -6,7 +6,6 @@ router bgp 65500 exit-address-family address-family ipv4 vpn neighbor 10.125.0.1 activate - no bgp retain route-target all exit-address-family ! router bgp 65500 vrf vrf1 @@ -27,8 +26,8 @@ router bgp 65500 vrf vrf2 redistribute connected label vpn export 202 rd vpn export 192.0.2.2:2 - rt vpn both 192.0.2.1:100 192.0.2.2:100 192.0.2.2:200 - rt vpn both 192.0.2.2:200 + rt vpn import 192.0.2.1:100 192.0.2.2:100 192.0.2.2:200 + rt vpn export 192.0.2.2:200 export vpn import vpn exit-address-family diff --git a/tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_routes_all.json b/tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_routes_all.json new file mode 100644 index 0000000000..79304a5e55 --- /dev/null +++ b/tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_routes_all.json @@ -0,0 +1,94 @@ +{ + "vrfId": 0, + "vrfName": "default", + "routerId":"192.0.2.2", + "defaultLocPrf": 100, + "localAS": 65500, + "routes": { + "routeDistinguishers": { + "192.0.2.1:1": { + "10.101.0.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "internal", + "prefix": "10.101.0.0", + "prefixLen": 24, + "network": "10.101.0.0/24", + "metric": 0, + "locPrf": 100, + "weight": 0, + "peerId": "10.125.0.1", + "path": "", + "origin": "incomplete", + "nexthops": [ + { + "ip": "10.125.0.1", + "hostname": "r1", + "afi": "ipv4", + "used": true + } + ] + } + ] + }, + "192.0.2.2:1": { + "10.201.0.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "network": "10.201.0.0/24", + "prefixLen": 24, + "prefix": "10.201.0.0", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "announceNexthopSelf": true, + "nhVrfName": "vrf1", + "nexthops": [ + { + "ip": "0.0.0.0", + "hostname": "r2", + "afi": "ipv4", + "used": true + } + ] + } + ] + }, + "192.0.2.2:2": { + "10.202.0.0/24": [ + { + "valid": true, + "bestpath": true, + "selectionReason": "First path received", + "pathFrom": "external", + "network": "10.202.0.0/24", + "prefixLen": 24, + "prefix": "10.202.0.0", + "metric": 0, + "weight": 32768, + "peerId": "(unspec)", + "path": "", + "origin": "incomplete", + "announceNexthopSelf": true, + "nhVrfName": "vrf2", + "nexthops": [ + { + "ip": "0.0.0.0", + "hostname": "r2", + "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 9d48daa588..994582fc62 100644 --- a/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py +++ b/tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py @@ -176,6 +176,7 @@ def test_bgp_no_retain_step1(): rname = "r1" check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_no_retain_init.json") + check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json") def test_bgp_retain_step2(): @@ -198,6 +199,7 @@ router bgp 65500 router.vtysh_cmd(cfg) check_show_bgp_ipv4_vpn(rname, "ipv4_vpn_routes_all.json") + check_show_bgp_ipv4_vpn("r2", "ipv4_vpn_routes_all.json") def test_memory_leak(): -- 2.39.5