mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 13:41:46 +00:00
lib: collect and report shutdown errors across whole topology
Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
parent
83c26937f4
commit
95460a6b7e
@ -321,11 +321,13 @@ class Topogen(object):
|
|||||||
killed and try with a different signal.
|
killed and try with a different signal.
|
||||||
"""
|
"""
|
||||||
logger.info('stopping topology: {}'.format(self.modname))
|
logger.info('stopping topology: {}'.format(self.modname))
|
||||||
|
errors = ""
|
||||||
for gear in self.gears.values():
|
for gear in self.gears.values():
|
||||||
gear.stop(False)
|
gear.stop(False, False)
|
||||||
for gear in self.gears.values():
|
for gear in self.gears.values():
|
||||||
gear.stop(True)
|
errors += gear.stop(True, False)
|
||||||
|
if len(errors) > 0:
|
||||||
|
assert "Errors found post shutdown - details follow:" == 0, errors
|
||||||
|
|
||||||
self.net.stop()
|
self.net.stop()
|
||||||
|
|
||||||
@ -426,9 +428,10 @@ class TopoGear(object):
|
|||||||
"Basic start function that just reports equipment start"
|
"Basic start function that just reports equipment start"
|
||||||
logger.info('starting "{}"'.format(self.name))
|
logger.info('starting "{}"'.format(self.name))
|
||||||
|
|
||||||
def stop(self, wait=True):
|
def stop(self, wait=True, assertOnError=True):
|
||||||
"Basic start function that just reports equipment stop"
|
"Basic start function that just reports equipment stop"
|
||||||
logger.info('stopping "{}"'.format(self.name))
|
logger.info('stopping "{}"'.format(self.name))
|
||||||
|
return ""
|
||||||
|
|
||||||
def run(self, command):
|
def run(self, command):
|
||||||
"""
|
"""
|
||||||
@ -662,13 +665,13 @@ class TopoRouter(TopoGear):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def stop(self, wait=True):
|
def stop(self, wait=True, assertOnError=True):
|
||||||
"""
|
"""
|
||||||
Stop router:
|
Stop router:
|
||||||
* Kill daemons
|
* Kill daemons
|
||||||
"""
|
"""
|
||||||
self.logger.debug('stopping')
|
self.logger.debug('stopping')
|
||||||
return self.tgen.net[self.name].stopRouter(wait)
|
return self.tgen.net[self.name].stopRouter(wait, assertOnError)
|
||||||
|
|
||||||
def vtysh_cmd(self, command, isjson=False, daemon=None):
|
def vtysh_cmd(self, command, isjson=False, daemon=None):
|
||||||
"""
|
"""
|
||||||
@ -902,9 +905,10 @@ class TopoExaBGP(TopoHost):
|
|||||||
output = '<none>'
|
output = '<none>'
|
||||||
logger.info('{} exabgp started, output={}'.format(self.name, output))
|
logger.info('{} exabgp started, output={}'.format(self.name, output))
|
||||||
|
|
||||||
def stop(self, wait=True):
|
def stop(self, wait=True, assertOnError=True):
|
||||||
"Stop ExaBGP peer and kill the daemon"
|
"Stop ExaBGP peer and kill the daemon"
|
||||||
self.run('kill `cat /var/run/exabgp/exabgp.pid`')
|
self.run('kill `cat /var/run/exabgp/exabgp.pid`')
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user