summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-01-15 17:11:49 +0100
committerGitHub <noreply@github.com>2025-01-15 17:11:49 +0100
commit0bc373c573344c8ce847a82615416c6a7178761e (patch)
tree81a395f454e475c4e67a7ffeb64840735586d865
parentMerge pull request #17810 from donaldsharp/bgp_connect_refactor (diff)
parenttopotests: improve test reliability (diff)
downloadfrr-0bc373c573344c8ce847a82615416c6a7178761e.tar.xz
frr-0bc373c573344c8ce847a82615416c6a7178761e.zip
Merge pull request #17838 from opensourcerouting/msdp-topo3
topotests: improve test reliability
-rw-r--r--tests/topotests/msdp_topo3/r1/frr.conf1
-rw-r--r--tests/topotests/msdp_topo3/r2/frr.conf1
-rw-r--r--tests/topotests/msdp_topo3/test_msdp_topo3.py29
3 files changed, 28 insertions, 3 deletions
diff --git a/tests/topotests/msdp_topo3/r1/frr.conf b/tests/topotests/msdp_topo3/r1/frr.conf
index d5b10bf8a..161f0008d 100644
--- a/tests/topotests/msdp_topo3/r1/frr.conf
+++ b/tests/topotests/msdp_topo3/r1/frr.conf
@@ -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
diff --git a/tests/topotests/msdp_topo3/r2/frr.conf b/tests/topotests/msdp_topo3/r2/frr.conf
index 245c06187..b7a20d4b7 100644
--- a/tests/topotests/msdp_topo3/r2/frr.conf
+++ b/tests/topotests/msdp_topo3/r2/frr.conf
@@ -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
diff --git a/tests/topotests/msdp_topo3/test_msdp_topo3.py b/tests/topotests/msdp_topo3/test_msdp_topo3.py
index 9393ae7ff..4e3b18f7c 100644
--- a/tests/topotests/msdp_topo3/test_msdp_topo3.py
+++ b/tests/topotests/msdp_topo3/test_msdp_topo3.py
@@ -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():