From e600b2d93c819af847f1e5086631ac2f16e51fa4 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Fri, 8 Dec 2017 12:41:35 -0200 Subject: [PATCH] topotest: remove pid files Remove PID files after a SIGKILL or confirmation that the pid file no longer contains a running PID. Signed-off-by: Rafael Zalamena --- tests/topotests/lib/topotest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index e436eb09d8..8c26ca4eae 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -537,6 +537,8 @@ class Router(Node): def stopRouter(self, wait=True): # Stop Running Quagga or FRR Daemons rundaemons = self.cmd('ls -1 /var/run/%s/*.pid' % self.routertype) + if re.search(r"No such file or directory", rundaemons): + return if rundaemons is not None: numRunning = 0 for d in StringIO.StringIO(rundaemons): @@ -562,6 +564,7 @@ class Router(Node): )) self.cmd('kill -7 %s' % daemonpid) self.waitOutput() + self.cmd('rm -- {}'.format(d.rstrip())) def removeIPs(self): for interface in self.intfNames(): self.cmd('ip address flush', interface) -- 2.39.5