]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: zebra_rib, test vrf change
authorLouis Scalbert <louis.scalbert@6wind.com>
Mon, 23 Sep 2024 15:57:49 +0000 (17:57 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 10 Mar 2025 08:54:18 +0000 (09:54 +0100)
Test table ID move to a VRF and the removal of the VRF.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json
tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt
tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json
tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt
tests/topotests/zebra_rib/test_zebra_rib.py

index 5190dc469ce144d9f4a3c1861651035a13129815..70398d80b1a1afc0a37e54d54aa602bbab3f0fba 100644 (file)
       ]
     }
   ],
+  "10.0.0.0/24": [
+    {
+      "protocol": "static",
+      "vrfName": "default",
+      "installed": true,
+      "table": 1,
+      "nexthops": [
+        {
+          "fib": true,
+          "unreachable": true,
+          "blackhole": true,
+          "active": true
+        }
+      ]
+    }
+  ],
+  "10.1.0.0/24": [
+    {
+      "protocol": "static",
+      "vrfName": "default",
+      "installed": true,
+      "table": 1,
+      "nexthops": [
+        {
+          "fib": true,
+          "ip": "192.168.211.254",
+          "interfaceName": "r1-eth1",
+          "active": true
+        }
+      ]
+    }
+  ],
   "10.2.0.0/24": null,
   "10.3.0.0/24": null,
   "192.168.210.0/24": null,
index 0664cab2d8322cb4c0eed95d74e1019c0b0b8d1c..f0fcb73d4d68a37404c2a3323f9323bc5330ea3d 100644 (file)
@@ -1 +1,3 @@
 blackhole default
+blackhole 10.0.0.0/24 proto XXXX metric 20
+10.1.0.0/24 via 192.168.211.254 dev r1-eth1 proto XXXX metric 20
index f1dad10ab2bb6673dfa8484aecdbfc9d79039350..5949a69a73532d8d618db012ba54bcb363df3d4a 100644 (file)
       ]
     }
   ],
+  "10.0.0.0/24": [
+    {
+      "protocol": "static",
+      "vrfName": "RED",
+      "installed": true,
+      "table": 1,
+      "nexthops": [
+        {
+          "fib": true,
+          "unreachable": true,
+          "blackhole": true,
+          "active": true
+        }
+      ]
+    }
+  ],
+  "10.1.0.0/24": [
+    {
+      "protocol": "static",
+      "vrfName": "RED",
+      "installed": true,
+      "table": 1,
+      "nexthops": [
+        {
+          "fib": true,
+          "ip": "192.168.211.254",
+          "interfaceName": "r1-eth1",
+          "vrf": "default",
+          "active": true
+        }
+      ]
+    }
+  ],
   "10.2.0.0/24": [
     {
       "protocol": "static",
index 2053fa2bbeb63d728439db5115145fe621a6d5a6..fb3d0346894d61b5e00e42ecbb762c6bc9ca51ad 100644 (file)
@@ -1,4 +1,6 @@
 blackhole default
+blackhole 10.0.0.0/24 proto XXXX metric 20
+10.1.0.0/24 via 192.168.211.254 dev r1-eth1 proto XXXX metric 20
 10.2.0.0/24 via 192.168.210.254 dev r1-eth0 proto XXXX metric 20
 10.3.0.0/24 via 192.168.212.254 dev r1-eth2 proto XXXX metric 20
 192.168.210.0/24 dev r1-eth0 proto XXXX scope link src 192.168.210.1 
index 810a46bd8b3c020bf618fe21730f25475f07abc4..6dc316752abd2aa583b550ca65f0e6192cc83175 100644 (file)
@@ -139,6 +139,16 @@ def test_zebra_kernel_route_vrf():
     step("Add routes in table 1")
     r1.run("ip route add blackhole default table {}".format(table_id))
 
+    r1.vtysh_cmd(
+        """
+configure terminal
+ ip route 10.0.0.0/24 blackhole table {}
+ ip route 10.1.0.0/24 192.168.211.254 nexthop-vrf default table {}
+""".format(
+            table_id, table_id
+        )
+    )
+
     json_file = "{}/r1/v4_route_table_1_no_vrf.json".format(CWD)
     expected = json.loads(open(json_file).read())
     test_func = partial(