]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: check r2 vpn table in bgp_vpnv4_noretain
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 8 Jun 2023 12:34:22 +0000 (14:34 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 16 Jun 2023 12:18:25 +0000 (14:18 +0200)
Remove no retain in r2 and check that r2 VPN table remains the same
after r1 configuration changes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/bgp_vpnv4_noretain/r2/bgpd.conf
tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_routes_all.json [new file with mode: 0644]
tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py

index 13de0e520f249df1aa1f78ac563027f4b01ca017..1ffbfe8b698383e8f7e04c032b8ad6bf24db8ad5 100644 (file)
@@ -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 (file)
index 0000000..79304a5
--- /dev/null
@@ -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
+              }
+            ]
+          }
+        ]
+      }
+    }
+  }
+}
index 9d48daa5887654e2fb4bb86127bfeda7eff19ff7..994582fc6290361d4a3b445bf301908a8ef1bec6 100644 (file)
@@ -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():