Skip to content

Commit

Permalink
Merge pull request #16202 from y-bharath14/srib-topotest-d
Browse files Browse the repository at this point in the history
tests: suppress unused variables at topotests
  • Loading branch information
ton31337 authored Jun 14, 2024
2 parents 7b59adc + a63bfb7 commit e8ce036
Show file tree
Hide file tree
Showing 98 changed files with 248 additions and 248 deletions.
2 changes: 1 addition & 1 deletion tests/topotests/bfd_topo3/test_bfd_topo3.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def expect_route_missing(router, iptype, route):
"show {} route json".format(iptype),
{route: None},
)
rv, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
_, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
assertmsg = '"{}" convergence failure'.format(router)
assert result is None, assertmsg

Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bfd_vrf_topo1/test_bfd_vrf_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def setup_module(mod):
router_list = tgen.routers()

# check for zebra capability
for rname, router in router_list.items():
for _, router in router_list.items():
if router.check_capability(TopoRouter.RD_ZEBRA, "--vrfwnetns") == False:
return pytest.skip(
"Skipping BFD Topo1 VRF NETNS feature. VRF NETNS backend not available on FRR"
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_accept_own/test_bgp_accept_own.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -89,12 +89,12 @@ def _bgp_aggregate_address_has_metric(router):
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge, router)
success, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)

assert result is None, 'Failed to see bgp convergence in "{}"'.format(router)

test_func = functools.partial(_bgp_aggregate_address_has_metric, router)
success, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)

assert (
result is None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _bgp_converge():
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)

assert result is None, 'Failed bgp convergence in "{}"'.format(tgen.gears["r1"])

Expand All @@ -99,7 +99,7 @@ def _bgp_has_correct_aggregator_route_with_good_asn():
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_has_correct_aggregator_route_with_good_asn)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)

assert result is None, 'Aggregator AS attribute not found in "{}"'.format(
tgen.gears["r1"]
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_aigp/test_bgp_aigp.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_as_override/test_bgp_as_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -85,12 +85,12 @@ def _bgp_failed(router):
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge, tgen.gears["r1"])
success, result = topotest.run_and_expect(test_func, None, count=260, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=260, wait=0.5)

assert result is None, 'Failed to converge: "{}"'.format(tgen.gears["r1"])

test_func = functools.partial(_bgp_failed, tgen.gears["r3"])
success, result = topotest.run_and_expect(test_func, None, count=260, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=260, wait=0.5)

assert result is None, 'Bad BGP Identifier notification not sent: "{}"'.format(
tgen.gears["r3"]
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/bgp_asdot_regex/test_bgp_asdot_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -97,7 +97,7 @@ def _bgp_converge(router):

logger.info("Check if neighbor sessions are up in {}".format(router1.name))
test_func = partial(_bgp_converge, router1)
success, result = topotest.run_and_expect(test_func, None, count=15, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=15, wait=0.5)
assert result is None, 'Failed to see BGP convergence in "{}"'.format(router1.name)

logger.info("BGP neighbor session is up in {}".format(router1.name))
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/bgp_aspath_zero/test_bgp_aspath_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _bgp_converge():
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "More than one prefix seen at r1, SHOULD be only one."

def _bgp_has_correct_routes_without_asn_0():
Expand All @@ -82,7 +82,7 @@ def _bgp_has_correct_routes_without_asn_0():
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_has_correct_routes_without_asn_0)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed listing 192.168.100.101/32, SHOULD be accepted."


Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_auth/test_bgp_auth1.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def setup_module(mod):
router_list = tgen.routers()

# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_OSPF, "")
router.load_config(TopoRouter.RD_BGP, "")
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_auth/test_bgp_auth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def setup_module(mod):
router_list = tgen.routers()

# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_OSPF, "")
router.load_config(TopoRouter.RD_BGP, "")
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_auth/test_bgp_auth3.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def setup_module(mod):
router_list = tgen.routers()

# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_OSPF, "")
router.load_config(TopoRouter.RD_BGP, "")
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_auth/test_bgp_auth4.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def setup_module(mod):
router_list = tgen.routers()

# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
for _, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_OSPF, "")
router.load_config(TopoRouter.RD_BGP, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -125,14 +125,14 @@ def _bgp_verify_nexthop_validity():
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)

assert result is None, 'Failed bgp convergence in "{}"'.format(tgen.gears["r2"])

step("Check if 172.16.255.254/32 is not advertised to eBGP peers")

test_func = functools.partial(_bgp_no_advertise_ebgp)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)

assert (
result is None
Expand All @@ -142,7 +142,7 @@ def _bgp_verify_nexthop_validity():

step("Check if 172.16.255.254/32 is advertised to iBGP peers")
test_func = functools.partial(_bgp_no_advertise_ibgp)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)

assert (
result is None
Expand All @@ -152,7 +152,7 @@ def _bgp_verify_nexthop_validity():

step("Verify if the nexthop set via route-map on r4 is marked valid")
test_func = functools.partial(_bgp_verify_nexthop_validity)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, 'Nexthops are not valid "{}"'.format(tgen.gears["r4"])


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -92,7 +92,7 @@ def _bgp_converge(router):
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_converge, router)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Cannot see BGP community aliases at r1"

def _bgp_show_prefixes_by_alias(router):
Expand All @@ -118,7 +118,7 @@ def _bgp_show_prefixes_by_alias(router):
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_show_prefixes_by_alias, router)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Cannot see BGP prefixes by community alias at r1"

def _bgp_show_prefixes_by_large_community_list(router):
Expand All @@ -129,7 +129,7 @@ def _bgp_show_prefixes_by_large_community_list(router):
return topotest.json_cmp(output, expected)

test_func = functools.partial(_bgp_show_prefixes_by_large_community_list, router)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Cannot see BGP prefixes by large community list at r1"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def setup_module(mod):

router_list = tgen.routers()

for i, (rname, router) in enumerate(router_list.items(), 1):
for _, (rname, router) in enumerate(router_list.items(), 1):
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down Expand Up @@ -133,7 +133,7 @@ def _bgp_converge_initial():

step("Check if an initial topology is converged")
test_func = functools.partial(_bgp_converge_initial)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed to see bgp convergence in c1"

step("Disable link between y1 and y2")
Expand All @@ -146,7 +146,7 @@ def _bgp_converge_link_disabled():

step("Check if a topology is converged after a link down between y1 and y2")
test_func = functools.partial(_bgp_converge_link_disabled)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed to see bgp convergence in y1"

def _bgp_check_for_duplicate_updates():
Expand Down Expand Up @@ -193,7 +193,7 @@ def _bgp_converge_link_enabled():

step("Check if a topology is converged after a link up between y1 and y2")
test_func = functools.partial(_bgp_converge_link_enabled)
success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed to see bgp convergence in y1"

step(
Expand Down
Loading

0 comments on commit e8ce036

Please sign in to comment.