]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Add a noprefixroute test 14961/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 6 Dec 2023 14:27:09 +0000 (09:27 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 7 Dec 2023 13:25:50 +0000 (13:25 +0000)
Add a simple test case to ensure that the noprefixroute
code stays working in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0d5c5472c96c91516ae99c87c7a711237f6b45b2)

tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py

index 529520cd9e817a8eaca03d6dd21131786221910d..0b2937c12a283eacf519867f6529c7a6917065ce 100644 (file)
@@ -144,6 +144,23 @@ def test_zebra_system_recursion():
     assert result is None, "Kernel route is missing from zebra"
 
 
+def test_zebra_noprefix_connected():
+    "Test that a noprefixroute created does not create a connected route"
+
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    router = tgen.gears["r1"]
+    router.run("ip addr add 192.168.44.1/24 dev r1-eth1 noprefixroute")
+    expected = "% Network not in table"
+    test_func = partial(
+        topotest.router_output_cmp, router, "show ip route 192.168.44.0/24", expected
+    )
+    result, diff = topotest.run_and_expect(test_func, "", count=20, wait=1)
+    assert result, "Connected Route should not have been added"
+
+
 if __name__ == "__main__":
     args = ["-s"] + sys.argv[1:]
     sys.exit(pytest.main(args))