mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 23:54:45 +00:00
lib: add router.has_mpls check
Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
parent
46325763aa
commit
447f2d5a16
@ -775,6 +775,10 @@ class TopoRouter(TopoGear):
|
||||
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:
|
||||
|
@ -464,6 +464,7 @@ class Router(Node):
|
||||
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,
|
||||
@ -617,6 +618,7 @@ class Router(Node):
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user