Merge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf

tests:  get bgp_l3vpn_to_bgp_vrf running again, also improve logging (minor)
This commit is contained in:
Donald Sharp 2021-09-29 07:29:39 -04:00 committed by GitHub
commit ffd7467cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -206,7 +206,7 @@ def ltemplatePreRouterStartHook():
for cmd in cmds:
cc.doCmd(tgen, rtr, cmd.format(rtr))
cc.doCmd(tgen, rtr, "ip link set dev {0}-eth0 master {0}-cust2".format(rtr))
if cc.getOutput() != 4:
if cc.getOutput() != 0:
InitSuccess = False
logger.info(
"Unexpected output seen ({} times, tests will be skipped".format(
@ -214,6 +214,11 @@ def ltemplatePreRouterStartHook():
)
)
else:
rtrs = ["r1", "r3", "r4", "ce4"]
for rtr in rtrs:
logger.info("{} configured".format(rtr))
cc.doCmd(tgen, rtr, "ip -d link show type vrf")
cc.doCmd(tgen, rtr, "ip link show")
InitSuccess = True
logger.info("VRF config successful!")
return InitSuccess

View File

@ -217,6 +217,7 @@ class ltemplateRtrCmd:
self.resetCounts()
def doCmd(self, tgen, rtr, cmd, checkstr=None):
logger.info("doCmd: {} {}".format(rtr, cmd))
output = tgen.net[rtr].cmd(cmd).strip()
if len(output):
self.output += 1
@ -227,9 +228,10 @@ class ltemplateRtrCmd:
else:
self.match += 1
return ret
logger.info("command: {} {}".format(rtr, cmd))
logger.info("output: " + output)
self.none += 1
else:
logger.info("No output")
self.none += 1
return None
def resetCounts(self):