From: Lou Berger Date: Wed, 7 Feb 2018 21:13:48 +0000 (-0500) Subject: bgp_l3vpn_to_bgp_direct: use tgen.hasmpls flag X-Git-Tag: frr-7.1-dev~151^2~133 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d868d685e30de929db84f82e7b2c98818e299350;p=matthieu%2Ffrr.git bgp_l3vpn_to_bgp_direct: use tgen.hasmpls flag Signed-off-by: Lou Berger --- diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py index 33c6bf80c8..a9a5b8e7f8 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py @@ -92,8 +92,6 @@ CWD = os.path.dirname(os.path.realpath(__file__)) # test name based on directory TEST = os.path.basename(CWD) -MplsInit = False - class ThisTestTopo(Topo): "Test topology builder" def build(self, *_args, **_opts): @@ -105,12 +103,10 @@ class ThisTestTopo(Topo): # # Create P/PE routers tgen.add_router('r1') - #check for mpls - there may be a better way to check... - if os.path.exists('/proc/sys/net/mpls/conf') != True: + #check for mpls + if tgen.hasmpls != True: logger.info('MPLS not available, tests will be skipped') return - global MplsInit - MplsInit = True for routern in range(2, 5): tgen.add_router('r{}'.format(routern)) # Create CE routers @@ -150,7 +146,7 @@ def ltemplatePreRouterStartHook(): tgen = get_topogen() logger.info('pre router-start hook') #check for mpls - if MplsInit == False: + if tgen.hasmpls != True: logger.info('MPLS not available, skipping setup') return #configure r2 mpls interfaces @@ -179,7 +175,7 @@ def versionCheck(vstr, rname='r1', compstr='<',cli=False): router = tgen.gears[rname] - if MplsInit == False: + if tgen.hasmpls != True: ret = 'MPLS not initialized' return ret