diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 5c6e9af8ad..e9549e5de4 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -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: diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 8c26ca4eae..6ae987ad4b 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -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')