]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: test new log toggle 17469/head
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 21 Nov 2024 13:23:37 +0000 (10:23 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 21 Nov 2024 13:26:16 +0000 (10:26 -0300)
Test MSDP new log toggle: the MSDP peer connection state and SA events
should be logged.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/msdp_topo1/r1/pimd.conf
tests/topotests/msdp_topo1/test_msdp_topo1.py

index 3c116a003beaf07ff155739f94ed90bfb7280120..1548aed05e183b307c914acdaa53ff5c11d8313d 100644 (file)
@@ -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
 !
index ff80052d266599f46463ac358392e1d111dbc0be..1c97f7cb1e473f83842c243bc5166baf15edb3f2 100755 (executable)
@@ -17,6 +17,7 @@ import os
 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()