]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: add router.has_mpls check
authorLou Berger <lberger@labn.net>
Thu, 1 Feb 2018 01:07:27 +0000 (20:07 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/lib/topogen.py
tests/topotests/lib/topotest.py

index 5c6e9af8adf0c7bba05d147da49edeac6686fc59..e9549e5de4e6e159633c24d0e5e301d7dea34d0b 100644 (file)
@@ -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:
index 8c26ca4eaed4f0b1502fcda14ec41c05daf67929..6ae987ad4bbdbcd6cf8911457034a1c188b53960 100644 (file)
@@ -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')