From 0b0648f15c0ced171dc29961ea374f11dd6a66cc Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Thu, 21 Nov 2024 10:23:37 -0300 Subject: [PATCH] topotests: test new log toggle Test MSDP new log toggle: the MSDP peer connection state and SA events should be logged. Signed-off-by: Rafael Zalamena --- tests/topotests/msdp_topo1/r1/pimd.conf | 2 ++ tests/topotests/msdp_topo1/test_msdp_topo1.py | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/topotests/msdp_topo1/r1/pimd.conf b/tests/topotests/msdp_topo1/r1/pimd.conf index 3c116a003bea..1548aed05e18 100644 --- a/tests/topotests/msdp_topo1/r1/pimd.conf +++ b/tests/topotests/msdp_topo1/r1/pimd.conf @@ -22,5 +22,7 @@ ip pim rp 10.254.254.1 ip pim join-prune-interval 5 ! router pim + msdp log neighbor-events + msdp log sa-events msdp peer 192.168.0.2 password 1234 ! diff --git a/tests/topotests/msdp_topo1/test_msdp_topo1.py b/tests/topotests/msdp_topo1/test_msdp_topo1.py index ff80052d2665..1c97f7cb1e47 100755 --- a/tests/topotests/msdp_topo1/test_msdp_topo1.py +++ b/tests/topotests/msdp_topo1/test_msdp_topo1.py @@ -17,6 +17,7 @@ import sys import json from functools import partial +import re import pytest # Save the Current Working Directory to find configuration files. @@ -510,6 +511,25 @@ def test_msdp_sa_filter(): assert val is None, "multicast route convergence failure" +def test_msdp_log_events(): + "Test that the enabled logs are working as expected." + + tgen = get_topogen() + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + r1_log = tgen.gears["r1"].net.getLog("log", "pimd") + + # Look up for informational messages that should have been enabled. + match = re.search( + "MSDP peer 192.168.1.2 state changed to established", r1_log) + assert match is not None + + match = re.search( + r"MSDP SA \(192.168.10.100\,229.1.2.3\) created", r1_log) + assert match is not None + + def test_memory_leak(): "Run the memory leak test and report results." tgen = get_topogen()