# test name based on directory
TEST = os.path.basename(CWD)
-MplsInit = False
-
class ThisTestTopo(Topo):
"Test topology builder"
def build(self, *_args, **_opts):
#
# 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
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
router = tgen.gears[rname]
- if MplsInit == False:
+ if tgen.hasmpls != True:
ret = 'MPLS not initialized'
return ret