From 0ce28e746e82443677cc62f9bf9810af5c048173 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Wed, 18 Aug 2021 13:03:42 -0400 Subject: [PATCH] tests: remove unneeded mcast group kernel routes and sysctl - The PIM tests do not need kernel routes to help them bind joins and sources to specific interfaces. They should do that themselves directly. Also do not change system wide "rp_filter" sysctl away from the value required by everyone else. Signed-off-by: Christian Hopps --- .../test_multicast_pim_sm_topo1.py | 125 ----------- .../test_multicast_pim_sm_topo2.py | 131 +----------- .../test_multicast_pim_sm_topo3.py | 195 ------------------ .../test_multicast_pim_sm_topo4.py | 79 ------- .../test_multicast_pim_static_rp.py | 104 ---------- 5 files changed, 1 insertion(+), 633 deletions(-) diff --git a/tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py b/tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py index e6c9a30b3d..002a79485c 100755 --- a/tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py +++ b/tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py @@ -232,41 +232,6 @@ def teardown_module(): ##################################################### -def config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, iperf, iperf_intf, GROUP_RANGE, join=False, traffic=False -): - """ - API to do pre-configuration to send IGMP join and multicast - traffic - - parameters: - ----------- - * `tgen`: topogen object - * `topo`: input json data - * `tc_name`: caller test case name - * `iperf`: router running iperf - * `iperf_intf`: interface name router running iperf - * `GROUP_RANGE`: group range - * `join`: IGMP join, default False - * `traffic`: multicast traffic, default False - """ - - if join: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - if traffic: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - rnode = tgen.gears[iperf] - rnode.run("echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter") - - return True - - def verify_state_incremented(state_before, state_after): """ API to compare interface traffic state incrementing @@ -467,20 +432,10 @@ def test_multicast_data_traffic_static_RP_send_traffic_then_join_p0(request): step("Start traffic first and then send the IGMP join") step("Send multicast traffic from FRR3 to 225.1.1.1 receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step("Enable IGMP on FRR1 interface and send IGMP join (225.1.1.1)") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - step("joinRx value before join sent") state_dict = {"r2": {"r2-l1-eth2": ["joinRx"]}} state_before = verify_pim_interface_traffic(tgen, state_dict) @@ -594,20 +549,10 @@ def test_clear_pim_neighbors_and_mroute_p0(request): "Enable IGMP on FRR1 interface and send IGMP join 225.1.1.1 " "to 225.1.1.5 from different interfaces" ) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", IGMP_JOIN_RANGE_1, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3, wait for SPT switchover") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN_RANGE_1, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -697,20 +642,10 @@ def test_verify_mroute_when_same_receiver_in_FHR_LHR_and_RP_p0(request): input_join = {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0", "i3": "i3-r2-eth0"} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step("Send multicast traffic from R3 to 225.1.1.1 receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -789,11 +724,6 @@ def test_verify_mroute_when_same_receiver_joining_5_diff_sources_p0(request): "for group (226.1.1.1-5, 232.1.1.1-5)" ) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", _IGMP_JOIN_RANGE, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -803,11 +733,6 @@ def test_verify_mroute_when_same_receiver_joining_5_diff_sources_p0(request): result = create_igmp_config(tgen, topo, input_dict) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i8", "i8-f1-eth0", _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i8", _IGMP_JOIN_RANGE, "f1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -825,11 +750,6 @@ def test_verify_mroute_when_same_receiver_joining_5_diff_sources_p0(request): } for src, src_intf in input_traffic.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1105,20 +1025,10 @@ def test_verify_mroute_when_frr_is_transit_router_p2(request): assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-5) to FRR1") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", IGMP_JOIN_RANGE_1, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3 to 225.1.1.1-5 receivers") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN_RANGE_1, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1220,20 +1130,10 @@ def test_verify_mroute_when_RP_unreachable_p1(request): step("Enable IGMP on FRR1 interface and send IGMP join (225.1.1.1)") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", IGMP_JOIN, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3 to 225.1.1.1 receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1244,11 +1144,6 @@ def test_verify_mroute_when_RP_unreachable_p1(request): result = create_igmp_config(tgen, topo, input_dict) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i8", "i8-f1-eth0", GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i8", IGMP_JOIN, "f1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1323,11 +1218,6 @@ def test_modify_igmp_query_timer_p0(request): clear_ip_pim_interface_traffic(tgen, topo) step("Enable IGMP on FRR1 interface and send IGMP join (225.1.1.1)") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", IGMP_JOIN, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1352,11 +1242,6 @@ def test_modify_igmp_query_timer_p0(request): assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3 to 225.1.1.1 receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1462,11 +1347,6 @@ def test_modify_igmp_max_query_response_timer_p0(request): clear_ip_pim_interface_traffic(tgen, topo) step("Enable IGMP on FRR1 interface and send IGMP join (225.1.1.1)") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", IGMP_JOIN, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1512,11 +1392,6 @@ def test_modify_igmp_max_query_response_timer_p0(request): assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3 to 225.1.1.1 receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", IGMP_JOIN, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) diff --git a/tests/topotests/multicast_pim_sm_topo2/test_multicast_pim_sm_topo2.py b/tests/topotests/multicast_pim_sm_topo2/test_multicast_pim_sm_topo2.py index 27abfae9f4..c0fa53af1d 100755 --- a/tests/topotests/multicast_pim_sm_topo2/test_multicast_pim_sm_topo2.py +++ b/tests/topotests/multicast_pim_sm_topo2/test_multicast_pim_sm_topo2.py @@ -225,46 +225,6 @@ def teardown_module(): ##################################################### -def config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, iperf, iperf_intf, GROUP_RANGE, join=False, traffic=False -): - """ - API to do pre-configuration to send IGMP join and multicast - traffic - - parameters: - ----------- - * `tgen`: topogen object - * `topo`: input json data - * `tc_name`: caller test case name - * `iperf`: router running iperf - * `iperf_intf`: interface name router running iperf - * `GROUP_RANGE`: group range - * `join`: IGMP join, default False - * `traffic`: multicast traffic, default False - """ - - if join: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - if traffic: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - router_list = tgen.routers() - for router in router_list.keys(): - if router == iperf: - continue - - rnode = router_list[router] - rnode.run("echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter") - - return True - - def verify_state_incremented(state_before, state_after): """ API to compare interface traffic state incrementing @@ -378,11 +338,6 @@ def test_verify_mroute_and_traffic_when_pimd_restarted_p2(request): input_join = {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -398,11 +353,6 @@ def test_verify_mroute_and_traffic_when_pimd_restarted_p2(request): input_src = {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -590,11 +540,6 @@ def test_verify_mroute_and_traffic_when_frr_restarted_p2(request): input_join = {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -610,11 +555,6 @@ def test_verify_mroute_and_traffic_when_frr_restarted_p2(request): input_src = {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -775,21 +715,11 @@ def test_verify_SPT_switchover_when_RPT_and_SPT_path_is_different_p0(request): "(226.1.1.1-5) and (232.1.1.1-5)" ) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", _IGMP_JOIN_RANGE, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step("Send multicast traffic from FRR3 to '226.1.1.1-5'" ", '232.1.1.1-5' receiver") - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - step("registerRx and registerStopTx value before traffic sent") state_dict = {"c2": {"c2-f1-eth1": ["registerRx", "registerStopTx"]}} state_before = verify_pim_interface_traffic(tgen, state_dict) @@ -963,11 +893,6 @@ def test_verify_mroute_after_shut_noshut_of_upstream_interface_p1(request): input_join = {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -983,11 +908,6 @@ def test_verify_mroute_after_shut_noshut_of_upstream_interface_p1(request): input_src = {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1209,11 +1129,6 @@ def test_verify_mroute_when_receiver_is_outside_frr_p0(request): "Enable IGMP on FRR1 interface and send IGMP join" " (226.1.1.1-5) and (232.1.1.1-5)" ) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i1", "i1-l1-eth0", _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i1", _IGMP_JOIN_RANGE, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1221,11 +1136,6 @@ def test_verify_mroute_when_receiver_is_outside_frr_p0(request): "Send multicast traffic from FRR3 to all the receivers " "(226.1.1.1-5) and (232.1.1.1-5)" ) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i2", "i2-f1-eth0", _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic("i2", _IGMP_JOIN_RANGE, "f1") assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1239,11 +1149,6 @@ def test_verify_mroute_when_receiver_is_outside_frr_p0(request): result = create_igmp_config(tgen, topo, input_dict) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, "i5", "i5-c2-eth0", _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i5", _IGMP_JOIN_RANGE, "c2") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1357,16 +1262,6 @@ def test_verify_mroute_when_FRR_is_FHR_and_LHR_p0(request): "(226.1.1.1-5) and (232.1.1.1-5)" ) - # result = config_to_send_igmp_join_and_traffic( - # tgen, topo, tc_name, "i1", "i1-l1-eth0", _GROUP_RANGE, join=True - # ) - # assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - # result = config_to_send_igmp_join_and_traffic( - # tgen, topo, tc_name, "i2", "i2-f1-eth0", _GROUP_RANGE, traffic=True - # ) - # assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - step("Send IGMP join (226.1.1.1-5, 232.1.1.1-5) to LHR(l1)") result = app_helper.run_join("i1", _IGMP_JOIN_RANGE, "l1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1387,11 +1282,6 @@ def test_verify_mroute_when_FRR_is_FHR_and_LHR_p0(request): result = create_igmp_config(tgen, topo, input_dict) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - # result = config_to_send_igmp_join_and_traffic( - # tgen, topo, tc_name, "i8", "i8-f1-eth0", _GROUP_RANGE, join=True - # ) - # assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join("i8", _IGMP_JOIN_RANGE, "f1") assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) step( @@ -1589,13 +1479,9 @@ def test_verify_mroute_when_5_different_receiver_joining_same_sources_p0(request } for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) + step("Configure one source in FRR2 , one in c1") step( "Send multicast traffic from both the sources to all the" @@ -1605,11 +1491,6 @@ def test_verify_mroute_when_5_different_receiver_joining_same_sources_p0(request input_src = {"i3": "i3-r2-eth0"} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step( @@ -1799,11 +1680,6 @@ def test_verify_oil_iif_for_mroute_after_shut_noshut_source_interface_p1(request input_join = {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1816,11 +1692,6 @@ def test_verify_oil_iif_for_mroute_after_shut_noshut_source_interface_p1(request input_src = {"i6": "i6-l1-eth0", "i2": "i2-f1-eth0"} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) diff --git a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py index afefbfed10..84e274ab2d 100755 --- a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py +++ b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py @@ -242,56 +242,6 @@ def teardown_module(): ##################################################### -def config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, iperf, iperf_intf, GROUP_RANGE, join=False, traffic=False -): - """ - API to do pre-configuration to send IGMP join and multicast - traffic - - parameters: - ----------- - * `tgen`: topogen object - * `topo`: input json data - * `tc_name`: caller test case name - * `iperf`: router running iperf - * `iperf_intf`: interface name router running iperf - * `GROUP_RANGE`: group range - * `join`: IGMP join, default False - * `traffic`: multicast traffic, default False - """ - - if join: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - if traffic: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - router_list = tgen.routers() - for router in router_list.keys(): - if router == iperf: - continue - - rnode = router_list[router] - rnode.run("echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter") - - for router in topo["routers"].keys(): - if "static_routes" in topo["routers"][router]: - static_routes = topo["routers"][router]["static_routes"] - for static_route in static_routes: - network = static_route["network"] - next_hop = static_route["next_hop"] - if type(network) is not list: - network = [network] - for net in network: - addKernelRoute(tgen, router, iperf_intf, net, next_hop) - return True - - def verify_mroute_repopulated(uptime_before, uptime_after): """ API to compare uptime for mroutes @@ -463,11 +413,6 @@ def test_verify_oil_when_join_prune_sent_scenario_1_p1(request): } for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -498,11 +443,6 @@ def test_verify_oil_when_join_prune_sent_scenario_1_p1(request): input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -847,11 +787,6 @@ def test_verify_oil_when_join_prune_sent_scenario_2_p1(request): } for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1063,11 +998,6 @@ def test_shut_noshut_source_interface_when_upstream_cleared_from_LHR_p1(request) input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1096,11 +1026,6 @@ def test_shut_noshut_source_interface_when_upstream_cleared_from_LHR_p1(request) input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1280,11 +1205,6 @@ def test_shut_noshut_receiver_interface_when_upstream_cleared_from_LHR_p1(reques input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1313,11 +1233,6 @@ def test_shut_noshut_receiver_interface_when_upstream_cleared_from_LHR_p1(reques input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1482,11 +1397,6 @@ def test_verify_remove_add_igmp_config_to_receiver_interface_p0(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1515,11 +1425,6 @@ def test_verify_remove_add_igmp_config_to_receiver_interface_p0(request): input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1528,11 +1433,6 @@ def test_verify_remove_add_igmp_config_to_receiver_interface_p0(request): input_src = {"i6": topo["routers"]["i6"]["links"]["l1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1858,11 +1758,6 @@ def test_verify_remove_add_igmp_commands_when_pim_configured_p0(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -1891,11 +1786,6 @@ def test_verify_remove_add_igmp_commands_when_pim_configured_p0(request): input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -1904,11 +1794,6 @@ def test_verify_remove_add_igmp_commands_when_pim_configured_p0(request): input_src = {"i6": topo["routers"]["i6"]["links"]["l1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -2158,11 +2043,6 @@ def test_verify_remove_add_pim_commands_when_igmp_configured_p1(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -2353,11 +2233,6 @@ def test_pim_dr_priority_p0(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -2384,11 +2259,6 @@ def test_pim_dr_priority_p0(request): input_src = {"i2": topo["routers"]["i2"]["links"]["f1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -2636,11 +2506,6 @@ def test_pim_hello_timer_p1(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -2775,11 +2640,6 @@ def test_mroute_after_removing_RP_sending_IGMP_prune_p2(request): input_join = {"i8": topo["routers"]["i8"]["links"]["f1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -2811,11 +2671,6 @@ def test_mroute_after_removing_RP_sending_IGMP_prune_p2(request): input_src = {"i6": topo["routers"]["i6"]["links"]["l1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -3001,11 +2856,6 @@ def test_mroute_after_removing_RP_sending_IGMP_prune_p2(request): step("Send IGMP joins again from LHR,check IGMP joins and starg received") for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -3023,11 +2873,6 @@ def test_mroute_after_removing_RP_sending_IGMP_prune_p2(request): step("Send traffic from FHR and verify mroute upstream") for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -3093,11 +2938,6 @@ def test_prune_sent_to_LHR_and_FHR_when_PIMnbr_down_p2(request): input_join = {"i8": topo["routers"]["i8"]["links"]["f1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -3132,11 +2972,6 @@ def test_prune_sent_to_LHR_and_FHR_when_PIMnbr_down_p2(request): } for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -3735,11 +3570,6 @@ def test_mroute_flags_p1(request): input_join = {"i8": topo["routers"]["i8"]["links"]["f1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -3774,11 +3604,6 @@ def test_mroute_flags_p1(request): } for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -3919,11 +3744,6 @@ def test_verify_multicast_traffic_when_LHR_connected_to_RP_p1(request): input_join = {"i3": topo["routers"]["i3"]["links"]["r2"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -3952,11 +3772,6 @@ def test_verify_multicast_traffic_when_LHR_connected_to_RP_p1(request): input_src = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -4353,11 +4168,6 @@ def test_verify_multicast_traffic_when_FHR_connected_to_RP_p1(request): input_join = {"i1": topo["routers"]["i1"]["links"]["l1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, _GROUP_RANGE, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, _IGMP_JOIN_RANGE, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -4386,11 +4196,6 @@ def test_verify_multicast_traffic_when_FHR_connected_to_RP_p1(request): input_src = {"i3": topo["routers"]["i3"]["links"]["r2"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, _GROUP_RANGE, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, _IGMP_JOIN_RANGE, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) diff --git a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo4.py b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo4.py index dbd1dcec47..275578a5b1 100755 --- a/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo4.py +++ b/tests/topotests/multicast_pim_sm_topo3/test_multicast_pim_sm_topo4.py @@ -210,55 +210,6 @@ def teardown_module(): ##################################################### -def config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, iperf, iperf_intf, GROUP_RANGE, join=False, traffic=False -): - """ - API to do pre-configuration to send IGMP join and multicast - traffic - - parameters: - ----------- - * `tgen`: topogen object - * `topo`: input json data - * `tc_name`: caller test case name - * `iperf`: router running iperf - * `iperf_intf`: interface name router running iperf - * `GROUP_RANGE`: group range - * `join`: IGMP join, default False - * `traffic`: multicast traffic, default False - """ - - if join: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - if traffic: - # Add route to kernal - result = addKernelRoute(tgen, iperf, iperf_intf, GROUP_RANGE) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - - router_list = tgen.routers() - for router in router_list.keys(): - if router == iperf: - continue - - rnode = router_list[router] - rnode.run("echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter") - - for router in topo["routers"].keys(): - if "static_routes" in topo["routers"][router]: - static_routes = topo["routers"][router]["static_routes"] - for static_route in static_routes: - network = static_route["network"] - next_hop = static_route["next_hop"] - if type(network) is not list: - network = [network] - - return True - - def verify_state_incremented(state_before, state_after): """ API to compare interface traffic state incrementing @@ -343,11 +294,6 @@ def test_mroute_when_RP_reachable_default_route_p2(request): input_join = {"i5": topo["routers"]["i5"]["links"]["c2"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -376,11 +322,6 @@ def test_mroute_when_RP_reachable_default_route_p2(request): input_src = {"i4": topo["routers"]["i4"]["links"]["c1"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -642,11 +583,6 @@ def test_mroute_with_RP_default_route_all_nodes_p2(request): input_join = {"i4": topo["routers"]["i4"]["links"]["c1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -675,11 +611,6 @@ def test_mroute_with_RP_default_route_all_nodes_p2(request): input_src = {"i5": topo["routers"]["i5"]["links"]["c2"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) @@ -930,11 +861,6 @@ def test_PIM_hello_tx_rx_p1(request): input_join = {"i4": topo["routers"]["i4"]["links"]["c1"]["interface"]} for recvr, recvr_intf in input_join.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, recvr, recvr_intf, GROUP_RANGE_1, join=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_join(recvr, IGMP_JOIN_RANGE_1, join_intf=recvr_intf) assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) @@ -963,11 +889,6 @@ def test_PIM_hello_tx_rx_p1(request): input_src = {"i5": topo["routers"]["i5"]["links"]["c2"]["interface"]} for src, src_intf in input_src.items(): - result = config_to_send_igmp_join_and_traffic( - tgen, topo, tc_name, src, src_intf, GROUP_RANGE_1, traffic=True - ) - assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result) - result = app_helper.run_traffic(src, IGMP_JOIN_RANGE_1, bind_intf=src_intf) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) diff --git a/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py b/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py index d0ab12e5cc..d599b07a70 100755 --- a/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py +++ b/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py @@ -275,40 +275,6 @@ def teardown_module(): ##################################################### -def config_to_send_igmp_join_and_traffic(tgen, tc_name): - """ - API to do pre-configuration to send IGMP join and multicast - traffic - - parameters: - ----------- - * `tgen`: topogen object - * `tc_name`: caller test case name - """ - - step("r0: Add route to kernal") - result = addKernelRoute(tgen, "r0", "r0-r1-eth0", GROUP_RANGE_ALL) - assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) - - step("r5: Add route to kernal") - result = addKernelRoute(tgen, "r5", "r5-r3-eth0", GROUP_RANGE_ALL) - assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) - - rnode = tgen.routers()["r1"] - rnode.run("ip route add 10.0.6.0/24 via 10.0.2.2") - rnode = tgen.routers()["r2"] - rnode.run("ip route add 10.0.6.0/24 via 10.0.4.2") - rnode = tgen.routers()["r4"] - rnode.run("ip route add 10.0.6.0/24 via 10.0.5.1") - - router_list = tgen.routers() - for router in router_list.keys(): - rnode = router_list[router] - rnode.run("echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter") - - return True - - def verify_mroute_repopulated(uptime_before, uptime_after): """ API to compare uptime for mroutes @@ -405,8 +371,6 @@ def test_add_delete_static_RP_p0(request): pytest.skip(tgen.errors) step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) step("Enable IGMP on r1 interface and send IGMP " "join (225.1.1.1) to r1") step("Configure r2 loopback interface as RP") @@ -572,10 +536,6 @@ def test_SPT_RPT_path_same_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - dut = "r1" intf = "r1-r3-eth2" shutdown_bringup_interface(tgen, dut, intf, False) @@ -728,10 +688,6 @@ def test_not_reachable_static_RP_p0(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - dut = "r1" intf = "r1-r3-eth2" shutdown_bringup_interface(tgen, dut, intf, False) @@ -894,10 +850,6 @@ def test_add_RP_after_join_received_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on R1 interface") step("Configure r2 loopback interface as RP") step("Enable PIM between r1 and r2") @@ -1064,10 +1016,6 @@ def test_reachable_static_RP_after_join_p0(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface and send IGMP " "join (225.1.1.1) to r1") step("Configure r2 loopback interface as RP") step("Enable PIM between r1 and r2") @@ -1231,10 +1179,6 @@ def test_send_join_on_higher_preffered_rp_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range " "224.0.0.0/4") step("Configure RP on r4 (loopback interface) for the group range " "225.1.1.1/32") @@ -1472,10 +1416,6 @@ def test_RP_configured_as_LHR_1_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r1 (loopback interface) for the group range" " 224.0.0.0/4") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -1688,10 +1628,6 @@ def test_RP_configured_as_LHR_2_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r1 (loopback interface) for the group range" " 224.0.0.0/4") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -1898,10 +1834,6 @@ def test_RP_configured_as_FHR_1_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range" " 225.1.1.0/24") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -2107,10 +2039,6 @@ def test_RP_configured_as_FHR_2_p2(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range" " 225.1.1.0/24") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -2320,10 +2248,6 @@ def test_SPT_RPT_path_different_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface and send IGMP join (225.1.1.1) to r1") step("Configure RP on r2 (loopback interface) for the group range" " 224.0.0.0/4") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -2475,10 +2399,6 @@ def test_clear_pim_configuration_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range" " 224.0.0.0/4") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -2572,10 +2492,6 @@ def test_restart_pimd_process_p2(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface and send IGMP join (225.1.1.1) to R1") step("Configure RP on r3 (loopback interface) for the group range" " 224.0.0.0/4") step("Enable the PIM on all the interfaces of r1, r2, r3 and r4 routers") @@ -2732,10 +2648,6 @@ def test_multiple_groups_same_RP_address_p2(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface and send IGMP join (225.1.1.1) to r1") step("Configure RP on r2 (loopback interface) for the group range" "225.1.1.0/24") step("Enable the PIM on all the interfaces of r1-r2-r3") @@ -3041,10 +2953,6 @@ def test_multiple_groups_different_RP_address_p2(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Delete existing RP configuration") input_dict = { "r2": { @@ -3612,10 +3520,6 @@ def test_shutdown_primary_path_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - # Steps to execute step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range" " 224.0.0.0/4") @@ -3805,10 +3709,6 @@ def test_delete_RP_shut_noshut_upstream_interface_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (loopback interface) for the group range" " 224.0.0.0/4") step("r1: Delete the RP config") @@ -3938,10 +3838,6 @@ def test_delete_RP_shut_noshut_RP_interface_p1(request): clear_ip_mroute(tgen) clear_ip_pim_interface_traffic(tgen, TOPO) - step("pre-configuration to send IGMP join and multicast traffic") - result = config_to_send_igmp_join_and_traffic(tgen, tc_name) - assert result is True, "Testcase{}: Failed Error: {}".format(tc_name, result) - step("Enable IGMP on r1 interface") step("Configure RP on r2 (lo) for the group range" " 224.0.0.0/4") step("r2: Delete the RP configuration") -- 2.39.5