Commit 3fba6ee936 for frr
commit 3fba6ee936f82decaed918f0daf37aa19928a099
Author: Donald Sharp <sharpd@nvidia.com>
Date: Thu Sep 24 07:42:59 2026 -0400
tests: Start snmpd log files with timestamps
The log files for the snmpd daemon being run in the topotests
do not have any timestamps, thus making it harder to correlate
to events in FRR. Modify the topotests to start up snmpd with
timestamps.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 7c16532815..7bb1f01a85 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -2227,9 +2227,15 @@ class Router(Node):
elif daemon == "snmpd":
binary = "/usr/sbin/snmpd"
cmdenv = ""
- cmdopt = "{} -C -c /etc/frr/snmpd.conf -p ".format(
- daemon_opts
- ) + "{}.pid -x /etc/frr/agentx".format(runbase)
+ # logTimestamp only applies to snmpd file logging (-Lf). Keep the
+ # usual shell redirects so snmpd.out and snmpd.err are still created.
+ cmdopt = (
+ "{} -C -c /etc/frr/snmpd.conf".format(daemon_opts)
+ + " --logTimestamp=1 -Lf {}/{}/{}.log".format(
+ self.logdir, self.name, dfname
+ )
+ + " -p {}.pid -x /etc/frr/agentx".format(runbase)
+ )
# check_daemon_files.append(runbase + ".pid")
elif daemon == "snmptrapd":
binary = "/usr/sbin/snmptrapd"