summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topotest.py
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2018-05-10 07:54:38 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-27 20:22:14 -0500
commit2a59a86b50def45469f57a01daca00f7161bc2d9 (patch)
tree05b02bc696eed543d6061d2bd3500b8454bfe72f /tests/topotests/lib/topotest.py
parentd3335443bf022bc547e095c0c42a28cbe74296a9 (diff)
lib: limit checkRouterCores output to once per router start
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'tests/topotests/lib/topotest.py')
-rw-r--r--tests/topotests/lib/topotest.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index 007e23814e..4344781b5a 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -470,6 +470,7 @@ class Router(Node):
'ospf6d': 0, 'isisd': 0, 'bgpd': 0, 'pimd': 0,
'ldpd': 0, 'eigrpd': 0, 'nhrpd': 0}
self.daemons_options = {'zebra': ''}
+ self.reportCores = True
def _config_frr(self, **params):
"Configure FRR binaries"
@@ -571,7 +572,7 @@ class Router(Node):
self.waitOutput()
self.cmd('rm -- {}'.format(d.rstrip()))
if wait:
- self.checkRouterCores()
+ self.checkRouterCores(reportOnce=True)
def removeIPs(self):
for interface in self.intfNames():
@@ -660,6 +661,8 @@ class Router(Node):
# Starts actual daemons without init (ie restart)
# cd to per node directory
self.cmd('cd {}/{}'.format(self.logdir, self.name))
+ #Re-enable to allow for report per run
+ self.reportCores = True
# Start Zebra first
if self.daemons['zebra'] == 1:
zebra_path = os.path.join(self.daemondir, 'zebra')
@@ -692,7 +695,10 @@ class Router(Node):
def getLog(self, log, daemon):
return self.cmd('cat {}/{}/{}.{}'.format(self.logdir, self.name, daemon, log))
- def checkRouterCores(self, reportLeaks=True):
+ def checkRouterCores(self, reportLeaks=True, reportOnce=False):
+ if reportOnce and not self.reportCores:
+ return
+ reportMade = False
for daemon in self.daemons:
if (self.daemons[daemon] == 1):
# Look for core file
@@ -705,6 +711,7 @@ class Router(Node):
], shell=True)
sys.stderr.write("\n%s: %s crashed. Core file found - Backtrace follows:\n" % (self.name, daemon))
sys.stderr.write("%s" % backtrace)
+ reportMade = True
elif reportLeaks:
log = self.getStdErr(daemon)
if "memstats" in log:
@@ -713,9 +720,13 @@ class Router(Node):
log = re.sub(r"(showing active allocations in memory group [a-zA-Z0-9]+)", r"\n ## \1", log)
log = re.sub("memstats: ", " ", log)
sys.stderr.write(log)
+ reportMade = True
# Look for AddressSanitizer Errors and append to /tmp/AddressSanitzer.txt if found
if checkAddressSanitizerError(self.getStdErr(daemon), self.name, daemon):
sys.stderr.write("%s: Daemon %s killed by AddressSanitizer" % (self.name, daemon))
+ reportMade = True
+ if reportMade:
+ self.reportCores = False
def checkRouterRunning(self):
"Check if router daemons are running and collect crashinfo they don't run"