]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: improve test reliability 17838/head
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 10 Jan 2025 13:17:35 +0000 (10:17 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 13 Jan 2025 12:26:17 +0000 (09:26 -0300)
Decrease the protocol timers, wait for peers to connect (and test it)
then finally wait a bit more for SAs to be propagated.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/msdp_topo3/r1/frr.conf
tests/topotests/msdp_topo3/r2/frr.conf
tests/topotests/msdp_topo3/test_msdp_topo3.py

index d5b10bf8a15b3a758e264eb0b0d4e9c885b20a5e..161f0008d3e3b4ad41dc846dcdcb682b22d8ba9e 100644 (file)
@@ -27,5 +27,6 @@ router pim
  msdp originator-id 10.254.254.1
  msdp log sa-events
  msdp peer 192.168.1.2 source 192.168.1.1
+ msdp timers 10 20 3
  rp 192.168.1.1
 !
\ No newline at end of file
index 245c061874047c5b4647ddca8e6fef0aa1dda8be..b7a20d4b71d542faa87603e755f41bc8f9864b0d 100644 (file)
@@ -24,5 +24,6 @@ router bgp 65200
 router pim
  msdp log sa-events
  msdp peer 192.168.1.1 source 192.168.1.2
+ msdp timers 10 20 3
  rp 192.168.1.2
 !
\ No newline at end of file
index 9393ae7ffdde53fce983b0522440818782409eef..4e3b18f7c670d770cfb3bda6c500e54fa23b9efe 100644 (file)
@@ -121,6 +121,29 @@ def test_bgp_convergence():
     expect_loopback_route("r2", "ip", "10.254.254.1/32", "bgp")
 
 
+def test_msdp_connect():
+    "Test that the MSDP peers have connected."
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    def msdp_is_connected(router, peer):
+        logger.info(f"waiting MSDP peer {peer} in router {router}")
+        expected = {peer: {"state": "established"}}
+        test_func = partial(
+            topotest.router_json_cmp,
+            tgen.gears[router],
+            "show ip msdp peer json",
+            expected,
+        )
+        _, result = topotest.run_and_expect(test_func, None, count=40, wait=2)
+        assertmsg = '"{}" convergence failure'.format(router)
+        assert result is None, assertmsg
+
+    msdp_is_connected("r1", "192.168.1.2")
+    msdp_is_connected("r2", "192.168.1.1")
+
+
 def test_sa_learn():
     """
     Test that the learned SA uses the configured originator ID instead
@@ -145,10 +168,10 @@ def test_sa_learn():
                     "local": "no",
                 }
             }
-        }
+        },
     )
-    _, result = topotest.run_and_expect(test_func, None, count=100, wait=1)
-    assert result is None, 'r2 SA convergence failure'
+    _, result = topotest.run_and_expect(test_func, None, count=80, wait=2)
+    assert result is None, "r2 SA convergence failure"
 
 
 def test_memory_leak():