diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py index 3d15e94a51..9d7a15833c 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py @@ -140,7 +140,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -260,11 +260,9 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf": { @@ -290,7 +288,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -306,7 +304,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Change the summary address mask to lower match (ex - 16 to 8)") ospf_summ_r1 = { @@ -334,7 +332,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step( "Verify that external routes(static / connected) are summarised" @@ -350,7 +348,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Change the summary address mask to higher match (ex - 8 to 24)") ospf_summ_r1 = { @@ -378,7 +376,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step( "Verify that external routes(static / connected) are summarised" @@ -399,7 +397,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step(" Un configure one of the summary address.") ospf_summ_r1 = { @@ -432,7 +430,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) ospf_summ_r1 = { "r0": { @@ -459,7 +457,7 @@ def test_ospf_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -506,11 +504,9 @@ def test_ospf_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { @@ -538,7 +534,7 @@ def test_ospf_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -554,26 +550,26 @@ def test_ospf_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step( "Configure route map and & rule to permit configured summary address," @@ -635,7 +631,7 @@ def test_ospf_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) input_dict = { SUMMARY["ipv4"][0]: { @@ -650,7 +646,7 @@ def test_ospf_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) write_test_footer(tc_name) @@ -697,7 +693,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step( "Configure External Route summary in R0 to summarise 5" @@ -731,7 +727,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -747,26 +743,26 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB" + "Error: Routes still present in RIB".format(tc_name) + ) step("Delete the configured summary") ospf_summ_r1 = { @@ -789,19 +785,17 @@ def test_ospf_type5_summary_tc42_p0(request): step("Verify that summary lsa is withdrawn from R1 and deleted from R0.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name + assert result is not True, ( + "Testcase {} : Failed \n Expected: Summary Route should not present in RIB" + "Error: Summary Route still present in RIB".format(tc_name) ) step("show ip ospf summary should not have any summary address.") @@ -816,9 +810,10 @@ def test_ospf_type5_summary_tc42_p0(request): } dut = "r0" result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Summary Route should not present in OSPF DB" + "Error: Summary still present in DB".format(tc_name) + ) dut = "r1" step("All 5 routes are advertised after deletion of configured summary.") @@ -829,7 +824,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("configure the summary again and delete static routes .") ospf_summ_r1 = { @@ -857,7 +852,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) input_dict = { "r0": { @@ -874,18 +869,18 @@ def test_ospf_type5_summary_tc42_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Add back static routes.") input_dict_static_rtes = { @@ -901,18 +896,18 @@ def test_ospf_type5_summary_tc42_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_static_rtes, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB" + "Error: Routes still present in RIB".format(tc_name) + ) input_dict_summary = {"r0": {"static_routes": [{"network": SUMMARY["ipv4"][0]}]}} dut = "r1" @@ -923,7 +918,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show configure summaries.") @@ -940,7 +935,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Configure new static route which is matching configured summary.") input_dict_static_rtes = { @@ -1004,7 +999,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Shut one of the interface") intf = topo["routers"]["r0"]["links"]["r3-link0"]["interface"] @@ -1076,7 +1071,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) input_dict_summary = {"r0": {"static_routes": [{"network": SUMMARY["ipv4"][0]}]}} @@ -1087,7 +1082,7 @@ def test_ospf_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) ospf_summ_r1 = { "r0": { @@ -1113,18 +1108,18 @@ def test_ospf_type5_summary_tc42_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB" + "Error: Routes still present in RIB".format(tc_name) + ) ospf_summ_r1 = { "r0": { @@ -1188,11 +1183,9 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf": { @@ -1224,7 +1217,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1240,7 +1233,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary") ospf_summ_r1 = { @@ -1263,19 +1256,17 @@ def test_ospf_type5_summary_tc45_p0(request): step("Verify that summary lsa is withdrawn from R1 and deleted from R0.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name + assert result is not True, ( + "Testcase {} : Failed \n Expected: Summary Routes should not be present in RIB. \n" + "Error: Summary Route still present in RIB".format(tc_name) ) step("show ip ospf summary should not have any summary address.") @@ -1292,7 +1283,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary still present in DB".format(tc_name) step("Configure Min tag value") ospf_summ_r1 = { @@ -1317,7 +1308,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1333,7 +1324,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Configure Max Tag Value") ospf_summ_r1 = { @@ -1363,7 +1354,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1382,7 +1373,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("configure new static route with different tag.") input_dict_static_rtes_11 = { @@ -1403,10 +1394,9 @@ def test_ospf_type5_summary_tc45_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, tag="88888", expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( @@ -1418,9 +1408,10 @@ def test_ospf_type5_summary_tc45_p0(request): tag="88888", expected=False, ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step( "Verify that boundary values tags are used for summary route" @@ -1439,7 +1430,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary address") ospf_summ_r1 = { @@ -1470,24 +1461,24 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that summary address is flushed from neighbor.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Configure summary first & then configure matching static route.") @@ -1589,7 +1580,7 @@ def test_ospf_type5_summary_tc45_p0(request): assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -1619,11 +1610,9 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf": { @@ -1655,7 +1644,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1691,19 +1680,17 @@ def test_ospf_type5_summary_tc45_p0(request): step("Verify that summary lsa is withdrawn from R1 and deleted from R0.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB " + "Error: Summary Route still present in RIB".format(tc_name) ) step("show ip ospf summary should not have any summary address.") @@ -1720,7 +1707,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary still present in DB".format(tc_name) step("Configure Min tag value") ospf_summ_r1 = { @@ -1745,7 +1732,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1761,7 +1748,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Configure Max Tag Value") ospf_summ_r1 = { @@ -1791,7 +1778,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1810,7 +1797,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("configure new static route with different tag.") input_dict_static_rtes_11 = { @@ -1831,10 +1818,9 @@ def test_ospf_type5_summary_tc45_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, tag="88888", expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( @@ -1846,9 +1832,10 @@ def test_ospf_type5_summary_tc45_p0(request): tag="88888", expected=False, ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB.\n" + "Error: Routes still present in RIB".format(tc_name) + ) step( "Verify that boundary values tags are used for summary route" @@ -1867,7 +1854,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary address") ospf_summ_r1 = { @@ -1898,24 +1885,24 @@ def test_ospf_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that summary address is flushed from neighbor.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB \n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Configure summary first & then configure matching static route.") @@ -1999,7 +1986,7 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step( "Configure External Route summary in R0 to summarise 5" @@ -2031,20 +2018,20 @@ def test_ospf_type5_summary_tc46_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB.\n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB." + "Error: Routes still present in RIB".format(tc_name) + ) - step("Verify that show ip ospf summary should show the " "configured summaries.") + step("Verify that show ip ospf summary should show the configured summaries.") input_dict = { SUMMARY["ipv4"][0]: { "summaryAddress": SUMMARY["ipv4"][0], @@ -2055,7 +2042,7 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary") ospf_summ_r1 = { @@ -2080,10 +2067,9 @@ def test_ospf_type5_summary_tc46_p0(request): step("Verify that summary lsa is withdrawn from R1 and deleted from R0.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( @@ -2091,9 +2077,7 @@ def test_ospf_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed. Error: Summary Route still present in RIB".format(tc_name) step("show ip ospf summary should not have any summary address.") input_dict = { @@ -2109,7 +2093,7 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary still present in DB".format(tc_name) step("Reconfigure summary with no advertise.") ospf_summ_r1 = { @@ -2138,20 +2122,20 @@ def test_ospf_type5_summary_tc46_p0(request): dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB \n" + "Error: Routes still present in RIB".format(tc_name) + ) - step("Verify that show ip ospf summary should show the " "configured summaries.") + step("Verify that show ip ospf summary should show the configured summaries.") input_dict = { SUMMARY["ipv4"][0]: { "summaryAddress": SUMMARY["ipv4"][0], @@ -2162,7 +2146,7 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step( "Change summary address from no advertise to advertise " @@ -2211,7 +2195,7 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2227,26 +2211,26 @@ def test_ospf_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes is present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB" + "Error: Routes is present in RIB".format(tc_name) + ) write_test_footer(tc_name) @@ -2293,11 +2277,9 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { @@ -2325,7 +2307,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2341,26 +2323,26 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n \n Expected: Routes should not be present in OSPF RIB.\n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB.\n" + "Error: Routes still present in RIB".format(tc_name) + ) step( "configure route map and add rule to permit configured static " @@ -2423,7 +2405,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) input_dict = { SUMMARY["ipv4"][0]: { @@ -2461,18 +2443,18 @@ def test_ospf_type5_summary_tc47_p0(request): step("Verify that advertised summary route is flushed from neighbor.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB\n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in RIB.\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Delete the configured route map.") @@ -2511,7 +2493,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) input_dict = { SUMMARY["ipv4"][0]: { @@ -2526,7 +2508,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Reconfigure the route map with denying configure summary address.") @@ -2570,7 +2552,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Redistribute static/connected routes without route map.") @@ -2606,7 +2588,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) input_dict = { SUMMARY["ipv4"][0]: { @@ -2621,7 +2603,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step( "Configure rule to deny all the routes in route map and configure" @@ -2672,18 +2654,18 @@ def test_ospf_type5_summary_tc47_p0(request): step("Verify that no summary route is originated.") dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict_summary, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB.\n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict_summary, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB" + "Error: Routes still present in RIB".format(tc_name) + ) routemaps = { "r0": { @@ -2773,7 +2755,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2789,7 +2771,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Change route map rule for 1 of the routes to deny.") # Create ip prefix list @@ -2822,7 +2804,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("add rule in route map to deny configured summary address.") # Create ip prefix list @@ -2855,7 +2837,7 @@ def test_ospf_type5_summary_tc47_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -2995,7 +2977,7 @@ def test_ospf_type5_summary_tc51_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) write_test_footer(tc_name) @@ -3042,11 +3024,9 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { @@ -3074,7 +3054,7 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -3090,26 +3070,26 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB.\n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB.\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -3130,7 +3110,7 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -3146,26 +3126,26 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("Kill OSPFd daemon on R0.") kill_router_daemons(tgen, "r0", ["ospfd"]) @@ -3176,7 +3156,7 @@ def test_ospf_type5_summary_tc49_p2(request): step("Verify OSPF neighbors are up after bringing back ospfd in R0") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -3194,7 +3174,7 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -3210,26 +3190,26 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed \n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB\n" + "Error: Routes still present in RIB".format(tc_name) + ) step("restart zebrad") kill_router_daemons(tgen, "r0", ["zebra"]) @@ -3251,7 +3231,7 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -3267,26 +3247,26 @@ def test_ospf_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv4"], "next_hop": "blackhole"}]} } dut = "r1" result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert ( - result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( - tc_name, result + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in OSPF RIB. \n Error: " + "Routes still present in OSPF RIB {}".format(tc_name, result) ) result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, expected=False ) - assert ( - result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + assert result is not True, ( + "Testcase {} : Failed\n Expected: Routes should not be present in RIB.\n" + "Error: Routes still present in RIB".format(tc_name) + ) write_test_footer(tc_name) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_type7_lsa.py b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_type7_lsa.py index cff59c3a40..603aeadb85 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_type7_lsa.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_type7_lsa.py @@ -132,7 +132,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -235,11 +235,9 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r0 = { "r0": { @@ -259,9 +257,7 @@ def test_ospf_type5_summary_tc44_p0(request): "route is sent to R1." ) - step( - "Configure summary & redistribute static/connected route with " "metric type 2" - ) + step("Configure summary & redistribute static/connected route with metric type 2") input_dict_summary = {"r0": {"static_routes": [{"network": SUMMARY["ipv4"][3]}]}} dut = "r1" @@ -272,7 +268,7 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -288,7 +284,7 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Learn type 7 lsa from neighbours") @@ -312,7 +308,7 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_rib(tgen, "ipv4", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed. Error: Routes is missing in RIB".format(tc_name) ospf_summ_r0 = { "r0": { @@ -340,7 +336,7 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) step("Verify that already originated summary is intact.") input_dict = { @@ -356,7 +352,7 @@ def test_ospf_type5_summary_tc44_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict) assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed. Error: Summary missing in OSPF DB".format(tc_name) dut = "r1" aggr_timer = {"r1": {"ospf": {"aggr_timer": 6}}} diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py index 40df0b2308..88219b8400 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py @@ -100,7 +100,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -166,7 +166,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): step("Verify that the neighbour is not FULL between R1 and R2.") dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -192,7 +192,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -223,7 +223,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): ospf_covergence = verify_ospf_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=10 ) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -245,7 +245,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -260,7 +260,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): "show ip ospf neighbor cmd." ) ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -274,7 +274,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -314,7 +314,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request): dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -361,7 +361,7 @@ def test_ospf_authentication_md5_tc29_p1(request): ospf_covergence = verify_ospf_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=6 ) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -393,7 +393,7 @@ def test_ospf_authentication_md5_tc29_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -426,7 +426,7 @@ def test_ospf_authentication_md5_tc29_p1(request): ospf_covergence = verify_ospf_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=10 ) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -454,7 +454,7 @@ def test_ospf_authentication_md5_tc29_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -469,7 +469,7 @@ def test_ospf_authentication_md5_tc29_p1(request): "show ip ospf neighbor cmd." ) ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -483,7 +483,7 @@ def test_ospf_authentication_md5_tc29_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -528,7 +528,7 @@ def test_ospf_authentication_md5_tc29_p1(request): dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -576,7 +576,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): ospf_covergence = verify_ospf_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=10 ) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -608,7 +608,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -655,7 +655,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -687,7 +687,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -720,7 +720,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -765,7 +765,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -810,7 +810,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_chaos.py b/tests/topotests/ospf_basic_functionality/test_ospf_chaos.py index 124b36a5fa..e58f081f96 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_chaos.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_chaos.py @@ -111,7 +111,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -177,7 +177,7 @@ def test_ospf_chaos_tc31_p1(request): step("Verify OSPF neighbors after base config is done.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -198,7 +198,7 @@ def test_ospf_chaos_tc31_p1(request): dut = "r0" # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -208,7 +208,7 @@ def test_ospf_chaos_tc31_p1(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -217,7 +217,7 @@ def test_ospf_chaos_tc31_p1(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -227,7 +227,7 @@ def test_ospf_chaos_tc31_p1(request): step("Verify OSPF neighbors are up after bringing back ospfd in R0") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -250,7 +250,7 @@ def test_ospf_chaos_tc31_p1(request): dut = "r1" # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf_covergence is not True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -260,7 +260,7 @@ def test_ospf_chaos_tc31_p1(request): step("Verify OSPF neighbors are up after bringing back ospfd in R1") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -316,7 +316,7 @@ def test_ospf_chaos_tc32_p1(request): step("Verify OSPF neighbors after base config is done.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -338,7 +338,7 @@ def test_ospf_chaos_tc32_p1(request): step("Verify OSPF neighbors are up after restarting R0") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -361,7 +361,7 @@ def test_ospf_chaos_tc32_p1(request): step("Verify OSPF neighbors are up after restarting R1") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -421,7 +421,7 @@ def test_ospf_chaos_tc34_p1(request): step("Verify OSPF neighbors after base config is done.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -444,7 +444,7 @@ def test_ospf_chaos_tc34_p1(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -453,7 +453,7 @@ def test_ospf_chaos_tc34_p1(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -463,7 +463,7 @@ def test_ospf_chaos_tc34_p1(request): step("Verify OSPF neighbors are up after bringing back ospfd in R0") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -488,7 +488,7 @@ def test_ospf_chaos_tc34_p1(request): step("Verify OSPF neighbors are up after bringing back ospfd in R1") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py index d58e2503ed..aba313db9f 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py @@ -114,7 +114,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -168,7 +168,7 @@ def test_ospf_ecmp_tc16_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -217,7 +217,7 @@ def test_ospf_ecmp_tc16_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, next_hop=nh, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -227,7 +227,7 @@ def test_ospf_ecmp_tc16_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -259,7 +259,7 @@ def test_ospf_ecmp_tc16_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -286,7 +286,7 @@ def test_ospf_ecmp_tc16_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -303,7 +303,7 @@ def test_ospf_ecmp_tc16_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -343,7 +343,7 @@ def test_ospf_ecmp_tc17_p0(request): step("Verify that OSPF is up with 2 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -394,7 +394,7 @@ def test_ospf_ecmp_tc17_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -411,7 +411,7 @@ def test_ospf_ecmp_tc17_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py index 6a565571be..1eeb23e9f7 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py @@ -115,7 +115,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -169,7 +169,7 @@ def test_ospf_lan_ecmp_tc18_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -222,7 +222,7 @@ def test_ospf_lan_ecmp_tc18_p0(request): dut = "r0" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -231,7 +231,7 @@ def test_ospf_lan_ecmp_tc18_p0(request): dut = "r2" ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -261,7 +261,7 @@ def test_ospf_lan_ecmp_tc18_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -278,7 +278,7 @@ def test_ospf_lan_ecmp_tc18_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_lan.py b/tests/topotests/ospf_basic_functionality/test_ospf_lan.py index 53b1be6d71..c166702958 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_lan.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_lan.py @@ -114,7 +114,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -196,9 +196,7 @@ def test_ospf_lan_tc1_p0(request): result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Configure DR pririty 100 on R0 and clear ospf neighbors " "on all the routers." - ) + step("Configure DR pririty 100 on R0 and clear ospf neighbors on all the routers.") input_dict = { "r0": { @@ -234,9 +232,7 @@ def test_ospf_lan_tc1_p0(request): result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Configure DR pririty 150 on R0 and clear ospf neighbors " "on all the routers." - ) + step("Configure DR pririty 150 on R0 and clear ospf neighbors on all the routers.") input_dict = { "r0": { @@ -355,7 +351,7 @@ def test_ospf_lan_tc1_p0(request): result = verify_ospf_neighbor(tgen, topo, dut, lan=True, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r0: OSPF neighbors-hip is up \n Error: {}".format( + ), "Testcase {} : Failed \n r0: OSPF neighbors-hip is up \n Error: {}".format( tc_name, result ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py index 0c4697cc21..d669e21d4d 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py @@ -112,7 +112,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -220,11 +220,11 @@ def test_ospf_learning_tc15_p0(request): assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) - step("Change area 1 as non nssa area (on the fly changing area" " type on DUT).") + step("Change area 1 as non nssa area (on the fly changing area type on DUT).") for rtr in ["r1", "r2", "r3"]: input_dict = { diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py b/tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py index dad6d915e8..c9f43cdfe4 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_routemaps.py @@ -127,7 +127,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -201,9 +201,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): redistribute_ospf(tgen, topo, "r0", "static", delete=True) - step( - "Create prefix-list in R0 to permit 10.0.20.1/32 prefix &" " deny 10.0.20.2/32" - ) + step("Create prefix-list in R0 to permit 10.0.20.1/32 prefix & deny 10.0.20.2/32") # Create ip prefix list pfx_list = { @@ -294,7 +292,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -303,7 +301,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are present in fib \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are present in fib \n Error: {}".format( tc_name, result ) @@ -347,7 +345,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -356,7 +354,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -404,7 +402,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -413,7 +411,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -464,7 +462,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, retry_timeout=4, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -479,7 +477,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -499,7 +497,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -508,7 +506,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -523,7 +521,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -532,7 +530,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -553,7 +551,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): result = verify_ospf_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: OSPF routes are present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: OSPF routes are present \n Error: {}".format( tc_name, result ) @@ -562,7 +560,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n " "r1: routes are still present \n Error: {}".format( + ), "Testcase {} : Failed \n r1: routes are still present \n Error: {}".format( tc_name, result ) @@ -861,7 +859,7 @@ def test_ospf_routemaps_functionality_tc24_p0(request): result = verify_prefix_lists(tgen, pfx_list) assert ( result is not True - ), "Testcase {} : Failed \n Prefix list not " "present. Error: {}".format( + ), "Testcase {} : Failed \n Prefix list not present. Error: {}".format( tc_name, result ) @@ -930,7 +928,7 @@ def test_ospf_routemaps_functionality_tc24_p0(request): result = verify_prefix_lists(tgen, pfx_list) assert ( result is not True - ), "Testcase {} : Failed \n Prefix list not " "present. Error: {}".format( + ), "Testcase {} : Failed \n Prefix list not present. Error: {}".format( tc_name, result ) @@ -1078,7 +1076,7 @@ def test_ospf_routemaps_functionality_tc25_p0(request): # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py index 63c421ec84..f0950a2db3 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py @@ -123,7 +123,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -171,7 +171,7 @@ def test_ospf_redistribution_tc5_p0(request): step("Verify that OSPF neighbors are FULL.") ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -295,7 +295,7 @@ def test_ospf_redistribution_tc6_p0(request): step("Verify that OSPF neighbors are FULL.") ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -524,7 +524,7 @@ def test_ospf_redistribution_tc8_p1(request): step("Verify that OSPF neighbours are reset and forms new adjacencies.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -558,7 +558,7 @@ def test_ospf_rfc2328_appendinxE_p0(request): step("Verify that OSPF neighbours are Full.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py b/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py index 39bbab42e7..757d6fb1d5 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py @@ -108,7 +108,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error {}".format( ospf_covergence ) @@ -358,7 +358,7 @@ def test_ospf_p2p_tc3_p0(request): # Api call verify whether BGP is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -440,7 +440,7 @@ def test_ospf_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -486,7 +486,7 @@ def test_ospf_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -532,7 +532,7 @@ def test_ospf_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -575,7 +575,7 @@ def test_ospf_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -597,7 +597,7 @@ def test_ospf_show_p1(request): reset_config_on_routers(tgen) ospf_covergence = verify_ospf_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) dut = "r1" @@ -690,7 +690,7 @@ def test_ospf_dead_tc11_p0(request): result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("modify dead interval from default value to r1" "dead interval timer on r2") + step("modify dead interval from default value to r1 dead interval timer on r2") topo1 = { "r0": { @@ -714,11 +714,11 @@ def test_ospf_dead_tc11_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) - step("reconfigure the default dead interval timer value to " "default on r1 and r2") + step("reconfigure the default dead interval timer value to default on r1 and r2") topo1 = { "r0": { "links": { @@ -755,7 +755,7 @@ def test_ospf_dead_tc11_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -797,7 +797,7 @@ def test_ospf_dead_tc11_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( ospf_covergence ) @@ -835,9 +835,7 @@ def test_ospf_dead_tc11_p0(request): result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Verify that timer value is deleted from intf & " "set to default value 40 sec." - ) + step("Verify that timer value is deleted from intf & set to default value 40 sec.") input_dict = {"r1": {"links": {"r0": {"ospf": {"timerDeadSecs": 40}}}}} dut = "r1" result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) @@ -883,18 +881,14 @@ def test_ospf_tc4_mtu_ignore_p0(request): clear_ospf(tgen, "r0") - step( - "Verify that OSPF neighborship between R0 and R1 is stuck in Exstart" " State." - ) + step("Verify that OSPF neighborship between R0 and R1 is stuck in Exstart State.") result = verify_ospf_neighbor(tgen, topo, expected=False) assert result is not True, ( "Testcase {} : Failed \n OSPF nbrs are Full " "instead of Exstart. Error: {}".format(tc_name, result) ) - step( - "Verify that configured MTU value is updated in the show ip " "ospf interface." - ) + step("Verify that configured MTU value is updated in the show ip ospf interface.") dut = "r0" input_dict = {"r0": {"links": {"r1": {"ospf": {"mtuBytes": 1200}}}}} @@ -951,9 +945,7 @@ def test_ospf_tc4_mtu_ignore_p0(request): clear_ospf(tgen, "r0") - step( - "Verify that OSPF neighborship between R0 and R1 is stuck in Exstart" " State." - ) + step("Verify that OSPF neighborship between R0 and R1 is stuck in Exstart State.") result = verify_ospf_neighbor(tgen, topo, expected=False) assert result is not True, ( "Testcase {} : Failed \n OSPF nbrs are Full " @@ -970,9 +962,7 @@ def test_ospf_tc4_mtu_ignore_p0(request): result = verify_ospf_neighbor(tgen, topo) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Configure ospf interface with jumbo MTU (9216)." "Reset ospf neighbors on R0." - ) + step("Configure ospf interface with jumbo MTU (9216). Reset ospf neighbors on R0.") rtr0.run("ip link set {} mtu 9216".format(r0_r1_intf)) rtr1.run("ip link set {} mtu 9216".format(r1_r0_intf)) diff --git a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py index 1c26596230..9dce5a976d 100644 --- a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py +++ b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py @@ -119,7 +119,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -182,9 +182,9 @@ def test_ospf_gr_helper_tc1_p0(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) - step("Verify that GR helper route is disabled by default to the in" "the DUT.") + step("Verify that GR helper route is disabled by default to the in the DUT.") input_dict = { "helperSupport": "Disabled", "strictLsaCheck": "Enabled", @@ -195,7 +195,7 @@ def test_ospf_gr_helper_tc1_p0(request): result = verify_ospf_gr_helper(tgen, topo, dut, input_dict) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Verify that DUT does not enter helper mode upon receiving the " "grace lsa.") + step("Verify that DUT does not enter helper mode upon receiving the grace lsa.") # send grace lsa scapy_send_raw_packet(tgen, topo, "r1", intf1, pkt) @@ -205,7 +205,7 @@ def test_ospf_gr_helper_tc1_p0(request): result = verify_ospf_gr_helper(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed. DUT entered helper role " " \n Error: {}".format( + ), "Testcase {} : Failed. DUT entered helper role \n Error: {}".format( tc_name, result ) @@ -234,7 +234,7 @@ def test_ospf_gr_helper_tc1_p0(request): assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) step("Perform GR in RR.") - step("Verify that DUT does enter helper mode upon receiving" " the grace lsa.") + step("Verify that DUT does enter helper mode upon receiving the grace lsa.") input_dict = {"activeRestarterCnt": 1} gracelsa_sent = False repeat = 0 @@ -277,7 +277,7 @@ def test_ospf_gr_helper_tc1_p0(request): result = create_router_ospf(tgen, topo, ospf_gr_r0) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Verify that DUT does enter helper mode upon receiving" " the grace lsa.") + step("Verify that DUT does enter helper mode upon receiving the grace lsa.") input_dict = {"activeRestarterCnt": 1} gracelsa_sent = False repeat = 0 @@ -306,7 +306,7 @@ def test_ospf_gr_helper_tc1_p0(request): result = create_router_ospf(tgen, topo, ospf_gr_r0) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Verify that GR helper router is disabled in the DUT for" " router id x.x.x.x") + step("Verify that GR helper router is disabled in the DUT for router id x.x.x.x") input_dict = {"enabledRouterIds": [{"routerId": "1.1.1.1"}]} dut = "r0" result = verify_ospf_gr_helper(tgen, topo, dut, input_dict, expected=False) @@ -343,7 +343,7 @@ def test_ospf_gr_helper_tc2_p0(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) ospf_gr_r0 = { "r0": {"ospf": {"graceful-restart": {"helper enable": [], "opaque": True}}} } diff --git a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper2.py b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper2.py index a3ccb58d38..202afe5485 100644 --- a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper2.py +++ b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper2.py @@ -119,7 +119,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -188,10 +188,8 @@ def test_ospf_gr_helper_tc3_p1(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) - step( - "Configure DR pririty 100 on R0 and clear ospf neighbors " "on all the routers." - ) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) + step("Configure DR pririty 100 on R0 and clear ospf neighbors on all the routers.") input_dict = { "r0": { @@ -282,10 +280,8 @@ def test_ospf_gr_helper_tc4_p1(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) - step( - "Configure DR pririty 100 on R0 and clear ospf neighbors " "on all the routers." - ) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) + step("Configure DR pririty 100 on R0 and clear ospf neighbors on all the routers.") input_dict = { "r0": { diff --git a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper3.py b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper3.py index 64aac2fba8..3be28196d8 100644 --- a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper3.py +++ b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper3.py @@ -119,7 +119,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -193,7 +193,7 @@ def test_ospf_gr_helper_tc7_p1(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) ospf_gr_r0 = { "r0": {"ospf": {"graceful-restart": {"helper enable": [], "opaque": True}}} } @@ -221,7 +221,7 @@ def test_ospf_gr_helper_tc7_p1(request): result = verify_ospf_gr_helper(tgen, topo, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed. DUT entered helper role " " \n Error: {}".format( + ), "Testcase {} : Failed. DUT entered helper role \n Error: {}".format( tc_name, result ) @@ -253,7 +253,7 @@ def test_ospf_gr_helper_tc8_p1(request): ospf_covergence = verify_ospf_neighbor(tgen, topo, lan=True) assert ( ospf_covergence is True - ), "OSPF is not after reset config \n Error:" " {}".format(ospf_covergence) + ), "OSPF is not after reset config \n Error: {}".format(ospf_covergence) ospf_gr_r0 = { "r0": {"ospf": {"graceful-restart": {"helper enable": [], "opaque": True}}} } diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py index 55166367c1..b0e56e619a 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_asbr_summary_topo1.py @@ -156,7 +156,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -280,7 +280,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step( "Configure External Route summary in R0 to summarise 5" @@ -314,7 +314,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -330,9 +330,9 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv6"], "next_hop": "blackhole"}]} } @@ -340,7 +340,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -349,7 +349,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step("Delete the configured summary") ospf_summ_r1 = { @@ -374,7 +374,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -383,9 +383,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed Error: Summary Route still present in RIB".format(tc_name) step("show ip ospf summary should not have any summary address.") input_dict = { @@ -403,7 +401,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary still present in DB".format(tc_name) dut = "r1" step("All 5 routes are advertised after deletion of configured summary.") @@ -414,7 +412,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("configure the summary again and delete static routes .") ospf_summ_r1 = { @@ -442,7 +440,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) input_dict = { "r0": { @@ -461,7 +459,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -470,7 +468,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step("Add back static routes.") input_dict_static_rtes = { @@ -488,7 +486,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_static_rtes, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -497,7 +495,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) input_dict_summary = {"r0": {"static_routes": [{"network": SUMMARY["ipv6"][0]}]}} dut = "r1" @@ -508,7 +506,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show configure summaries.") @@ -525,7 +523,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Configure new static route which is matching configured summary.") input_dict_static_rtes = { @@ -591,7 +589,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Shut one of the interface") intf = topo["routers"]["r0"]["links"]["r3-link0"]["interface"] @@ -663,7 +661,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) input_dict_summary = {"r0": {"static_routes": [{"network": SUMMARY["ipv6"][0]}]}} @@ -674,7 +672,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) ospf_summ_r1 = { "r0": { @@ -702,7 +700,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -711,7 +709,7 @@ def test_ospfv3_type5_summary_tc42_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) ospf_summ_r1 = { "r0": { @@ -774,11 +772,9 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf6": { @@ -804,7 +800,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -820,7 +816,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Change the summary address mask to lower match (ex - 16 to 8)") ospf_summ_r1 = { @@ -855,7 +851,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step( "Verify that external routes(static / connected) are summarised" @@ -871,7 +867,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Change the summary address mask to higher match (ex - 8 to 24)") ospf_summ_r1 = { @@ -899,7 +895,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step( "Verify that external routes(static / connected) are summarised" @@ -920,7 +916,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step(" Un configure one of the summary address.") ospf_summ_r1 = { @@ -955,7 +951,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) ospf_summ_r1 = { "r0": { @@ -982,7 +978,7 @@ def test_ospfv3_type5_summary_tc43_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) write_test_footer(tc_name) @@ -1030,11 +1026,9 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf6": { @@ -1066,7 +1060,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1082,7 +1076,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary") ospf_summ_r1 = { @@ -1107,7 +1101,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1116,9 +1110,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed Error: Summary Route still present in RIB".format(tc_name) step("show ip ospf summary should not have any summary address.") input_dict = { @@ -1136,7 +1128,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary still present in DB".format(tc_name) step("Configure Min tag value") ospf_summ_r1 = { @@ -1161,7 +1153,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1177,7 +1169,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Configure Max Tag Value") ospf_summ_r1 = { @@ -1207,7 +1199,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1226,7 +1218,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("configure new static route with different tag.") input_dict_static_rtes_11 = { @@ -1251,7 +1243,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1266,7 +1258,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1287,7 +1279,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary address") ospf_summ_r1 = { @@ -1318,7 +1310,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that summary address is flushed from neighbor.") @@ -1326,7 +1318,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1335,7 +1327,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step("Configure summary first & then configure matching static route.") @@ -1467,11 +1459,9 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { "ospf6": { @@ -1503,7 +1493,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1541,7 +1531,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1550,9 +1540,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed Error: Summary Route still present in RIB".format(tc_name) step("show ip ospf summary should not have any summary address.") input_dict = { @@ -1570,7 +1558,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary still present in DB".format(tc_name) step("Configure Min tag value") ospf_summ_r1 = { @@ -1595,7 +1583,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries with tag.") input_dict = { @@ -1611,7 +1599,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Configure Max Tag Value") ospf_summ_r1 = { @@ -1641,7 +1629,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1660,7 +1648,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("configure new static route with different tag.") input_dict_static_rtes_11 = { @@ -1685,7 +1673,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1700,7 +1688,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step( "Verify that boundary values tags are used for summary route" @@ -1721,7 +1709,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary address") ospf_summ_r1 = { @@ -1752,7 +1740,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that summary address is flushed from neighbor.") @@ -1760,7 +1748,7 @@ def ospfv3_type5_summary_tc45_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1769,7 +1757,7 @@ def ospfv3_type5_summary_tc45_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step("Configure summary first & then configure matching static route.") @@ -1853,7 +1841,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step( "Configure External Route summary in R0 to summarise 5" @@ -1887,7 +1875,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1896,9 +1884,9 @@ def test_ospfv3_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) - step("Verify that show ip ospf summary should show the " "configured summaries.") + step("Verify that show ip ospf summary should show the configured summaries.") input_dict = { SUMMARY["ipv6"][0]: { "summaryAddress": SUMMARY["ipv6"][0], @@ -1909,7 +1897,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Delete the configured summary") ospf_summ_r1 = { @@ -1936,7 +1924,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -1945,9 +1933,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary Route still present in RIB".format( - tc_name - ) + ), "Testcase {} : Failed Error: Summary Route still present in RIB".format(tc_name) step("show ip ospf summary should not have any summary address.") input_dict = { @@ -1965,7 +1951,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Summary still present in DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary still present in DB".format(tc_name) step("Reconfigure summary with no advertise.") ospf_summ_r1 = { @@ -1996,7 +1982,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2005,9 +1991,9 @@ def test_ospfv3_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) - step("Verify that show ip ospf summary should show the " "configured summaries.") + step("Verify that show ip ospf summary should show the configured summaries.") input_dict = { SUMMARY["ipv6"][0]: { "summaryAddress": SUMMARY["ipv6"][0], @@ -2018,7 +2004,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step( "Change summary address from no advertise to advertise " @@ -2067,7 +2053,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2083,9 +2069,9 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") output = tgen.gears["r0"].vtysh_cmd( "show ipv6 ospf6 database as-external json", isjson=True ) @@ -2101,7 +2087,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2110,7 +2096,7 @@ def test_ospfv3_type5_summary_tc46_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes is present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is present in RIB".format(tc_name) write_test_footer(tc_name) @@ -2157,11 +2143,9 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { @@ -2189,7 +2173,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2205,9 +2189,9 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv6"], "next_hop": "blackhole"}]} } @@ -2215,7 +2199,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2224,7 +2208,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step( "Configure route map and & rule to permit configured summary address," @@ -2287,7 +2271,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) input_dict = { SUMMARY["ipv6"][0]: { @@ -2302,7 +2286,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Configure metric type as 1 in route map.") @@ -2339,7 +2323,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Un configure metric type from route map.") @@ -2376,7 +2360,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) step("Change rule from permit to deny in prefix list.") pfx_list = { @@ -2407,7 +2391,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): result = verify_ospf6_rib(tgen, dut, input_dict_summary, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2416,7 +2400,7 @@ def test_ospfv3_type5_summary_tc48_p0(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) write_test_footer(tc_name) @@ -2556,7 +2540,7 @@ def test_ospfv3_type5_summary_tc51_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) write_test_footer(tc_name) @@ -2603,11 +2587,9 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv6", dut, input_dict_static_rtes, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) - step( - "Configure External Route summary in R0 to summarise 5" " routes to one route." - ) + step("Configure External Route summary in R0 to summarise 5 routes to one route.") ospf_summ_r1 = { "r0": { @@ -2635,7 +2617,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2651,9 +2633,9 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv6"], "next_hop": "blackhole"}]} } @@ -2661,7 +2643,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2670,7 +2652,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) step("Reload the FRR router") # stop/start -> restart FRR router and verify @@ -2691,7 +2673,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_rib(tgen, "ipv6", dut, input_dict_summary, protocol=protocol) assert ( result is True - ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes is missing in RIB".format(tc_name) step("Verify that show ip ospf summary should show the summaries.") input_dict = { @@ -2707,9 +2689,9 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_ospf_summary(tgen, topo, dut, input_dict, ospf="ospf6") assert ( result is True - ), "Testcase {} : Failed" "Error: Summary missing in OSPF DB".format(tc_name) + ), "Testcase {} : Failed Error: Summary missing in OSPF DB".format(tc_name) - step("Verify that originally advertised routes are withdraw from there" " peer.") + step("Verify that originally advertised routes are withdraw from there peer.") input_dict = { "r0": {"static_routes": [{"network": NETWORK["ipv6"], "next_hop": "blackhole"}]} } @@ -2717,7 +2699,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): result = verify_ospf6_rib(tgen, dut, input_dict, expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Error: " "Routes still present in OSPF RIB {}".format( + ), "Testcase {} : Failed \n Error: Routes still present in OSPF RIB {}".format( tc_name, result ) @@ -2726,7 +2708,7 @@ def test_ospfv3_type5_summary_tc49_p2(request): ) assert ( result is not True - ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) + ), "Testcase {} : Failed Error: Routes still present in RIB".format(tc_name) write_test_footer(tc_name) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py index 2f90c98785..58608e249b 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py @@ -111,7 +111,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf6_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf6_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "setup_module :Failed \n Error: {}".format( ospf6_covergence ) @@ -182,7 +182,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -214,7 +214,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -244,7 +244,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=5 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -272,7 +272,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -287,7 +287,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): "show ip ospf6 neighbor cmd." ) ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -301,7 +301,7 @@ def test_ospf6_auth_trailer_tc1_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -348,7 +348,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -380,7 +380,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -410,7 +410,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=5 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -438,7 +438,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -453,7 +453,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): "show ip ospf6 neighbor cmd." ) ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -467,7 +467,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -531,7 +531,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -561,7 +561,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -580,7 +580,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=5 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -606,7 +606,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -621,7 +621,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): "show ip ospf6 neighbor cmd." ) ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -635,7 +635,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -699,7 +699,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -729,7 +729,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -748,7 +748,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=5 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -774,7 +774,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -789,7 +789,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): "show ip ospf6 neighbor cmd." ) ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, expected=False) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -803,7 +803,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -850,7 +850,7 @@ def test_ospf6_auth_trailer_tc5_md5_keymissmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -887,7 +887,7 @@ def test_ospf6_auth_trailer_tc5_md5_keymissmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -919,7 +919,7 @@ def test_ospf6_auth_trailer_tc5_md5_keymissmatch(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -966,7 +966,7 @@ def test_ospf6_auth_trailer_tc6_sha256_mismatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -998,7 +998,7 @@ def test_ospf6_auth_trailer_tc6_sha256_mismatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1030,7 +1030,7 @@ def test_ospf6_auth_trailer_tc6_sha256_mismatch(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1102,7 +1102,7 @@ def test_ospf6_auth_trailer_tc7_keychain_md5_missmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1132,7 +1132,7 @@ def test_ospf6_auth_trailer_tc7_keychain_md5_missmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1162,7 +1162,7 @@ def test_ospf6_auth_trailer_tc7_keychain_md5_missmatch(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1234,7 +1234,7 @@ def test_ospf6_auth_trailer_tc8_keychain_sha256_missmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1264,7 +1264,7 @@ def test_ospf6_auth_trailer_tc8_keychain_sha256_missmatch(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1294,7 +1294,7 @@ def test_ospf6_auth_trailer_tc8_keychain_sha256_missmatch(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1342,7 +1342,7 @@ def test_ospf6_auth_trailer_tc9_keychain_not_configured(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1372,7 +1372,7 @@ def test_ospf6_auth_trailer_tc9_keychain_not_configured(request): ospf6_covergence = verify_ospf6_neighbor( tgen, topo, dut=dut, expected=False, retry_timeout=3 ) - assert ospf6_covergence is not True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is not True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) @@ -1402,7 +1402,7 @@ def test_ospf6_auth_trailer_tc10_no_auth_trailer(request): dut = "r2" ospf6_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf6_covergence is True, "Testcase {} :Failed \n Error:" " {}".format( + assert ospf6_covergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, ospf6_covergence ) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp.py index 472364e84f..0c1e3fa43e 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp.py @@ -115,7 +115,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -257,7 +257,7 @@ def test_ospfv3_ecmp_tc16_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -352,7 +352,7 @@ def test_ospfv3_ecmp_tc16_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -390,7 +390,7 @@ def test_ospfv3_ecmp_tc17_p0(request): step("Verify that OSPF is up with 2 neighborship sessions.") dut = "r1" ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp_lan.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp_lan.py index 6b3e16965c..7c6773260e 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp_lan.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_ecmp_lan.py @@ -128,7 +128,7 @@ def setup_module(mod): pytest.skip(tgen.errors) # Api call verify whether OSPF is converged ospf_covergence = verify_ospf6_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -282,7 +282,7 @@ def test_ospfv3_lan_ecmp_tc18_p0(request): step("Verify that OSPF is up with 8 neighborship sessions.") ospf_covergence = verify_ospf6_neighbor(tgen, topo, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -343,7 +343,7 @@ def test_ospfv3_lan_ecmp_tc18_p0(request): dut = "r0" ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -352,7 +352,7 @@ def test_ospfv3_lan_ecmp_tc18_p0(request): dut = "r2" ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut, lan=True) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa.py index c0d8d718cc..dc4ce88830 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa.py @@ -73,7 +73,7 @@ def setup_module(mod): pytest.skip(tgen.errors) result = verify_ospf6_neighbor(tgen, topo) - assert result is True, "setup_module: Failed \n Error:" " {}".format(result) + assert result is True, "setup_module: Failed \n Error: {}".format(result) logger.info("Running setup_module() done") diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa2.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa2.py index 138112775f..90548fb5ce 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa2.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_nssa2.py @@ -138,7 +138,7 @@ def setup_module(mod): # Api call verify whether OSPF is converged ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -277,7 +277,7 @@ def test_ospfv3_nssa_tc26_p0(request): result = verify_ospf6_neighbor(tgen, topo, dut="r2", expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Nbrs are not down" "Error: {}".format(tc_name, result) + ), "Testcase {} : Failed \n Nbrs are not down Error: {}".format(tc_name, result) step("Now configure area 0 on interface of r1 connecting to r2.") @@ -349,7 +349,7 @@ def test_ospfv3_nssa_tc26_p0(request): result = verify_ospf6_neighbor(tgen, topo, dut="r2", expected=False) assert ( result is not True - ), "Testcase {} : Failed \n Nbrs are not down" "Error: {}".format(tc_name, result) + ), "Testcase {} : Failed \n Nbrs are not down Error: {}".format(tc_name, result) step("Now configure area 2 on interface of r1 connecting to r2.") @@ -471,7 +471,7 @@ def test_ospfv3_learning_tc15_p0(request): result = verify_ospf6_neighbor(tgen, topo) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Change area 1 as non nssa area (on the fly changing area" " type on DUT).") + step("Change area 1 as non nssa area (on the fly changing area type on DUT).") for rtr in ["r1", "r2", "r3"]: input_dict = { diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_routemaps.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_routemaps.py index b2cd0da24e..069806a3ef 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_routemaps.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_routemaps.py @@ -129,7 +129,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -212,9 +212,7 @@ def test_ospfv3_routemaps_functionality_tc19_p0(request): result = create_router_ospf(tgen, topo, ospf_red_r1) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Create prefix-list in R0 to permit 10.0.20.1/32 prefix &" " deny 10.0.20.2/32" - ) + step("Create prefix-list in R0 to permit 10.0.20.1/32 prefix & deny 10.0.20.2/32") # Create ip prefix list pfx_list = { @@ -686,7 +684,7 @@ def test_ospfv3_routemaps_functionality_tc25_p0(request): # Api call verify whether OSPF is converged ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -1078,7 +1076,7 @@ def test_ospfv3_routemaps_functionality_tc24_p0(request): result = verify_prefix_lists(tgen, pfx_list) assert ( result is not True - ), "Testcase {} : Failed \n Prefix list not " "present. Error: {}".format( + ), "Testcase {} : Failed \n Prefix list not present. Error: {}".format( tc_name, result ) @@ -1147,7 +1145,7 @@ def test_ospfv3_routemaps_functionality_tc24_p0(request): result = verify_prefix_lists(tgen, pfx_list) assert ( result is not True - ), "Testcase {} : Failed \n Prefix list not " "present. Error: {}".format( + ), "Testcase {} : Failed \n Prefix list not present. Error: {}".format( tc_name, result ) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py index 9e7f112efb..645dea8dec 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py @@ -120,7 +120,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -256,7 +256,7 @@ def test_ospfv3_redistribution_tc5_p0(request): step("Verify that OSPF neighbors are FULL.") ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -616,7 +616,7 @@ def test_ospfv3_redistribution_tc8_p1(request): step("Verify that OSPF neighbours are reset and forms new adjacencies.") # Api call verify whether OSPF is converged ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py index 5d5ba1480f..6f23294a1a 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py @@ -114,7 +114,7 @@ def setup_module(mod): pytest.skip(tgen.errors) ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "setup_module :Failed \n Error: {}".format( ospf_covergence ) @@ -460,7 +460,7 @@ def test_ospfv3_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -513,7 +513,7 @@ def test_ospfv3_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -566,7 +566,7 @@ def test_ospfv3_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -618,7 +618,7 @@ def test_ospfv3_hello_tc10_p0(request): step("verify that ospf neighbours are full") ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( + assert ospf_covergence is True, "Testcase Failed \n Error: {}".format( ospf_covergence ) @@ -709,9 +709,7 @@ def test_ospfv3_hello_tc10_p0(request): result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Verify that timer value is deleted from intf & " "set to default value 40 sec." - ) + step("Verify that timer value is deleted from intf & set to default value 40 sec.") input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigHello": 10}}}}} dut = "r1" result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict) @@ -763,7 +761,7 @@ def test_ospfv3_dead_tc11_p0(request): result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("modify dead interval from default value to r1" "dead interval timer on r2") + step("modify dead interval from default value to r1 dead interval timer on r2") topo1 = { "r0": { @@ -799,7 +797,7 @@ def test_ospfv3_dead_tc11_p0(request): # reconfiguring deleted ospf process by resetting the configs. reset_config_on_routers(tgen) - step("reconfigure the default dead interval timer value to " "default on r1 and r2") + step("reconfigure the default dead interval timer value to default on r1 and r2") topo1 = { "r0": { "links": { @@ -920,9 +918,7 @@ def test_ospfv3_dead_tc11_p0(request): result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Verify that timer value is deleted from intf & " "set to default value 40 sec." - ) + step("Verify that timer value is deleted from intf & set to default value 40 sec.") input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigDead": 40}}}}} dut = "r1" result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict) @@ -967,18 +963,14 @@ def test_ospfv3_tc4_mtu_ignore_p0(request): clear_ospf(tgen, "r0", ospf="ospf6") clear_ospf(tgen, "r1", ospf="ospf6") - step( - "Verify that OSPF neighborship between R0 and R1 is stuck in Exstart" " State." - ) + step("Verify that OSPF neighborship between R0 and R1 is stuck in Exstart State.") result = verify_ospf6_neighbor(tgen, topo, expected=False) assert result is not True, ( "Testcase {} : Failed \n OSPF nbrs are Full " "instead of Exstart. Error: {}".format(tc_name, result) ) - step( - "Verify that configured MTU value is updated in the show ip " "ospf interface." - ) + step("Verify that configured MTU value is updated in the show ip ospf interface.") dut = "r0" input_dict = {"r0": {"links": {"r1": {"ospf6": {"interfaceMtu": 1400}}}}} @@ -1035,9 +1027,7 @@ def test_ospfv3_tc4_mtu_ignore_p0(request): clear_ospf(tgen, "r0", ospf="ospf6") - step( - "Verify that OSPF neighborship between R0 and R1 is stuck in Exstart" " State." - ) + step("Verify that OSPF neighborship between R0 and R1 is stuck in Exstart State.") result = verify_ospf6_neighbor(tgen, topo, expected=False) assert result is not True, ( "Testcase {} : Failed \n OSPF nbrs are Full " @@ -1054,9 +1044,7 @@ def test_ospfv3_tc4_mtu_ignore_p0(request): result = verify_ospf6_neighbor(tgen, topo) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step( - "Configure ospf interface with jumbo MTU (9216)." "Reset ospf neighbors on R0." - ) + step("Configure ospf interface with jumbo MTU (9216). Reset ospf neighbors on R0.") rtr0.run("ifconfig {} mtu 9216".format(r0_r1_intf)) rtr1.run("ifconfig {} mtu 9216".format(r1_r0_intf)) @@ -1234,7 +1222,7 @@ def ospfv3_router_id_tc14_p2(request): clear_ospf(tgen, rtr, ospf="ospf6") ospf_covergence = verify_ospf6_neighbor(tgen, topo1) - assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error:" " {}".format( + assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error: {}".format( ospf_covergence ) @@ -1260,9 +1248,9 @@ def ospfv3_router_id_tc14_p2(request): assert result is True, "Testcase : Failed \n Error: {}".format(result) ospf_covergence = verify_ospf6_neighbor(tgen, topo, expected=False) - assert ( - ospf_covergence is not True - ), "OSPF NBRs are up.Failed \n Error:" " {}".format(ospf_covergence) + assert ospf_covergence is not True, "OSPF NBRs are up.Failed \n Error: {}".format( + ospf_covergence + ) topo1 = {} topo1 = deepcopy(topo) @@ -1305,7 +1293,7 @@ def ospfv3_router_id_tc14_p2(request): topo1["routers"]["r3"]["ospf6"]["router_id"] = "1.1.1.4" ospf_covergence = verify_ospf6_neighbor(tgen, topo1) - assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error:" " {}".format( + assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error: {}".format( ospf_covergence ) @@ -1313,7 +1301,7 @@ def ospfv3_router_id_tc14_p2(request): reset_config_on_routers(tgen) ospf_covergence = verify_ospf6_neighbor(tgen, topo) - assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error:" " {}".format( + assert ospf_covergence is True, "OSPF NBRs not up.Failed \n Error: {}".format( ospf_covergence )