From 0a0533a9a60585b656fffc3af4a7727b6c44c420 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 31 May 2022 09:44:02 -0400 Subject: [PATCH] tests: Remove duplicated work If at first you succeed try try again. No I mean if it works the first time no need to do the same command again. Signed-off-by: Donald Sharp --- .../test_rfc5549_ebgp_unnumbered_nbr.py | 1 - .../test_mcast_pim_bsmp_01.py | 12 ------------ .../test_mcast_pim_bsmp_02.py | 12 ------------ .../test_static_routes_topo3_ebgp.py | 2 -- .../test_static_routes_topo3_ibgp.py | 2 -- 5 files changed, 29 deletions(-) diff --git a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py index 16d6b1993d..fc2d2364c6 100644 --- a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py +++ b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py @@ -436,7 +436,6 @@ def test_restart_frr_p2(request): step("Activate same IPv6 nbr from IPv4 unicast family") step("Enable cap ext nh on r1 and r2 and activate in ipv4 addr family") step("Verify bgp convergence as ipv6 nbr is enabled on ipv4 addr family.") - reset_config_on_routers(tgen) bgp_convergence = verify_bgp_convergence(tgen, topo) assert bgp_convergence is True, "Testcase {} :Failed \n Error: {}".format( tc_name, bgp_convergence diff --git a/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py b/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py index c0ea1b5561..ceac78d88b 100644 --- a/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py +++ b/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py @@ -377,7 +377,6 @@ def test_BSR_higher_prefer_ip_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) step("pre-configure BSM packet") step("Configure cisco-1 as BSR1 1.1.2.7") result = pre_config_to_bsm( @@ -583,7 +582,6 @@ def test_BSR_CRP_with_blackhole_address_p1(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) step("pre-configure BSM packet") step("Configure cisco-1 as BSR1 1.1.2.7") result = pre_config_to_bsm( @@ -760,8 +758,6 @@ def test_new_router_fwd_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -901,8 +897,6 @@ def test_int_bsm_config_p1(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -1062,8 +1056,6 @@ def test_static_rp_override_p1(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -1213,8 +1205,6 @@ def test_bsmp_stress_add_del_restart_p2(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -1538,8 +1528,6 @@ def test_iif_join_state_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) diff --git a/tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py b/tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py index 9f771b8a2b..2d6062bf3c 100644 --- a/tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py +++ b/tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py @@ -335,8 +335,6 @@ def test_starg_mroute_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -487,8 +485,6 @@ def test_overlapping_group_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -593,8 +589,6 @@ def test_RP_priority_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -724,8 +718,6 @@ def test_BSR_election_p0(request): if tgen.routers_have_failure(): pytest.skip(tgen.errors) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -840,8 +832,6 @@ def test_RP_hash_p0(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) @@ -933,8 +923,6 @@ def test_BSM_fragmentation_p1(request): reset_config_on_routers(tgen) clear_pim_interface_traffic(tgen, topo) - reset_config_on_routers(tgen) - result = pre_config_to_bsm( tgen, topo, tc_name, "b1", "s1", "r1", "f1", "i1", "l1", "packet1" ) diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py index 6c76c928ec..088ac600c1 100644 --- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py +++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo3_ebgp.py @@ -435,11 +435,9 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ebgp(request): pytest.skip(tgen.errors) reset_config_on_routers(tgen) - NEXT_HOP_IP = populate_nh() step("Configure 8 interfaces / links between R1 and R2,") step("Configure IBGP IPv4 peering between R2 and R3 router.") - reset_config_on_routers(tgen) NEXT_HOP_IP = populate_nh() nh_all = {} for addr_type in ADDR_TYPES: diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py index 1861d9ad49..cdd7e13f75 100644 --- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py +++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo3_ibgp.py @@ -434,11 +434,9 @@ def test_staticroute_with_ecmp_with_diff_AD_p0_tc4_ibgp(request): pytest.skip(tgen.errors) reset_config_on_routers(tgen) - NEXT_HOP_IP = populate_nh() step("Configure 8 interfaces / links between R1 and R2,") step("Configure IBGP IPv4 peering between R2 and R3 router.") - reset_config_on_routers(tgen) NEXT_HOP_IP = populate_nh() nh_all = {} for addr_type in ADDR_TYPES: