diff options
Diffstat (limited to 'tests/topotests/lib/topotest.py')
| -rw-r--r-- | tests/topotests/lib/topotest.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index ef0ac27118..1e6ef1b2b3 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -1105,7 +1105,8 @@ class Router(Node): "sharpd": 0, "babeld": 0, "pbrd": 0, - 'pathd': 0 + "pathd": 0, + "snmpd": 0, } self.daemons_options = {"zebra": ""} self.reportCores = True @@ -1289,6 +1290,8 @@ class Router(Node): % (self.routertype, self.routertype, self.routertype, daemon) ) self.waitOutput() + if (daemon == "snmpd") and (self.routertype == "frr"): + self.cmd('echo "agentXSocket /etc/frr/agentx" > /etc/snmp/frr.conf') if (daemon == "zebra") and (self.daemons["staticd"] == 0): # Add staticd with zebra - if it exists staticd_path = os.path.join(self.daemondir, "staticd") @@ -1445,6 +1448,20 @@ class Router(Node): while "staticd" in daemons_list: daemons_list.remove("staticd") + if "snmpd" in daemons_list: + snmpd_path = "/usr/sbin/snmpd" + snmpd_option = self.daemons_options["snmpd"] + self.cmd( + "{0} {1} -C -c /etc/frr/snmpd.conf -p /var/run/{2}/snmpd.pid -x /etc/frr/agentx > snmpd.out 2> snmpd.err".format( + snmpd_path, snmpd_option, self.routertype + ) + ) + logger.info("{}: {} snmpd started".format(self, self.routertype)) + + # Remove `snmpd` so we don't attempt to start it again. + while "snmpd" in daemons_list: + daemons_list.remove("snmpd") + # Fix Link-Local Addresses # Somehow (on Mininet only), Zebra removes the IPv6 Link-Local addresses on start. Fix this self.cmd( @@ -1608,6 +1625,8 @@ class Router(Node): return "%s: vtysh killed by AddressSanitizer" % (self.name) for daemon in self.daemons: + if daemon == "snmpd": + 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": |
