summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-09-23 17:57:49 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2025-03-10 09:54:18 +0100
commitc50fe2104567358fd6ce5d9cbec624fa0490c1af (patch)
tree734b21fcadbba23065edf6e91a91a99ef424562f /tests
parentc6afe42455307f04e789c228df22a48ddc43e3b8 (diff)
tests: zebra_rib, test vrf change
Test table ID move to a VRF and the removal of the VRF. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json32
-rw-r--r--tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt2
-rw-r--r--tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json33
-rw-r--r--tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt2
-rw-r--r--tests/topotests/zebra_rib/test_zebra_rib.py10
5 files changed, 79 insertions, 0 deletions
diff --git a/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json b/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json
index 5190dc469c..70398d80b1 100644
--- a/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json
+++ b/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.json
@@ -15,6 +15,38 @@
]
}
],
+ "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,
diff --git a/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt b/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt
index 0664cab2d8..f0fcb73d4d 100644
--- a/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt
+++ b/tests/topotests/zebra_rib/r1/v4_route_table_1_no_vrf.txt
@@ -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
diff --git a/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json b/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json
index f1dad10ab2..5949a69a73 100644
--- a/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json
+++ b/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.json
@@ -15,6 +15,39 @@
]
}
],
+ "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",
diff --git a/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt b/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt
index 2053fa2bbe..fb3d034689 100644
--- a/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt
+++ b/tests/topotests/zebra_rib/r1/v4_route_table_1_vrf_red.txt
@@ -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
diff --git a/tests/topotests/zebra_rib/test_zebra_rib.py b/tests/topotests/zebra_rib/test_zebra_rib.py
index 810a46bd8b..6dc316752a 100644
--- a/tests/topotests/zebra_rib/test_zebra_rib.py
+++ b/tests/topotests/zebra_rib/test_zebra_rib.py
@@ -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(