]> git.puffer.fish Git - mirror/frr.git/commitdiff
topogen/topotest: add support for BFDd
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 28 Feb 2018 16:06:16 +0000 (13:06 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Allow BFDd to be configured and used.

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

index dbfd1414c0eae3de74d66fce413f6f35350aca25..25edfe032455968a1011ebc4e7b0bd3bda29789c 100644 (file)
@@ -534,6 +534,7 @@ class TopoRouter(TopoGear):
     RD_EIGRP = 10
     RD_NHRP = 11
     RD_STATIC = 12
+    RD_BFD = 13
     RD = {
         RD_ZEBRA: 'zebra',
         RD_RIP: 'ripd',
@@ -547,6 +548,7 @@ class TopoRouter(TopoGear):
         RD_EIGRP: 'eigrpd',
         RD_NHRP: 'nhrpd',
         RD_STATIC: 'staticd',
+        RD_BFD: 'bfdd',
     }
 
     def __init__(self, tgen, cls, name, **params):
index 40222b7612c00dd6e02a35a9ed509ef7215de273..a1998bf87beb86ede19c7df71c055d94ae69480f 100644 (file)
@@ -618,7 +618,8 @@ class Router(Node):
         self.routertype = 'frr'
         self.daemons = {'zebra': 0, 'ripd': 0, 'ripngd': 0, 'ospfd': 0,
                         'ospf6d': 0, 'isisd': 0, 'bgpd': 0, 'pimd': 0,
-                        'ldpd': 0, 'eigrpd': 0, 'nhrpd': 0, 'staticd': 0}
+                        'ldpd': 0, 'eigrpd': 0, 'nhrpd': 0, 'staticd': 0,
+                        'bfdd': 0}
         self.daemons_options = {'zebra': ''}
         self.reportCores = True
         self.version = None
@@ -821,6 +822,12 @@ class Router(Node):
                 logger.info("EIGRP Test, but no eigrpd compiled or installed")
                 return "EIGRP Test, but no eigrpd compiled or installed"
 
+        if self.daemons['bfdd'] == 1:
+            bfdd_path = os.path.join(self.daemondir, 'bfdd')
+            if not os.path.isfile(bfdd_path):
+                logger.info("BFD Test, but no bfdd compiled or installed")
+                return "BFD Test, but no bfdd compiled or installed"
+
         self.restartRouter()
         return ""
 
@@ -863,9 +870,7 @@ class Router(Node):
             if self.daemons[daemon] == 0 or daemon == 'zebra' or daemon == 'staticd':
                 continue
             daemon_path = os.path.join(self.daemondir, daemon)
-            self.cmd('{0} > {3}.out 2> {3}.err &'.format(
-                daemon_path, self.logdir, self.name, daemon
-            ))
+            self.cmd('{0} > {1}.out 2> {1}.err &'.format(daemon_path, daemon))
             self.waitOutput()
             logger.debug('{}: {} {} started'.format(self, self.routertype, daemon))
     def getStdErr(self, daemon):