]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: test wrong bfd source in bfd_topo3
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 30 Nov 2023 15:07:40 +0000 (16:07 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 6 Dec 2023 13:06:16 +0000 (13:06 +0000)
Test setting a wrong bfd source and restore the source auto parameter.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 94640da23492df86a45c1a919bc64f809cd2a1ec)

tests/topotests/bfd_topo3/test_bfd_topo3.py

index f6985f25c483078147e37a257ec9f01dc20debe5..f767b0e7b99b18600d72e7ec934d8d1da7f2361f 100644 (file)
@@ -213,6 +213,45 @@ def test_static_route_monitoring_convergence():
     expect_static_bfd_output("r6", "bfd-static")
 
 
+def test_static_route_monitoring_wrong_source():
+    "Test that static monitoring fails if setting a wrong source."
+
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    logger.info("test route wrong ")
+
+    tgen.gears["r3"].vtysh_cmd(
+        """
+configure
+ipv6 route 2001:db8:5::/64 2001:db8:4::3 bfd multi-hop source 2001:db8:4::2 profile slow-tx
+"""
+    )
+
+    expect_route_missing("r3", "ipv6", "2001:db8:5::/64")
+
+
+def test_static_route_monitoring_unset_source():
+    "Test that static monitoring fails if setting a wrong source."
+
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    logger.info("test route wrong ")
+
+    tgen.gears["r3"].vtysh_cmd(
+        """
+configure
+ipv6 route 2001:db8:5::/64 2001:db8:4::3 bfd multi-hop profile slow-tx
+"""
+    )
+
+    expect_static_bfd_output("r3", "bfd-static")
+    expect_static_bfd_output("r6", "bfd-static")
+
+
 def test_expect_static_rib_removal():
     "Test that route got removed from RIB (staticd and bgpd)."