From: Naveen Date: Mon, 13 Feb 2023 05:46:57 +0000 (+0530) Subject: tests: Enhance error msgs for static route auto. X-Git-Tag: base_9.0~280^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F12816%2Fhead;p=mirror%2Ffrr.git tests: Enhance error msgs for static route auto. tests: Enhance error messages for static route automation. Signed-off-by: nguggarigoud --- diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py index abfba029f4..056dc76b22 100644 --- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py +++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py @@ -220,7 +220,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes are missing in RIB".format(tc_name) step("Configure IBGP IPv4 peering between R2 and R3 router.") step("Configure redistribute static in BGP on R2 router") @@ -275,7 +275,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes is still present in RIB".format( + ), "Testcase {} : Failed Expected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -285,7 +285,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N1") @@ -306,7 +306,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): tc_name, result ) - step("Remove the static route configured with nexthop N2 from" "running config") + step("Remove the static route configured with nexthop N2 from running config") input_dict_4 = { "r2": { @@ -342,7 +342,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -352,7 +352,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N2") input_dict_4 = { @@ -385,7 +385,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = next_hop_ip["nh1"][addr_type] result = verify_rib( @@ -399,7 +399,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -409,7 +409,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -424,7 +424,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \n Expected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -435,20 +435,20 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -467,7 +467,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Shut nexthop interface N2") intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"] @@ -491,7 +491,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -503,20 +503,20 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -535,20 +535,20 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -568,13 +568,13 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -583,7 +583,7 @@ def test_static_route_2nh_p0_tc_1_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format( tc_name ) @@ -659,7 +659,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -687,7 +687,9 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are not active in RIB".format( + tc_name + ) step("Configure IBGP IPv4 peering between R2 and R3 router.") step("Explicit route is added in R3 for R2 nexthop rechability") @@ -728,7 +730,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): tc_name, result ) - step("Remove the static route configured with nexthop N1 from" "running config") + step("Remove the static route configured with nexthop N1 from running config") rt1_nh1 = { "r2": { "static_routes": [ @@ -778,7 +780,9 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are missing in RIB".format( + tc_name + ) rte2_nh2 = { "r2": { @@ -797,7 +801,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are not active in RIB".format(tc_name) step("Configure the static route with nexthop N1") rte1_nh1 = { @@ -817,7 +821,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): tc_name, result ) - step("Remove the static route configured with nexthop N2 from" "running config") + step("Remove the static route configured with nexthop N2 from running config") rte2_nh2 = { "r2": { "static_routes": [ @@ -852,7 +856,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -862,7 +866,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N2") rte2_nh2 = { @@ -902,7 +906,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -912,7 +916,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("No shut the nexthop interface N1") shutdown_bringup_interface(tgen, dut, intf, True) @@ -928,7 +932,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Shut nexthop interface N2") intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"] @@ -952,7 +956,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format( tc_name ) @@ -962,7 +966,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("No shut nexthop interface N2") shutdown_bringup_interface(tgen, dut, intf, True) @@ -990,7 +994,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -1018,7 +1022,9 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not active in RIB \nError: Routes are not active in RIB".format( + tc_name + ) dut = "r3" protocol = "bgp" @@ -1035,7 +1041,9 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format( + tc_name + ) dut = "r2" step("Reload the FRR router") @@ -1067,14 +1075,14 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) dut = "r3" protocol = "bgp" result = verify_bgp_rib(tgen, addr_type, dut, rte1_nh1, next_hop=nh) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -1102,14 +1110,16 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format( + tc_name + ) dut = "r3" protocol = "bgp" result = verify_bgp_rib(tgen, addr_type, dut, rte2_nh2, next_hop=nh) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are not active in RIB".format(tc_name) result = verify_rib( tgen, @@ -1123,7 +1133,9 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format( + tc_name + ) write_test_footer(tc_name) @@ -1195,7 +1207,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -1204,7 +1216,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -1259,9 +1271,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in BGP RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Route is missing in BGP RIB".format(tc_name) protocol = "bgp" result = verify_rib( @@ -1269,9 +1279,9 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) - step("Remove the static route on R3 configured with active" "interface") + step("Remove the static route on R3 configured with active interface") for addr_type in ADDR_TYPES: input_dict_4 = { "r3": { @@ -1306,9 +1316,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in BGP RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Route is missing in BGP RIB".format(tc_name) protocol = "bgp" result = verify_rib( @@ -1316,7 +1324,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) write_test_footer(tc_name) diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py index f04279a081..f437ac0d14 100644 --- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py +++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo2_ebgp.py @@ -294,7 +294,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -319,7 +319,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -366,7 +366,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed\nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed\nError: routes are still present in RIB".format( tc_name ) @@ -395,9 +395,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed\nError: Routes are" " missing in RIB".format( - tc_name - ) + ), "Testcase {} : Failed\nError: Routes are missing in RIB".format(tc_name) protocol = "static" step("Random shut of the nexthop interfaces") @@ -405,7 +403,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): # Shutdown interface dut = "r2" step( - " interface which is about to be shut no shut between r1 and r2 is " "%s", + " interface which is about to be shut no shut between r1 and r2 is %s", topo["routers"]["r2"]["links"]["r1-link{}".format(randnum)]["interface"], ) intf = topo["routers"]["r2"]["links"]["r1-link{}".format(randnum)]["interface"] @@ -443,7 +441,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Remove random static route with all the nexthop") dut = "r2" @@ -482,7 +480,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) for addr_type in ADDR_TYPES: input_dict_4 = { @@ -536,7 +534,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Remove the redistribute static knob") for addr_type in ADDR_TYPES: @@ -571,7 +569,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -655,7 +653,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): @@ -673,7 +671,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -718,9 +716,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) step("Configure the static route with nexthop N1 to N8, one by one") @@ -768,7 +764,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type]) @@ -785,7 +781,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -814,7 +810,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -828,7 +824,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) dut = "r2" protocol = "static" @@ -837,7 +833,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {}: Failed \n " "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {}: Failed \n Error: Routes are missing in RIB".format(tc_name) protocol = "bgp" dut = "r3" @@ -846,7 +842,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {}: Failed \n " "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {}: Failed \n Error: Routes are missing in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -859,7 +855,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -958,7 +954,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): @@ -975,7 +971,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -1020,9 +1016,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) step("Configure the static route with nexthop N1 to N8, one by one") @@ -1070,7 +1064,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type]) @@ -1086,7 +1080,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -1115,7 +1109,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -1129,7 +1123,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) dut = "r2" protocol = "static" @@ -1145,7 +1139,7 @@ def test_static_route_8nh_diff_AD_ebgp_ecmp_p1_tc8_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -1244,7 +1238,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Verify that highest AD nexthop are inactive") nh = [] @@ -1263,7 +1257,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -1327,7 +1321,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -1358,15 +1352,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): " value and all the nexthop populated in RIB and FIB again" ) for addr_type in ADDR_TYPES: - input_dict_4 = { - "r2": { - "static_routes": [ - { - "network": PREFIX1[addr_type], - } - ] - } - } + input_dict_4 = {"r2": {"static_routes": [{"network": PREFIX1[addr_type]}]}} nh = NEXT_HOP_IP["nh1"][addr_type] result = verify_rib( tgen, addr_type, dut, input_dict_4, next_hop=nh, protocol=protocol, fib=True @@ -1403,7 +1389,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -1417,7 +1403,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Remove random static route with all the nexthop") for addr_type in ADDR_TYPES: @@ -1507,9 +1493,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Route " " is missing in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -1605,7 +1589,7 @@ def test_static_route_delete_p0_tc11_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Verify that highest AD nexthop are inactive") nh = [] @@ -1623,7 +1607,7 @@ def test_static_route_delete_p0_tc11_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -1677,7 +1661,7 @@ def test_static_route_delete_p0_tc11_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -1748,7 +1732,7 @@ def test_static_route_delete_p0_tc11_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still active in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still active in RIB".format( tc_name ) diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py index 088ac600c1..2f16406ec4 100644 --- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py +++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py @@ -275,7 +275,7 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: input_dict_2 = { @@ -330,11 +330,11 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) - step("Configure the static route with nexthop N1 to N8, one by" "one") + step("Configure the static route with nexthop N1 to N8, one by one") for addr_type in ADDR_TYPES: # add static routes @@ -361,7 +361,7 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -390,7 +390,7 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -404,7 +404,7 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -416,7 +416,7 @@ def test_staticroute_with_ecmp_p0_tc3_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -605,11 +605,9 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) - step("Configure the static route with nexthop N1 to N8, one by" "one") + step("Configure the static route with nexthop N1 to N8, one by one") for addr_type in ADDR_TYPES: # add static routes for nhp in range(1, 9): @@ -698,7 +696,7 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ebgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -712,7 +710,7 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -825,7 +823,7 @@ def test_bgp_local_nexthop_p1_tc14_ebgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB of R2".format( + ), "Testcase {} : Failed \nError: routes are missing in RIB of R2".format( tc_name ) @@ -833,13 +831,13 @@ def test_bgp_local_nexthop_p1_tc14_ebgp(request): dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4, expected=False) assert result is not True, ( - "Testcase {} : Failed \nError: Routes is" + "Testcase {} : Failed \nError: routes are" " still present in BGP RIB of R2".format(tc_name) ) result = verify_rib(tgen, addr_type, dut, input_dict_4, expected=False) assert result is not True, ( - "Testcase {} : Failed \nError: Routes is" + "Testcase {} : Failed \nError: routes are" " still present in RIB of R2".format(tc_name) ) @@ -903,7 +901,7 @@ def test_frr_intf_name_as_gw_gap_tc4_ebgp_p0(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) input_dict_nh = { "r1": { @@ -917,7 +915,7 @@ def test_frr_intf_name_as_gw_gap_tc4_ebgp_p0(request): result = verify_ip_nht(tgen, input_dict_nh) assert ( result is True - ), "Testcase {} : Failed \nError: Nexthop is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Nexthop is missing in RIB".format(tc_name) step( "Shut / no shut IPv4 and IPv6 static next hop interface from" @@ -941,7 +939,7 @@ def test_frr_intf_name_as_gw_gap_tc4_ebgp_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) shutdown_bringup_interface(tgen, dut, intf, True) @@ -987,9 +985,7 @@ def test_frr_intf_name_as_gw_gap_tc4_ebgp_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes still present in RIB".format(tc_name) write_test_footer(tc_name) @@ -1015,7 +1011,7 @@ def test_static_route_with_tag_p0_tc_13_ebgp(request): "Configure 2 IPv4 static route (S1 and S2) in R2 with same" "next hop N1 28.1.1.2" ) - step("Configure static route S1 with tag 1 and static route S2 with" "tag2") + step("Configure static route S1 with tag 1 and static route S2 with tag2") step("S1= ip route 10.1.1.1/24 28.1.1.2 tag 1") step("S2= ip route 20.1.1.1/24 28.1.1.2 tag 2") step("Enable redistribute static in BGP with route-map") @@ -1054,7 +1050,7 @@ def test_static_route_with_tag_p0_tc_13_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure route-map on R2 with allow tag1 and deny tag2") @@ -1242,7 +1238,7 @@ def test_static_route_with_tag_p0_tc_13_ebgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("shut/no shut of tag1 and tag2 nexthop") diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo4_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo4_ebgp.py index 3f49ced7ca..8f6365cbe9 100644 --- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo4_ebgp.py +++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo4_ebgp.py @@ -217,12 +217,12 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ebgp(request): ) clear_bgp(tgen, addr_type, "r2") - step(" All BGP nbrs are down as authentication is mismatch on both" " the sides") + step(" All BGP nbrs are down as authentication is mismatch on both the sides") bgp_convergence = verify_bgp_convergence(tgen, topo, expected=False) assert ( bgp_convergence is not True - ), "Testcase {} : " "Failed \n BGP nbrs must be down. Error: {}".format( + ), "Testcase {} : Failed \n BGP nbrs must be down. Error: {}".format( tc_name, bgp_convergence ) @@ -269,7 +269,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ebgp(request): step("All BGP nbrs are up as authentication is matched now") bgp_convergence = verify_bgp_convergence(tgen, topo) - assert bgp_convergence is True, "Testcase {} : Failed \n " "Error: {}".format( + assert bgp_convergence is True, "Testcase {} : Failed \n Error: {}".format( tc_name, bgp_convergence ) @@ -319,7 +319,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ebgp(request): "show ip prefix list" ) result = verify_prefix_lists(tgen, input_dict_2) - assert result is not True, "Testcase {} : Failed \n" " Error: {}".format( + assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) @@ -422,7 +422,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ebgp(request): tc_name, result ) - step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from " "frr r1") + step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from frr r1") # Configure prefix list to bgp neighbor input_dict_4 = { "r2": { @@ -936,7 +936,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ebgp(request): ) assert ( result4 is not True - ), "Testcase {} : Failed \n" "routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n routes are still present \n Error: {}".format( tc_name, result4 ) diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo1_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo1_ibgp.py index 6b7b2adfd9..bc344309a1 100644 --- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo1_ibgp.py +++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo1_ibgp.py @@ -219,7 +219,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Configure IBGP IPv4 peering between R2 and R3 router.") step("Configure redistribute static in BGP on R2 router") @@ -274,7 +274,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -284,7 +284,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N1") @@ -341,7 +341,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -351,7 +351,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N2") input_dict_4 = { @@ -384,7 +384,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) nh = NEXT_HOP_IP["nh1"][addr_type] result = verify_rib( @@ -398,7 +398,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -408,7 +408,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -423,7 +423,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -434,20 +434,20 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -466,7 +466,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Shut nexthop interface N2") intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"] @@ -490,7 +490,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -502,20 +502,20 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -534,20 +534,20 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name) result = verify_rib( tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -567,13 +567,13 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -582,7 +582,7 @@ def test_static_route_2nh_p0_tc_1_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Route is still present in RIB".format( tc_name ) @@ -658,7 +658,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -686,7 +686,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) step("Configure IBGP IPv4 peering between R2 and R3 router.") step("Explicit route is added in R3 for R2 nexthop rechability") @@ -777,7 +777,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -796,7 +796,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) step("Configure the static route with nexthop N1") rte1_nh1 = { @@ -851,7 +851,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -861,7 +861,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Configure the static route with nexthop N2") rte2_nh2 = { @@ -901,7 +901,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -911,7 +911,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("No shut the nexthop interface N1") shutdown_bringup_interface(tgen, dut, intf, True) @@ -927,7 +927,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("Shut nexthop interface N2") intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"] @@ -951,7 +951,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed \nError: routes are still present in RIB".format( tc_name ) @@ -961,7 +961,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) step("No shut nexthop interface N2") shutdown_bringup_interface(tgen, dut, intf, True) @@ -989,7 +989,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -1017,7 +1017,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) dut = "r3" protocol = "bgp" @@ -1034,7 +1034,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) dut = "r2" step("Reload the FRR router") @@ -1066,14 +1066,14 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) dut = "r3" protocol = "bgp" result = verify_bgp_rib(tgen, addr_type, dut, rte1_nh1, next_hop=nh) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name) rte2_nh2 = { "r2": { @@ -1101,14 +1101,14 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) dut = "r3" protocol = "bgp" result = verify_bgp_rib(tgen, addr_type, dut, rte2_nh2, next_hop=nh) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) result = verify_rib( tgen, @@ -1122,7 +1122,7 @@ def test_static_route_2nh_admin_dist_p0_tc_2_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name) write_test_footer(tc_name) diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py index 350a117b94..12235ca605 100644 --- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py +++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo2_ibgp.py @@ -296,7 +296,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -321,7 +321,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -368,7 +368,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed\nError: Routes is" " still present in RIB".format( + ), "Testcase {} : Failed\nError: routes are still present in RIB".format( tc_name ) @@ -397,9 +397,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed\nError: Routes are" " missing in RIB".format( - tc_name - ) + ), "Testcase {} : Failed\nError: Routes are missing in RIB".format(tc_name) protocol = "static" step("Random shut of the nexthop interfaces") @@ -445,7 +443,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Remove random static route with all the nexthop") dut = "r2" @@ -484,7 +482,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) for addr_type in ADDR_TYPES: input_dict_4 = { @@ -538,7 +536,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Remove the redistribute static knob") for addr_type in ADDR_TYPES: @@ -573,7 +571,7 @@ def test_static_rte_with_8ecmp_nh_p1_tc9_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -657,7 +655,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): @@ -675,7 +673,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are present in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are present in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -720,9 +718,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) step("Configure the static route with nexthop N1 to N8, one by one") @@ -770,7 +766,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type]) @@ -787,7 +783,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -816,7 +812,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -830,7 +826,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) protocol = "bgp" # this is next hop reachability route in r3 as we are using ibgp @@ -857,7 +853,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc6_ibgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) protocol = "static" dut = "r2" @@ -1064,7 +1060,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): @@ -1081,7 +1077,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step( "Remove the static route configured with nexthop N1 to N8, one" @@ -1126,9 +1122,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) step("Configure the static route with nexthop N1 to N8, one by one") @@ -1176,7 +1170,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) nh = [] for nhp in range(2, 9): nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type]) @@ -1192,7 +1186,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -1221,7 +1215,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -1235,7 +1229,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) dut = "r2" protocol = "bgp" @@ -1264,7 +1258,7 @@ def test_static_route_8nh_diff_AD_ibgp_ecmp_p1_tc7_ibgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) protocol = "static" dut = "r2" @@ -1471,7 +1465,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Verify that highest AD nexthop are inactive") nh = [] @@ -1490,7 +1484,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -1554,7 +1548,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -1585,15 +1579,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): " value and all the nexthop populated in RIB and FIB again" ) for addr_type in ADDR_TYPES: - input_dict_4 = { - "r2": { - "static_routes": [ - { - "network": PREFIX1[addr_type], - } - ] - } - } + input_dict_4 = {"r2": {"static_routes": [{"network": PREFIX1[addr_type]}]}} nh = NEXT_HOP_IP["nh1"][addr_type] result = verify_rib( tgen, addr_type, dut, input_dict_4, next_hop=nh, protocol=protocol, fib=True @@ -1630,7 +1616,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -1644,7 +1630,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Remove random static route with all the nexthop") for addr_type in ADDR_TYPES: @@ -1780,7 +1766,7 @@ def test_static_route_8nh_diff_AD_bgp_ecmp_p1_tc10_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -1878,7 +1864,7 @@ def test_static_route_delete_p0_tc11_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Verify that highest AD nexthop are inactive") nh = [] @@ -1896,7 +1882,7 @@ def test_static_route_delete_p0_tc11_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: @@ -1950,7 +1936,7 @@ def test_static_route_delete_p0_tc11_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) @@ -2021,7 +2007,7 @@ def test_static_route_delete_p0_tc11_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still active in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still active in RIB".format( tc_name ) diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py index cdd7e13f75..1a5122cd71 100644 --- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py +++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py @@ -274,7 +274,7 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Configure redistribute static in BGP on R2 router") for addr_type in ADDR_TYPES: input_dict_2 = { @@ -329,11 +329,11 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format( tc_name ) - step("Configure the static route with nexthop N1 to N8, one by" "one") + step("Configure the static route with nexthop N1 to N8, one by one") for addr_type in ADDR_TYPES: # add static routes @@ -360,7 +360,7 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) step("Random shut of the nexthop interfaces") randnum = random.randint(0, 7) @@ -389,7 +389,7 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -403,7 +403,7 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -415,7 +415,7 @@ def test_staticroute_with_ecmp_p0_tc3_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name) + ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -604,11 +604,9 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name) - step("Configure the static route with nexthop N1 to N8, one by" "one") + step("Configure the static route with nexthop N1 to N8, one by one") for addr_type in ADDR_TYPES: # add static routes for nhp in range(1, 9): @@ -697,7 +695,7 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ibgp(request): ) assert ( result is not True - ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format( + ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format( tc_name ) @@ -711,7 +709,7 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ibgp(request): ) assert ( result is True - ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name) + ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -865,7 +863,7 @@ def test_bgp_local_nexthop_p1_tc14_ibgp(request): result = verify_rib(tgen, addr_type, dut, input_dict_4) assert ( result is True - ), "Testcase {} : Failed \nError: Routes is" " missing in RIB of R2".format( + ), "Testcase {} : Failed \nError: routes are missing in RIB of R2".format( tc_name ) @@ -873,13 +871,13 @@ def test_bgp_local_nexthop_p1_tc14_ibgp(request): dut = "r3" result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4, expected=False) assert result is not True, ( - "Testcase {} : Failed \nError: Routes is" + "Testcase {} : Failed \nError: routes are" " still present in BGP RIB of R2".format(tc_name) ) result = verify_rib(tgen, addr_type, dut, input_dict_4, expected=False) assert result is not True, ( - "Testcase {} : Failed \nError: Routes is" + "Testcase {} : Failed \nError: routes are" " still present in RIB of R2".format(tc_name) ) diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py index d5e5148eae..7412d0740e 100644 --- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py +++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py @@ -213,12 +213,12 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request): ) clear_bgp(tgen, addr_type, "r2") - step(" All BGP nbrs are down as authentication is mismatch on both" " the sides") + step(" All BGP nbrs are down as authentication is mismatch on both the sides") bgp_convergence = verify_bgp_convergence(tgen, topo, expected=False) assert ( bgp_convergence is not True - ), "Testcase {} : " "Failed \n BGP nbrs must be down. Error: {}".format( + ), "Testcase {} : Failed \n BGP nbrs must be down. Error: {}".format( tc_name, bgp_convergence ) @@ -265,7 +265,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request): step("All BGP nbrs are up as authentication is matched now") bgp_convergence = verify_bgp_convergence(tgen, topo) - assert bgp_convergence is True, "Testcase {} : Failed \n " "Error: {}".format( + assert bgp_convergence is True, "Testcase {} : Failed \n Error: {}".format( tc_name, bgp_convergence ) @@ -315,7 +315,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request): "show ip prefix list" ) result = verify_prefix_lists(tgen, input_dict_2) - assert result is not True, "Testcase {} : Failed \n" " Error: {}".format( + assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) @@ -418,7 +418,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request): tc_name, result ) - step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from " "frr r1") + step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from frr r1") # Configure prefix list to bgp neighbor input_dict_4 = { "r2": { @@ -932,7 +932,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request): ) assert ( result4 is not True - ), "Testcase {} : Failed \n" "routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n routes are still present \n Error: {}".format( tc_name, result4 )