summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topotest.py
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-10-24 21:34:47 +0300
committerGitHub <noreply@github.com>2023-10-24 21:34:47 +0300
commit26373fbedd00008eacd71bec073ff1b5e41adbfd (patch)
treef9e053625d0be661501f9fe25d34f430cc27b23e /tests/topotests/lib/topotest.py
parentb6b0001a4c876f8a31b678fe23d09e6ec3460005 (diff)
parentccef5451220a3cb8db1b27905903d20c32460e3b (diff)
Merge pull request #14333 from fdumontet6WIND/bgp4v2_snmp
bgpd: add support of traps for bgp4-mibv2
Diffstat (limited to 'tests/topotests/lib/topotest.py')
-rw-r--r--tests/topotests/lib/topotest.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 093491617d..8491314e16 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -1423,6 +1423,7 @@ class Router(Node):
"pathd": 0,
"snmpd": 0,
"mgmtd": 0,
+ "snmptrapd": 0,
}
self.daemons_options = {"zebra": ""}
self.reportCores = True
@@ -1887,6 +1888,15 @@ class Router(Node):
daemon_opts
) + "{}.pid -x /etc/frr/agentx".format(runbase)
# check_daemon_files.append(runbase + ".pid")
+ elif daemon == "snmptrapd":
+ binary = "/usr/sbin/snmptrapd"
+ cmdenv = ""
+ cmdopt = (
+ "{} ".format(daemon_opts)
+ + "-C -c /etc/{}/snmptrapd.conf".format(self.routertype)
+ + " -p {}.pid".format(runbase)
+ + " -LF 6-7 {}/{}/snmptrapd.log".format(self.logdir, self.name)
+ )
else:
binary = os.path.join(self.daemondir, daemon)
check_daemon_files.extend([runbase + ".pid", runbase + ".vty"])
@@ -1926,6 +1936,7 @@ class Router(Node):
tail_log_files.append(
"{}/{}/{}.log".format(self.logdir, self.name, daemon)
)
+
if extra_opts:
cmdopt += " " + extra_opts
@@ -2056,7 +2067,7 @@ class Router(Node):
"%s: %s %s started with perf", self, self.routertype, daemon
)
else:
- if daemon != "snmpd":
+ if daemon != "snmpd" and daemon != "snmptrapd":
cmdopt += " -d "
cmdopt += rediropt
@@ -2299,6 +2310,8 @@ class Router(Node):
for daemon in self.daemons:
if daemon == "snmpd":
continue
+ if daemon == "snmptrapd":
+ continue
if (self.daemons[daemon] == 1) and not (daemon in daemonsRunning):
sys.stderr.write("%s: Daemon %s not running\n" % (self.name, daemon))
if daemon == "staticd":