From 4a1741370936bcae7d32390802179b6849ea8f79 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 6 Feb 2018 18:22:04 -0500 Subject: [PATCH] bgp_l3vpn_to_bgp_vrf: skip mpls vrf ping tests when have old iproute2 Signed-off-by: Lou Berger --- .../scripts/check_linux_mpls.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py index c3c784b52..572195988 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py @@ -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) -- 2.39.2