Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests random order #16508

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

doc: Document the pytest-random-order changes to topotests

3cdeef0
Select commit
Loading
Failed to load commit list.
Open

Tests random order #16508

doc: Document the pytest-random-order changes to topotests
3cdeef0
Select commit
Loading
Failed to load commit list.
frrbot / frrbot completed Jul 31, 2024 in 17m 14s

Style and/or linter errors found

Style and/or linter errors found

Details

Thanks for your contribution to FRR!


Pylint found errors in source files changed by this PR:

Pylint report for my_frr-65375/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py:
************* Module isis_topo1_vrf.test_isis_topo1_vrf
 my_frr-65375/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py:229: error (E1305, too-many-format-args, test_isis_route6_installation) Too many arguments for format string
 


Click for style suggestions

diff --git a/tests/topotests/bfd_topo2/test_bfd_topo2.py b/tests/topotests/bfd_topo2/test_bfd_topo2.py
index 49f05e70f..11617ba78 100644
--- a/tests/topotests/bfd_topo2/test_bfd_topo2.py
+++ b/tests/topotests/bfd_topo2/test_bfd_topo2.py
@@ -50,7 +50,6 @@ def setup_module(mod):
 
     router_list = tgen.routers()
     for rname, router in router_list.items():
-
         daemon_file = "{}/{}/zebra.conf".format(CWD, rname)
         router.load_config(TopoRouter.RD_ZEBRA, daemon_file)
 
diff --git a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
index 7d01e708e..2004913ec 100644
--- a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
+++ b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
@@ -835,7 +835,6 @@ def test_bgp_with_loopback_interface(request):
         for bgp_neighbor in topo["routers"][routerN]["bgp"]["address_family"]["ipv4"][
             "unicast"
         ]["neighbor"].keys():
