From 4793f93017ffb695569d704ec692cd972387d9f3 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Mon, 25 Nov 2024 11:32:46 -0300 Subject: [PATCH] topotests: test MSDP shutdown command New test step to check that MSDP shutdown command is working. Signed-off-by: Rafael Zalamena --- tests/topotests/msdp_topo1/test_msdp_topo1.py | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/topotests/msdp_topo1/test_msdp_topo1.py b/tests/topotests/msdp_topo1/test_msdp_topo1.py index 1c97f7cb1e47..693b943759b7 100755 --- a/tests/topotests/msdp_topo1/test_msdp_topo1.py +++ b/tests/topotests/msdp_topo1/test_msdp_topo1.py @@ -530,6 +530,53 @@ def test_msdp_log_events(): assert match is not None +def test_msdp_shutdown(): + "Shutdown MSDP sessions between r1, r2, r3, then check the state." + + tgen = get_topogen() + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + tgen.gears['r1'].vtysh_cmd(""" + configure terminal + router pim + msdp shutdown + """) + + r1_expect = { + "192.168.0.2": { + "state": "inactive", + }, + "192.168.1.2": { + "state": "inactive", + } + } + r2_expect = { + "192.168.0.1": { + "state": "listen", + } + } + r3_expect = { + "192.168.1.1": { + "state": "listen", + } + } + for router in [ + ("r1", r1_expect), + ("r2", r2_expect), + ("r3", r3_expect) + ]: + test_func = partial( + topotest.router_json_cmp, + tgen.gears[router[0]], + "show ip msdp peer json", + router[1], + ) + logger.info("Waiting for {} msdp peer data".format(router[0])) + _, val = topotest.run_and_expect(test_func, None, count=30, wait=1) + assert val is None, "multicast route convergence failure" + + def test_memory_leak(): "Run the memory leak test and report results." tgen = get_topogen()