]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgp_l3vpn_to_bgp_vrf: skip mpls vrf ping tests when have old iproute2
authorLou Berger <lberger@labn.net>
Tue, 6 Feb 2018 23:22:04 +0000 (18:22 -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/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py

index c3c784b5239c5d588304fc7045ab5fadc71ad942..57219598843de6e826f7ba164b0eba41a3c6d49d 100644 (file)
@@ -1,6 +1,19 @@
 from lutil import luCommand, luLast
-ret = luCommand('r2','ip -M route show','\d*(?= via inet 10.0.2.4 dev r2-eth1)','wait','See mpls route to r4')
+from lib import topotest
+from lib.topolog import logger
+minver = '4.9'
+ret = luCommand('r1','apt-cache policy iproute2', 'Installed: ([\d\.]*)')
 found = luLast()
+dotest = -1
+if ret != False and found != None:
+    dotest = topotest.version_cmp(found.group(1), minver)
+if dotest == -1:
+    luCommand('r1','apt-cache policy iproute2', '.', 'pass', 'Skipping test, iproute2 version {} < {}'.format(found.group(1), minver))
+    ret = False
+else:
+    logger.info('iproute2 ver = {} dotest = {}'.format(found.group(1), dotest))
+    ret = luCommand('r2','ip -M route show','\d*(?= via inet 10.0.2.4 dev r2-eth1)','wait','See mpls route to r4')
+    found = luLast()
 if ret != False and found != None:
     label4r4 = found.group(0)
     luCommand('r2','ip -M route show','.','pass','See %s as label to r4' % label4r4)