-
             # Adding ['source_link'] = 'lo' key:value pair
             topo["routers"][routerN]["bgp"]["address_family"]["ipv4"]["unicast"][
                 "neighbor"
@@ -914,7 +913,6 @@ def test_bgp_with_loopback_with_same_subnet_p1(request):
             for bgp_neighbor in topo_modify["routers"][routerN]["bgp"][
                 "address_family"
             ][addr_type]["unicast"]["neighbor"].keys():
-
                 # Adding ['source_link'] = 'lo' key:value pair
                 topo_modify["routers"][routerN]["bgp"]["address_family"][addr_type][
                     "unicast"
diff --git a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_3.py b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_3.py
index 20046d023..0ee7de79c 100644
--- a/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_3.py
+++ b/tests/topotests/bgp_default_originate/test_bgp_default_originate_topo1_3.py
@@ -2164,7 +2164,6 @@ def test_verify_default_originate_after_shut_no_shut_bgp_neighbor_p1(request):
     routers = ["r1", "r2"]
     for dut in routers:
         for addr_type in ADDR_TYPES:
-
             clear_bgp(tgen, addr_type, dut)
 
             DEFAULT_ROUTES = {"ipv4": "0.0.0.0/0", "ipv6": "0::0/0"}
diff --git a/tests/topotests/bgp_ecmp_topo2/test_ebgp_ecmp_topo2.py b/tests/topotests/bgp_ecmp_topo2/test_ebgp_ecmp_topo2.py
index 0405eac2c..b9a13d9a8 100644
--- a/tests/topotests/bgp_ecmp_topo2/test_ebgp_ecmp_topo2.py
+++ b/tests/topotests/bgp_ecmp_topo2/test_ebgp_ecmp_topo2.py
@@ -156,7 +156,6 @@ def teardown_module():
 
 
 def static_or_nw(tgen, topo, tc_name, test_type, dut):
-
     if test_type == "redist_static":
         input_dict_static = {
             dut: {
@@ -366,7 +365,6 @@ def test_ecmp_remove_redistribute_static(request):
     reset_config_on_routers(tgen)
     static_or_nw(tgen, topo, tc_name, "redist_static", "r2")
     for addr_type in ADDR_TYPES:
-
         # Verifying RIB routes
         dut = "r3"
         protocol = "bgp"
@@ -409,7 +407,6 @@ def test_ecmp_remove_redistribute_static(request):
     assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
 
     for addr_type in ADDR_TYPES:
-
         # Verifying RIB routes
         dut = "r3"
         protocol = "bgp"
diff --git a/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py b/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py
index 36cf253b5..f9b3f53f1 100644
--- a/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py
+++ b/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py
@@ -103,7 +103,6 @@ def teardown_module():
 
 
 def static_or_nw(tgen, topo, tc_name, test_type, dut):
-
     if test_type == "redist_static":
         input_dict_static = {
             dut: {
diff --git a/tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py b/tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py
index e4ae81fca..51bafcea3 100755
--- a/tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py
+++ b/tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py
@@ -16,7 +16,12 @@ sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
 
 from lib.ltemplate import *
 
-pytestmark = [pytest.mark.random_order(disabled=True), pytest.mark.random_order(disabled=True), pytest.mark.bgpd, pytest.mark.ospfd]
+pytestmark = [
+    pytest.mark.random_order(disabled=True),
+    pytest.mark.random_order(disabled=True),
+    pytest.mark.bgpd,
+    pytest.mark.ospfd,
+]
 
 
 def test_add_routes():
diff --git a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
index 8d725f4ea..d9cd60f2a 100644
--- a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
+++ b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
@@ -818,7 +818,11 @@ def test_route_summarisation_with_as_set_p1(request):
     )
 
     for addr_type in ADDR_TYPES:
-        for (pfx, seq_id, network,) in zip(
+        for (
+            pfx,
+            seq_id,
+            network,
+        ) in zip(
             [1, 2, 3, 4, 5],
             [10, 20, 30, 40, 50],
             [NETWORK_1_1, NETWORK_1_2, NETWORK_1_3, NETWORK_1_4, NETWORK_1_5],
diff --git a/tests/topotests/bgp_route_map/test_route_map_topo1.py b/tests/topotests/bgp_route_map/test_route_map_topo1.py
index 0dbc5a1ed..0c630959c 100644
--- a/tests/topotests/bgp_route_map/test_route_map_topo1.py
+++ b/tests/topotests/bgp_route_map/test_route_map_topo1.py
@@ -183,7 +183,6 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request):
     reset_config_on_routers(tgen)
 
     for adt in ADDR_TYPES:
-
         # Create Static routes
         input_dict = {
             "r1": {
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo1.py b/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo1.py
index 2d060073b..e60ff6971 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo1.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak/test_bgp_vrf_dynamic_route_leak_topo1.py
@@ -477,7 +477,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         check_router_status(tgen)
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Redistribute configured static routes into BGP process" " on R1 and R3/R4"
         )
@@ -509,7 +508,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Verify that R1 receives BGP routes from R3 and R4 in " "vrf default.")
 
         input_routes_r3 = {
@@ -557,7 +555,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
             )
 
     for addr_type in ADDR_TYPES:
-
         step("Import from default vrf into vrf ISR on R1")
 
         input_dict_isr = {}
@@ -585,7 +582,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify that default vrf's imported routes are installed "
             "in RIB/FIB of vrf ISR on R1:"
@@ -638,7 +634,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
 
     intf_r2_r1 = topo["routers"]["r2"]["links"]["r1-link1"]
     for addr_type in ADDR_TYPES:
-
         step(
             "Create a loopback10 interface on R1 with below IP address and "
             "associate with vrf ISR:"
@@ -653,7 +648,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "On router R1 Change the next-hop of static routes in vrf "
             "ISR to LOOPBACK_2"
@@ -693,7 +687,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify that, though R1 originating BGP routes with next-hop"
             " 24.1.1.2/24::1:2, which is local to R2(but in default vrf)"
@@ -723,7 +716,6 @@ def test_dynamic_imported_routes_advertised_to_iBGP_peer_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("On router R1 delete static routes in vrf ISR to LOOPBACK_1")
 
         input_routes_r1 = {
@@ -762,7 +754,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         check_router_status(tgen)
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Configure route-map to set community attribute for a specific"
             "prefix on R1 in vrf ISR"
@@ -827,7 +818,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Apply this route-map on R1 to vrf ISR while redistributing the"
             " prefixes into BGP"
@@ -869,7 +859,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Configure another route-map for filtering the prefixes based on"
             " community attribute while importing into default vrf"
@@ -894,7 +883,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Apply the route-map while Importing vrf ISR's prefixes into "
             "default vrf on router R1:"
@@ -941,7 +929,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify on R1 that only prefixes with community value 100:100"
             "in vrf ISR are imported to vrf default. While importing, the"
@@ -978,7 +965,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Remove/re-add route-map XYZ from redistribution.")
 
         input_dict_1 = {}
@@ -1018,7 +1004,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify that all the routes disappear from vrf default when "
             "route-map is removed from redistribution, and appear again "
@@ -1041,7 +1026,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_dict_1 = {}
         DUT = ["r1"]
         VRFS = ["ISR"]
@@ -1078,7 +1062,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_routes_r1 = {
             "r1": {
                 "static_routes": [
@@ -1093,7 +1076,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Remove/re-add route-map IMP form import statement.")
 
         input_dict_isr = {}
@@ -1138,7 +1120,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify that when route-map IMP is removed all the prefixes of"
             " vrf ISR are imported to vrf default. However when route-map "
@@ -1160,7 +1141,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_dict_isr = {}
         DUT = ["r1"]
         VRFS = ["default"]
@@ -1202,7 +1182,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_routes_r1 = {
             "r1": {
                 "static_routes": [
@@ -1217,7 +1196,6 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Delete/Re-add prefix-list ABC.")
 
         input_dict_pf = {
@@ -1415,7 +1393,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         check_router_status(tgen)
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Configure route-map to set community attribute for a specific"
             "prefix on R1 in vrf ISR"
@@ -1480,7 +1457,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Apply this route-map on R1 to vrf ISR while redistributing the"
             " prefixes into BGP"
@@ -1522,7 +1498,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Configure another route-map for filtering the prefixes based on"
             " community attribute while importing into default vrf"
@@ -1547,7 +1522,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Apply the route-map while Importing vrf ISR's prefixes into "
             "default vrf on router R1:"
@@ -1594,7 +1568,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify on R1 that only prefixes with community value 100:100"
             "in vrf ISR are imported to vrf default. While importing, the"
@@ -1615,7 +1588,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Applying route-map first followed by import VRF command.")
         step(
             "Apply the route-map while Importing vrf ISR's prefixes into "
@@ -1665,7 +1637,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Verify that until 'import VRF command' is not configured, "
             "routes are not imported. After configuring 'import VRF command'"
@@ -1688,7 +1659,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_dict_isr = {}
         DUT = ["r1"]
         VRFS = ["default"]
@@ -1730,7 +1700,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         input_routes_r1 = {
             "r1": {
                 "static_routes": [
@@ -1745,7 +1714,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step("Delete/re-add import vrf ISR command multiple times in default" "vrf.")
 
         input_dict_isr = {}
@@ -1810,7 +1778,6 @@ def test_routemap_operatons_with_dynamic_import_p0(request):
         )
 
     for addr_type in ADDR_TYPES:
-
         step(
             "Delete and re-configure route-map IMP from global config when "
             "import and route-maps are applied in a ISR vrf."
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
index cbd1af538..13e547822 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo3/test_bgp_vrf_dynamic_route_leak_topo3.py
@@ -853,23 +853,25 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
                 result = verify_bgp_rib(
                     tgen, addr_type, "r3", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                    tc_name,
-                    result,
-                    static_routes["r3"]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed \nError {}\n"
+                    "Routes {} still in BGP table".format(
+                        tc_name,
+                        result,
+                        static_routes["r3"]["static_routes"][0]["network"],
+                    )
                 )
 
                 result = verify_rib(
                     tgen, addr_type, "r3", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                    tc_name,
-                    result,
-                    static_routes["r3"]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed Error {}"
+                    "Routes {} still in Route table".format(
+                        tc_name,
+                        result,
+                        static_routes["r3"]["static_routes"][0]["network"],
+                    )
                 )
             else:
                 result = verify_bgp_rib(tgen, addr_type, "r3", static_routes)
@@ -926,23 +928,25 @@ def test_dynamic_imported_matching_prefix_based_on_community_list_p0(request):
                 result = verify_bgp_rib(
                     tgen, addr_type, "r3", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                    tc_name,
-                    result,
-                    static_routes["r3"]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed \nError {}\n"
+                    "Routes {} still in BGP table".format(
+                        tc_name,
+                        result,
+                        static_routes["r3"]["static_routes"][0]["network"],
+                    )
                 )
 
                 result = verify_rib(
                     tgen, addr_type, "r3", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                    tc_name,
-                    result,
-                    static_routes["r3"]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed Error {}"
+                    "Routes {} still in Route table".format(
+                        tc_name,
+                        result,
+                        static_routes["r3"]["static_routes"][0]["network"],
+                    )
                 )
             else:
                 result = verify_bgp_rib(tgen, addr_type, "r3", static_routes)
@@ -1155,23 +1159,25 @@ def test_dynamic_import_routes_delete_static_route_p1(request):
                 result = verify_bgp_rib(
                     tgen, addr_type, "r2", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                    tc_name,
-                    result,
-                    static_routes["r2"]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed \nError {}\n"
+                    "Routes {} still in BGP table".format(
+                        tc_name,
+                        result,
+                        static_routes["r2"]["static_routes"][0]["network"],
+                    )
                 )
 
                 result = verify_rib(
                     tgen, addr_type, "r2", static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                    tc_name,
-                    result,
-                    static_routes[dut]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed Error {}"
+                    "Routes {} still in Route table".format(
+                        tc_name,
+                        result,
+                        static_routes[dut]["static_routes"][0]["network"],
+                    )
                 )
 
     step("Delete static routes from vrf BLUE")
@@ -1211,21 +1217,23 @@ def test_dynamic_import_routes_delete_static_route_p1(request):
                 result = verify_bgp_rib(
                     tgen, addr_type, dut, static_routes, expected=False
                 )
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                    tc_name,
-                    result,
-                    static_routes[dut]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed \nError {}\n"
+                    "Routes {} still in BGP table".format(
+                        tc_name,
+                        result,
+                        static_routes[dut]["static_routes"][0]["network"],
+                    )
                 )
 
                 result = verify_rib(tgen, addr_type, dut, static_routes, expected=False)
-                assert (
-                    result is not True
-                ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                    tc_name,
-                    result,
-                    static_routes[dut]["static_routes"][0]["network"],
+                assert result is not True, (
+                    "Testcase {} : Failed Error {}"
+                    "Routes {} still in Route table".format(
+                        tc_name,
+                        result,
+                        static_routes[dut]["static_routes"][0]["network"],
+                    )
                 )
 
     step("Delete static routes from vrf default")
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
index fcf16bec7..f14a62a82 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-1.py
@@ -354,23 +354,25 @@ def test_dynamic_import_recursive_import_tenant_vrf_p1(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, "r4", static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes["r4"]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes["r4"]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, "r4", static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                        tc_name,
-                        result,
-                        static_routes["r4"]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed Error {}"
+                        "Routes {} still in Route table".format(
+                            tc_name,
+                            result,
+                            static_routes["r4"]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, "r4", static_routes)
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
index 9065bbf5d..3a8ca34c4 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-2.py
@@ -493,23 +493,25 @@ def test_dynamic_import_routes_between_two_tenant_vrf_p0(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in Route table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in Route table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, dut, static_routes)
@@ -880,23 +882,25 @@ def test_dynamic_import_routes_between_two_tenant_vrf_p0(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed Error {}"
+                        "Routes {} still in Route table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, dut, static_routes)
diff --git a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
index aed5949ea..9ebc94de1 100644
--- a/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
+++ b/tests/topotests/bgp_vrf_dynamic_route_leak_topo4/test_bgp_vrf_dynamic_route_leak_topo4-3.py
@@ -354,23 +354,25 @@ def test_dynamic_import_routes_between_tenant_to_default_vrf_p0(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, dut, static_routes)
@@ -501,23 +503,25 @@ def test_dynamic_import_routes_between_tenant_to_default_vrf_p0(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed Error {}"
+                        "Routes {} still in Route table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, dut, static_routes)
@@ -880,23 +884,25 @@ def test_dynamic_import_routes_between_tenant_to_default_vrf_p0(request):
                     result = verify_bgp_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed \nError {}\n" "Routes {} still in BGP table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed \nError {}\n"
+                        "Routes {} still in BGP table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
 
                     result = verify_rib(
                         tgen, addr_type, dut, static_routes, expected=False
                     )
-                    assert (
-                        result is not True
-                    ), "Testcase {} : Failed Error {}" "Routes {} still in Route table".format(
-                        tc_name,
-                        result,
-                        static_routes[dut]["static_routes"][0]["network"],
+                    assert result is not True, (
+                        "Testcase {} : Failed Error {}"
+                        "Routes {} still in Route table".format(
+                            tc_name,
+                            result,
+                            static_routes[dut]["static_routes"][0]["network"],
+                        )
                     )
                 else:
                     result = verify_bgp_rib(tgen, addr_type, dut, static_routes)
diff --git a/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py b/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py
index f63c85657..96d7b614e 100644
--- a/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py
+++ b/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py
@@ -1128,7 +1128,6 @@ def test_active_standby_evpn_implementation_p1(request):
     )
 
     for addr_type in ADDR_TYPES:
-
         logger.info("Verifying only ipv4 routes")
         if addr_type != "ipv4":
             continue
diff --git a/tests/topotests/ldp_sync_isis_topo1/test_ldp_sync_isis_topo1.py b/tests/topotests/ldp_sync_isis_topo1/test_ldp_sync_isis_topo1.py
index 17902daab..ab7652fb8 100644
--- a/tests/topotests/ldp_sync_isis_topo1/test_ldp_sync_isis_topo1.py
+++ b/tests/topotests/ldp_sync_isis_topo1/test_ldp_sync_isis_topo1.py
@@ -545,7 +545,6 @@ def parse_show_isis_interface_detail(lines, rname):
                     line = next(it)
 
                 while line.startswith(" Level-"):
-
                     level = {}
 
                     level_name = line.split()[0]
@@ -573,7 +572,6 @@ def parse_show_isis_interface_detail(lines, rname):
             areas[area_id] = area
 
         except StopIteration:
-
             areas[area_id] = area
             break
 
diff --git a/tests/topotests/ldp_topo1/test_ldp_topo1.py b/tests/topotests/ldp_topo1/test_ldp_topo1.py
index 2c33a682b..93e4f687c 100644
--- a/tests/topotests/ldp_topo1/test_ldp_topo1.py
+++ b/tests/topotests/ldp_topo1/test_ldp_topo1.py
@@ -79,7 +79,6 @@ pytestmark = [
 
 
 def build_topo(tgen):
-
     # Setup Routers
     for i in range(1, 5):
         tgen.add_router("r%s" % i)
@@ -841,7 +840,6 @@ def test_shutdown_check_memleak():
 
 
 if __name__ == "__main__":
-
     # To suppress tracebacks, either use the following pytest call or add "--tb=no" to cli
     # retval = pytest.main(["-s", "--tb=no"])
     retval = pytest.main(["-s"])
diff --git a/tests/topotests/msdp_mesh_topo1/test_msdp_mesh_topo1.py b/tests/topotests/msdp_mesh_topo1/test_msdp_mesh_topo1.py
index 5d1cdcb27..c648eada7 100644
--- a/tests/topotests/msdp_mesh_topo1/test_msdp_mesh_topo1.py
+++ b/tests/topotests/msdp_mesh_topo1/test_msdp_mesh_topo1.py
@@ -76,7 +76,6 @@ def setup_module(mod):
 
     router_list = tgen.routers()
     for rname, router in router_list.items():
-
         daemon_file = "{}/{}/zebra.conf".format(CWD, rname)
         if os.path.isfile(daemon_file):
             router.load_config(TopoRouter.RD_ZEBRA, daemon_file)
diff --git a/tests/topotests/msdp_topo2/test_msdp_topo2.py b/tests/topotests/msdp_topo2/test_msdp_topo2.py
index cea19b568..ee9e26043 100755
--- a/tests/topotests/msdp_topo2/test_msdp_topo2.py
+++ b/tests/topotests/msdp_topo2/test_msdp_topo2.py
@@ -101,7 +101,6 @@ def setup_module(mod):
 
     router_list = tgen.routers()
     for rname, router in router_list.items():
-
         daemon_file = "{}/{}/zebra.conf".format(CWD, rname)
         if os.path.isfile(daemon_file):
             router.load_config(TopoRouter.RD_ZEBRA, daemon_file)
diff --git a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py
index 76b1d89d0..3034a28d5 100755
--- a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py
+++ b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py
@@ -263,11 +263,14 @@ def verify_state_incremented(state_before, state_after):
         for intf, v2 in v1.items():
             for state, value in v2.items():
                 if value >= state_after[ttype][intf][state]:
-                    errormsg = "[DUT: %s]: state %s value has not incremented, Initial value: %s, Current value: %s [FAILED!!]" % (
-                        intf,
-                        state,
-                        value,
-                        state_after[ttype][intf][state],
+                    errormsg = (
+                        "[DUT: %s]: state %s value has not incremented, Initial value: %s, Current value: %s [FAILED!!]"
+                        % (
+                            intf,
+                            state,
+                            value,
+                            state_after[ttype][intf][state],
+                        )
                     )
                     return errormsg
 
diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
index a216ab93d..38e0f7f1d 100644
--- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
+++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
@@ -207,7 +207,6 @@ def test_protocols_convergence():
 
     # Check NHRP cache on servers and clients
     for _, router in router_list.items():
-
         json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name)
         if not os.path.isfile(json_file):
             logger.info("skipping file {}".format(json_file))
@@ -227,7 +226,6 @@ def test_protocols_convergence():
 
     # Check NHRP IPV4 routes on servers and clients
     for rname, router in router_list.items():
-
         json_file = "{}/{}/nhrp_route.json".format(CWD, router.name)
         if not os.path.isfile(json_file):
             logger.info("skipping file {}".format(json_file))
diff --git a/tests/topotests/ospf6_point_to_multipoint/test_ospf6_point_to_multipoint.py b/tests/topotests/ospf6_point_to_multipoint/test_ospf6_point_to_multipoint.py
index 3c9919d95..486fa7f9d 100644
--- a/tests/topotests/ospf6_point_to_multipoint/test_ospf6_point_to_multipoint.py
+++ b/tests/topotests/ospf6_point_to_multipoint/test_ospf6_point_to_multipoint.py
@@ -220,7 +220,6 @@ def compare_show_ipv6(rname, expected):
 
 
 def test_ospfv3_routingTable():
-
     tgen = get_topogen()
     if tgen.routers_have_failure():
         pytest.skip("skipped because of router(s) failure")
@@ -243,7 +242,6 @@ def test_ospfv3_routingTable():
 
 
 def test_linux_ipv6_kernel_routingTable():
-
     tgen = get_topogen()
 
     if tgen.routers_have_failure():
@@ -335,7 +333,6 @@ def test_linux_ipv6_kernel_routingTable():
 
 
 def test_shutdown_check_stderr():
-
     tgen = get_topogen()
 
     if tgen.routers_have_failure():
@@ -383,7 +380,6 @@ def test_shutdown_check_memleak():
 
 
 if __name__ == "__main__":
-
     # To suppress tracebacks, either use the following pytest call or
     # add "--tb=no" to cli
     # retval = pytest.main(["-s", "--tb=no"])
diff --git a/tests/topotests/ospf6_topo1/test_ospf6_topo1.py b/tests/topotests/ospf6_topo1/test_ospf6_topo1.py
index a3682dede..e5bc08231 100644
--- a/tests/topotests/ospf6_topo1/test_ospf6_topo1.py
+++ b/tests/topotests/ospf6_topo1/test_ospf6_topo1.py
@@ -220,7 +220,6 @@ def compare_show_ipv6(rname, expected):
 
 
 def test_ospfv3_routingTable():
-
     tgen = get_topogen()
     if tgen.routers_have_failure():
         pytest.skip("skipped because of router(s) failure")
@@ -243,7 +242,6 @@ def test_ospfv3_routingTable():
 
 
 def test_linux_ipv6_kernel_routingTable():
-
     tgen = get_topogen()
 
     if tgen.routers_have_failure():
@@ -335,7 +333,6 @@ def test_linux_ipv6_kernel_routingTable():
 
 
 def test_ospfv3_routingTable_write_multiplier():
-
     tgen = get_topogen()
     if tgen.routers_have_failure():
         pytest.skip("skipped because of router(s) failure")
@@ -365,7 +362,6 @@ def test_ospfv3_routingTable_write_multiplier():
 
 
 def test_shutdown_check_stderr():
-
     tgen = get_topogen()
 
     if tgen.routers_have_failure():
@@ -413,7 +409,6 @@ def test_shutdown_check_memleak():
 
 
 if __name__ == "__main__":
-
     # To suppress tracebacks, either use the following pytest call or
     # add "--tb=no" to cli
     # retval = pytest.main(["-s", "--tb=no"])
diff --git a/tests/topotests/ospf6_topo1_vrf/test_ospf6_topo1_vrf.py b/tests/topotests/ospf6_topo1_vrf/test_ospf6_topo1_vrf.py
index 7e4d3a53d..0fd740ae7 100755
--- a/tests/topotests/ospf6_topo1_vrf/test_ospf6_topo1_vrf.py
+++ b/tests/topotests/ospf6_topo1_vrf/test_ospf6_topo1_vrf.py
@@ -252,7 +252,6 @@ def compare_show_ipv6_vrf(rname, expected):
 
 
 def test_ospfv3_routingTable():
-
     tgen = get_topogen()
     if tgen.routers_have_failure():
         pytest.skip("skipped because of router(s) failure")
@@ -274,7 +273,6 @@ def test_ospfv3_routingTable():
 
 
 def test_linux_ipv6_kernel_routingTable():
-
     # Required linux kernel version for this suite to run.
     result = required_linux_kernel_version("4.15")
     if result is not True:
@@ -376,7 +374,6 @@ def test_linux_ipv6_kernel_routingTable():
 
 
 def test_ospfv3_routingTable_write_multiplier():
-
     tgen = get_topogen()
     if tgen.routers_have_failure():
         pytest.skip("skipped because of router(s) failure")
@@ -405,7 +402,6 @@ def test_ospfv3_routingTable_write_multiplier():
 
 
 def test_shutdown_check_stderr():
-
     tgen = get_topogen()
 
     if tgen.routers_have_failure():
@@ -453,7 +449,6 @@ def test_shutdown_check_memleak():
 
 
 if __name__ == "__main__":
-
     # To suppress tracebacks, either use the following pytest call or
     # add "--tb=no" to cli
     # retval = pytest.main(["-s", "--tb=no"])
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
index c59852063..dfac2de2d 100644
--- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
+++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
@@ -129,7 +129,6 @@ def setup_module(mod):
 
     router_list = tgen.routers()
     for rname, router in router_list.items():
-
         daemon_file = "{}/{}/zebra.conf".format(CWD, rname)
         if os.path.isfile(daemon_file):
             router.load_config(TopoRouter.RD_ZEBRA, daemon_file)

To apply the style suggestions:

curl https://gist.githubusercontent.com/polychaeta/4dc8805d37d1584bdb72007e536e9fc9/raw/67fc8b7cfcda6c5b41bad95511967b4a0da31774/style.diff | git apply -

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.