Skip to content

Commit

Permalink
topotests: test MSDP shutdown command
Browse files Browse the repository at this point in the history
New test step to check that MSDP shutdown command is working.

Signed-off-by: Rafael Zalamena <[email protected]>
  • Loading branch information
rzalamena committed Nov 25, 2024
1 parent 4aa6ae2 commit 4793f93
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/topotests/msdp_topo1/test_msdp_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4793f93

Please sign in to comment.