curtype = self.version_info()['type']
return rtype == curtype
+ def has_mpls(self):
+ nrouter = self.tgen.net[self.name]
+ return nrouter.hasmpls
+
class TopoSwitch(TopoGear):
"""
Switch abstraction. Has the following properties:
super(Router, self).__init__(name, **params)
self.logdir = params.get('logdir', '/tmp')
self.daemondir = None
+ self.hasmpls = False
self.routertype = 'frr'
self.daemons = {'zebra': 0, 'ripd': 0, 'ripngd': 0, 'ospfd': 0,
'ospf6d': 0, 'isisd': 0, 'bgpd': 0, 'pimd': 0,
logger.info("LDP Test needs mpls-iptunnel kernel module")
return "LDP Test needs mpls-router kernel module"
+ self.hasmpls = True
self.cmd('/sbin/modprobe mpls-router')
self.cmd('/sbin/modprobe mpls-iptunnel')
self.cmd('echo 100000 > /proc/sys/net/mpls/platform_labels')