Skip to content
Permalink
Browse files

topogen/topotest: add support for BFDd

Allow BFDd to be configured and used.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
  • Loading branch information...
rzalamena committed Feb 28, 2018
1 parent 5db46fd commit 3f5896b4ed68a8ff79f5335b1f64cb67dac3deef
Showing with 11 additions and 4 deletions.
  1. +2 −0 lib/topogen.py
  2. +9 −4 lib/topotest.py
@@ -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):
@@ -618,7 +618,8 @@ def __init__(self, name, **params):
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 @@ def startRouter(self, tgen=None):
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 @@ def restartRouter(self):
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):

0 comments on commit 3f5896b

Please sign in to comment.
You can’t perform that action at this time.