]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: test PIM BFD profile integration
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 13 Apr 2021 14:33:39 +0000 (11:33 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 23 Apr 2021 12:29:00 +0000 (09:29 -0300)
Test that PIM BFD profile integration works.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/pim-basic-topo2/r1/bfdd.conf
tests/topotests/pim-basic-topo2/r1/pimd.conf
tests/topotests/pim-basic-topo2/test_pim_basic_topo2.py

index ca61e467dc6687ff850db56b39411b7ab61dcda0..76c6f8219038987eb6aa9c4cb43cd36fc326f6aa 100644 (file)
@@ -1,2 +1,6 @@
 bfd
+ profile fast-tx
+  receive-interval 250
+  transmit-interval 250
+ !
 !
index ff28648dfa635ab1efe9ff39412139307395757f..b895d7d57363f84e48c4ebdd0a342e233a312e80 100644 (file)
@@ -1,4 +1,4 @@
 interface r1-eth0
  ip pim
- ip pim bfd
+ ip pim bfd profile fast-tx
 !
index a03747fa09719a5f563412c7771db03a73651c34..883125cfc74f5171d53c34ead36a667e2f020fd3 100644 (file)
@@ -45,7 +45,7 @@ from lib.topolog import logger
 # Required to instantiate the topology builder class.
 from mininet.topo import Topo
 
-pytestmark = [pytest.mark.bfdd, pytest.mark.bgpd, pytest.mark.isisd, pytest.mark.ospfd]
+pytestmark = [pytest.mark.bfdd, pytest.mark.pimd]
 
 
 class PimBasicTopo2(Topo):
@@ -192,6 +192,38 @@ def test_pim_reconvergence():
     expect_neighbor("r2", "r2-eth2", "192.168.3.4")
 
 
+def test_pim_bfd_profile():
+    "Test that the BFD profile is properly applied in BFD."
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    def expect_bfd_peer_settings(router, settings):
+        "Expect the following BFD configuration"
+        logger.info("Verifying BFD peer {} in {}".format(settings["peer"], router))
+        test_func = partial(
+            topotest.router_json_cmp,
+            tgen.gears[router],
+            "show bfd peers json",
+            [settings]
+        )
+        _, result = topotest.run_and_expect(test_func, None, count=4, wait=1)
+        assertmsg = '"{}" BFD convergence failure'.format(router)
+        assert result is None, assertmsg
+
+    expect_bfd_peer_settings("r1", {
+        "peer": "192.168.1.2",
+        "receive-interval": 250,
+        "transmit-interval": 250,
+    })
+
+    expect_bfd_peer_settings("r2", {
+        "peer": "192.168.1.1",
+        "remote-receive-interval": 250,
+        "remote-transmit-interval": 250,
+    })
+
+
 def test_memory_leak():
     "Run the memory leak test and report results."
     tgen = get_topogen()