]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotest: remove pid files
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 8 Dec 2017 14:41:35 +0000 (12:41 -0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Remove PID files after a SIGKILL or confirmation that the pid file no
longer contains a running PID.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/lib/topotest.py

index e436eb09d8a39725329502e79c97a5a8527dbab1..8c26ca4eaed4f0b1502fcda14ec41c05daf67929 100644 (file)
@@ -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)