4 # Copyright (c) 2020 by VMware, Inc. ("VMware")
5 # Used Copyright (c) 2018 by Network Device Education Foundation,
6 # Inc. ("NetDEF") in this file.
8 # Permission to use, copy, modify, and/or distribute this software
9 # for any purpose with or without fee is hereby granted, provided
10 # that the above copyright notice and this permission notice appear
13 # THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
14 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
16 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
17 # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
19 # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 Following tests are covered to test multicast pim sm:
27 - Create topology (setup module)
30 Following tests are covered:
31 1. TC_17: Verify (*,G) and (S,G) present and multicast traffic resume,
32 after restart of PIMd daemon
33 2. TC_18: Verify (*,G) and (S,G) present and multicast traffic resume after
34 FRR service stop and start
35 3. TC_10: Verify SPT switchover working when RPT and SPT path is
37 4. TC_15: Verify (S,G) and (*,G) mroute after shut / no shut of upstream
39 5. TC_7: Verify mroute detail when receiver is present
41 6. TC_8: Verify mroute when FRR is acting as FHR and LHR
42 7. TC_20: Verify mroute detail when 5 different receiver joining
44 8. TC_22: Verify OIL and IIF detail updated in (S,G) mroute after shut
45 and no shut of the source interface
53 pytestmark
= pytest
.mark
.pimd
55 # Save the Current Working Directory to find configuration files.
56 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
57 sys
.path
.append(os
.path
.join(CWD
, "../"))
58 sys
.path
.append(os
.path
.join(CWD
, "../lib/"))
60 # Required to instantiate the topology builder class.
62 # pylint: disable=C0413
63 # Import topogen and topotest helpers
64 from lib
.topogen
import Topogen
, get_topogen
66 from lib
.common_config
import (
71 reset_config_on_routers
,
72 shutdown_bringup_interface
,
77 required_linux_kernel_version
,
85 get_pim_interface_traffic
,
90 clear_pim_interface_traffic
,
93 from lib
.topolog
import logger
94 from lib
.topojson
import build_config_from_json
97 pytestmark
= [pytest
.mark
.pimd
]
102 i4-----c1-------------c2---i5
105 i1-----l1------r2-----f1---i2
111 i1, i2, i3. i4, i5, i6, i7, i8 - FRR running iperf to send IGMP
121 GROUP_RANGE
= "225.0.0.0/8"
122 IGMP_JOIN
= "225.1.1.1"
130 IGMP_JOIN_RANGE_1
= ["225.1.1.1", "225.1.1.2", "225.1.1.3", "225.1.1.4", "225.1.1.5"]
138 IGMP_JOIN_RANGE_2
= ["226.1.1.1", "226.1.1.2", "226.1.1.3", "226.1.1.4", "226.1.1.5"]
147 IGMP_JOIN_RANGE_3
= ["227.1.1.1", "227.1.1.2", "227.1.1.3", "227.1.1.4", "227.1.1.5"]
150 def setup_module(mod
):
152 Sets up the pytest environment
157 # Required linux kernel version for this suite to run.
158 result
= required_linux_kernel_version("4.19")
159 if result
is not True:
160 pytest
.skip("Kernel requirements are not met")
162 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
163 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
164 logger
.info("=" * 40)
165 logger
.info("Master Topology: \n {}".format(TOPOLOGY
))
167 logger
.info("Running setup_module to create topology")
169 json_file
= "{}/multicast_pim_sm_topo2.json".format(CWD
)
170 tgen
= Topogen(json_file
, mod
.__name
__)
172 topo
= tgen
.json_topo
173 # ... and here it calls Mininet initialization functions.
175 # Starting topology, create tmp files which are loaded to routers
176 # to start daemons and then start routers
179 # Don"t run this test if we have any failure.
180 if tgen
.routers_have_failure():
181 pytest
.skip(tgen
.errors
)
183 # Creating configuration from JSON
184 build_config_from_json(tgen
, topo
)
186 # XXX Replace this using "with McastTesterHelper()... " in each test if possible.
188 app_helper
= McastTesterHelper(tgen
)
190 logger
.info("Running setup_module() done")
193 def teardown_module():
194 """Teardown the pytest environment"""
196 logger
.info("Running teardown_module to delete topology")
202 # Stop toplogy and Remove tmp files
206 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
208 logger
.info("=" * 40)
211 #####################################################
215 #####################################################
218 def verify_state_incremented(state_before
, state_after
):
220 API to compare interface traffic state incrementing
224 * `state_before` : State dictionary for any particular instance
225 * `state_after` : State dictionary for any particular instance
228 for router
, state_data
in state_before
.items():
229 for state
, value
in state_data
.items():
230 if state_before
[router
][state
] >= state_after
[router
][state
]:
232 "[DUT: %s]: state %s value has not"
233 " incremented, Initial value: %s, "
234 "Current value: %s [FAILED!!]"
238 state_before
[router
][state
],
239 state_after
[router
][state
],
245 "[DUT: %s]: State %s value is "
246 "incremented, Initial value: %s, Current value: %s"
250 state_before
[router
][state
],
251 state_after
[router
][state
],
257 def test_verify_mroute_and_traffic_when_pimd_restarted_p2(request
):
259 TC_17: Verify (*,G) and (S,G) present and multicast traffic resume,
260 after restart of PIMd daemon
264 tc_name
= request
.node
.name
265 write_test_header(tc_name
)
267 # Don"t run this test if we have any failure.
268 if tgen
.routers_have_failure():
269 pytest
.skip(tgen
.errors
)
271 # Creating configuration from JSON
272 app_helper
.stop_all_hosts()
274 reset_config_on_routers(tgen
)
275 clear_pim_interface_traffic(tgen
, topo
)
277 step("Configure static RP for (226.1.1.1-5) in c1")
278 step("Configure static RP for (232.1.1.1-5) in c2")
280 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
281 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
288 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
291 "group_addr_range": GROUP_RANGE_2
,
300 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
303 "group_addr_range": GROUP_RANGE_3
,
310 result
= create_pim_config(tgen
, topo
, input_dict
)
311 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
314 "Enable IGMP on FRR1 interface and send IGMP join "
315 "(226.1.1.1-5) and (232.1.1.1-5)"
318 "Configure IGMP interface on FRR3 and send IGMP join"
319 " for group (226.1.1.1-5, 232.1.1.1-5)"
327 "igmp": {"version": "2", "query": {"query-interval": 15}}
333 result
= create_igmp_config(tgen
, topo
, input_dict
)
334 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
336 input_join
= {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"}
338 for recvr
, recvr_intf
in input_join
.items():
339 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
340 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
343 "Connect one source to c2 and send multicast traffic all"
344 " the receivers (226.1.1.1-5, 232.1.1.1-5)"
347 "Send multicast traffic from FRR3 to all the receivers "
348 "(226.1.1.1-5, 232.1.1.1-5)"
351 input_src
= {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"}
353 for src
, src_intf
in input_src
.items():
354 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
355 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
357 # Verifying mroutes before PIMd restart, fetching uptime
359 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
361 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
362 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-i8-eth2"},
364 for data
in input_dict
:
365 result
= verify_mroutes(
373 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
375 for data
in input_dict
:
376 result
= verify_upstream_iif(
377 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
379 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
381 step("Restart Pimd process on FRR3 node")
382 kill_router_daemons(tgen
, "f1", ["pimd"])
383 start_router_daemons(tgen
, "f1", ["pimd"])
385 for data
in input_dict
:
386 result
= verify_mroutes(
394 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
397 "After restart of PIMd verify pim nbr is up , IGMP groups"
398 " received , and (*,G) (S,G) entries populated again ,"
399 " Verify using 'show ip pim neighbor' , 'show ip igmp groups'"
403 result
= verify_pim_neighbors(tgen
, topo
)
404 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
407 interface
= "f1-i8-eth2"
408 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
409 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
411 for data
in input_dict
:
412 result
= verify_upstream_iif(
413 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
415 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
417 step("Stop the traffic and restart PIMd immediately on FRR3 node")
420 shutdown_bringup_interface(tgen
, dut
, intf
, False)
422 kill_router_daemons(tgen
, "f1", ["pimd"])
423 start_router_daemons(tgen
, "f1", ["pimd"])
426 "After PIM process come , all the none of (S,G) mroute should"
427 " present on FRR3 'show ip mroute' "
431 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"}
433 for data
in input_dict
:
434 result
= verify_mroutes(
442 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
445 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "none"}
447 for data
in input_dict
:
448 result
= verify_mroutes(
459 ), "Testcase {} : Failed \n mroutes are still present \n Error: {}".format(
462 logger
.info("Expected Behavior: {}".format(result
))
464 write_test_footer(tc_name
)
467 def test_verify_mroute_and_traffic_when_frr_restarted_p2(request
):
469 TC_18: Verify (*,G) and (S,G) present and multicast traffic resume after
470 FRR service stop and start
474 tc_name
= request
.node
.name
475 write_test_header(tc_name
)
477 # Don"t run this test if we have any failure.
478 if tgen
.routers_have_failure():
479 pytest
.skip(tgen
.errors
)
481 # Creating configuration from JSON
482 app_helper
.stop_all_hosts()
484 reset_config_on_routers(tgen
)
485 clear_pim_interface_traffic(tgen
, topo
)
487 step("Configure static RP for (226.1.1.1-5) in c1")
488 step("Configure static RP for (232.1.1.1-5) in c2")
490 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
491 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
498 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
501 "group_addr_range": GROUP_RANGE_2
,
510 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
513 "group_addr_range": GROUP_RANGE_3
,
520 result
= create_pim_config(tgen
, topo
, input_dict
)
521 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
524 "Enable IGMP on FRR1 interface and send IGMP join "
525 "(226.1.1.1-5) and (232.1.1.1-5)"
528 "Configure IGMP interface on FRR3 and send IGMP join"
529 " for group (226.1.1.1-5, 232.1.1.1-5)"
537 "igmp": {"version": "2", "query": {"query-interval": 15}}
543 result
= create_igmp_config(tgen
, topo
, input_dict
)
544 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
546 input_join
= {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"}
548 for recvr
, recvr_intf
in input_join
.items():
549 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
550 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
553 "Connect one source to c2 and send multicast traffic all"
554 " the receivers (226.1.1.1-5, 232.1.1.1-5)"
557 "Send multicast traffic from FRR3 to all the receivers "
558 "(226.1.1.1-5, 232.1.1.1-5)"
561 input_src
= {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"}
563 for src
, src_intf
in input_src
.items():
564 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
565 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
567 step("Verifying mroutes before FRR restart, fetching uptime")
569 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
571 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
572 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-i8-eth2"},
574 for data
in input_dict
:
575 result
= verify_mroutes(
583 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
585 for data
in input_dict
:
586 result
= verify_upstream_iif(
587 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
589 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
591 step("Stop and Start the FRR services on FRR3 node")
592 stop_router(tgen
, "f1")
593 start_router(tgen
, "f1")
595 for data
in input_dict
:
596 result
= verify_mroutes(
604 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
607 "After stop and start of FRR service verify pim nbr is up "
608 "IGMP groups received , and (*,G) (S,G) entries populated again"
609 " Verify using 'show ip pim neighbor' , 'show ip igmp groups'"
613 result
= verify_pim_neighbors(tgen
, topo
)
614 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
617 interface
= "f1-i8-eth2"
618 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
619 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
621 for data
in input_dict
:
622 result
= verify_upstream_iif(
623 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
625 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
627 step("Stop the traffic and stop and start the FRR services on" " FRR3 node")
628 shutdown_bringup_interface(tgen
, "i2", "i2-f1-eth0", False)
630 stop_router(tgen
, "f1")
631 start_router(tgen
, "f1")
634 "After stop and start of FRR services , all the none of (S,G)"
635 " mroute should present on FRR3 node verify using "
640 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"}
642 for data
in input_dict
:
643 result
= verify_mroutes(
651 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
654 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "none"}
656 for data
in input_dict
:
657 result
= verify_mroutes(
668 ), "Testcase {} : Failed \n mroutes are still present \n Error: {}".format(
671 logger
.info("Expected Behavior: {}".format(result
))
673 write_test_footer(tc_name
)
676 def test_verify_SPT_switchover_when_RPT_and_SPT_path_is_different_p0(request
):
678 TC_10: Verify SPT switchover working when RPT and SPT path is
683 tc_name
= request
.node
.name
684 write_test_header(tc_name
)
686 # Don"t run this test if we have any failure.
687 if tgen
.routers_have_failure():
688 pytest
.skip(tgen
.errors
)
690 # Creating configuration from JSON
691 app_helper
.stop_all_hosts()
693 reset_config_on_routers(tgen
)
694 clear_pim_interface_traffic(tgen
, topo
)
696 step("Configure static RP for (226.1.1.1-5) and " "(232.1.1.1-5) in c2")
698 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
699 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
706 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
709 "group_addr_range": _GROUP_RANGE
,
716 result
= create_pim_config(tgen
, topo
, input_dict
)
717 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
720 "Enable IGMP on FRR1 interface and send IGMP join "
721 "(226.1.1.1-5) and (232.1.1.1-5)"
724 result
= app_helper
.run_join("i1", _IGMP_JOIN_RANGE
, "l1")
725 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
727 step("Send multicast traffic from FRR3 to '226.1.1.1-5'" ", '232.1.1.1-5' receiver")
729 step("registerRx and registerStopTx value before traffic sent")
730 state_dict
= {"c2": {"c2-f1-eth1": ["registerRx", "registerStopTx"]}}
731 state_before
= get_pim_interface_traffic(tgen
, state_dict
)
734 ), "Testcase {} : Failed \n state_before is not dictionary \nError: {}".format(
738 result
= app_helper
.run_traffic("i2", _IGMP_JOIN_RANGE
, "f1")
739 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
742 "Verify in FRR3 sending initial packet to RP using"
743 " 'show ip mroute' and mroute OIL is towards RP."
746 result
= verify_mroutes(
752 ["f1-c2-eth0", "f1-r2-eth3"],
754 assert result
is True, "Testcase {} : " "Failed Error: {}".format(tc_name
, result
)
756 result
= verify_mroutes(
757 tgen
, "f1", "10.0.5.2", _IGMP_JOIN_RANGE
, "f1-i2-eth1", "f1-r2-eth3"
759 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
762 " After spt switchover traffic is flowing between"
763 " (LHR(FRR1)-FHR(FRR3)) and (S,G) OIL is updated toward FRR1"
764 " 'show ip mroute' and 'show ip pim upstream'"
767 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
769 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-r2-eth3"},
770 {"dut": "l1", "src_address": source
, "iif": "l1-r2-eth4", "oil": "l1-i1-eth1"},
772 for data
in input_dict
:
773 result
= verify_mroutes(
781 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
783 for data
in input_dict
:
784 result
= verify_upstream_iif(
785 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
787 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
789 step("Stop the traffic to all the receivers")
791 app_helper
.stop_host("i2")
794 "Null register packet being send periodically from FRR3 to RP, "
795 "verify using show ip mroute on RP, have (S, G) entries null OIL"
796 " 'show ip mroute' and verify show ip pim interface traffic"
797 "(In RP Register msg should be received and Register stop should"
801 {"dut": "c2", "src_address": source
, "iif": "c2-f1-eth1", "oil": "none"}
803 for data
in input_dict
:
804 result
= verify_mroutes(
812 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
814 step("registerRx and registerStopTx value after traffic sent")
815 state_after
= get_pim_interface_traffic(tgen
, state_dict
)
818 ), "Testcase {} : Failed \n state_before is not dictionary \nError: {}".format(
822 result
= verify_state_incremented(state_before
, state_after
)
823 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
825 write_test_footer(tc_name
)
828 def test_verify_mroute_after_shut_noshut_of_upstream_interface_p1(request
):
830 TC_15: Verify (S,G) and (*,G) mroute after shut / no shut of upstream
835 tc_name
= request
.node
.name
836 write_test_header(tc_name
)
838 # Don"t run this test if we have any failure.
839 if tgen
.routers_have_failure():
840 pytest
.skip(tgen
.errors
)
842 # Creating configuration from JSON
843 app_helper
.stop_all_hosts()
845 reset_config_on_routers(tgen
)
846 clear_pim_interface_traffic(tgen
, topo
)
848 step("Configure static RP for (226.1.1.1-5) in c1")
849 step("Configure static RP for (232.1.1.1-5) in c2")
851 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
852 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
859 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
862 "group_addr_range": GROUP_RANGE_2
,
871 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
874 "group_addr_range": GROUP_RANGE_3
,
881 result
= create_pim_config(tgen
, topo
, input_dict
)
882 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
885 "Enable IGMP on FRR1 interface and send IGMP join "
886 "(226.1.1.1-5) and (232.1.1.1-5)"
889 "Configure IGMP interface on FRR3 and send IGMP join"
890 " for group (226.1.1.1-5, 232.1.1.1-5)"
898 "igmp": {"version": "2", "query": {"query-interval": 15}}
904 result
= create_igmp_config(tgen
, topo
, input_dict
)
905 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
907 input_join
= {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"}
909 for recvr
, recvr_intf
in input_join
.items():
910 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
911 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
914 "Connect one source to c2 and send multicast traffic all"
915 " the receivers (226.1.1.1-5, 232.1.1.1-5)"
918 "Send multicast traffic from FRR3 to all the receivers "
919 "(226.1.1.1-5, 232.1.1.1-5)"
922 input_src
= {"i2": "i2-f1-eth0", "i5": "i5-c2-eth0"}
924 for src
, src_intf
in input_src
.items():
925 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
926 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
929 "FRR3 (S,G) has one OIL for local receiver one toward c2"
930 " verify 'show ip mroute' and 'show ip pim upstream'"
933 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
935 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
936 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-i8-eth2"},
938 for data
in input_dict
:
939 result
= verify_mroutes(
947 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
949 for data
in input_dict
:
950 result
= verify_upstream_iif(
951 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_2
953 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
955 step("Shut and No shut interface connected from FHR (FRR3)" " to c2")
958 shutdown_bringup_interface(tgen
, dut
, intf
, False)
959 shutdown_bringup_interface(tgen
, dut
, intf
, True)
961 step("Shut and No shut interface connected from LHR (FRR1)" " to c1")
964 shutdown_bringup_interface(tgen
, dut
, intf
, False)
965 shutdown_bringup_interface(tgen
, dut
, intf
, True)
967 for data
in input_dict
:
968 result
= verify_mroutes(
976 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
978 step("Shut and No shut FRR1 and FRR3 interface")
979 shutdown_bringup_interface(tgen
, "l1", "l1-r2-eth4", False)
980 shutdown_bringup_interface(tgen
, dut
, intf
, True)
982 shutdown_bringup_interface(tgen
, "f1", "f1-r2-eth3", False)
983 shutdown_bringup_interface(tgen
, dut
, intf
, True)
986 "After shut/no shut of interface , verify traffic resume to all"
987 "the receivers (S,G) OIL update for all the receivers"
990 for data
in input_dict
:
991 result
= verify_mroutes(
999 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1002 "Shut FRR1, FRR3 interface , clear mroute in FRR1"
1003 " and No shut FRR1, FRR3 interface "
1007 shutdown_bringup_interface(tgen
, dut
, intf
, False)
1011 shutdown_bringup_interface(tgen
, dut
, intf
, False)
1015 shutdown_bringup_interface(tgen
, dut
, intf
, True)
1019 shutdown_bringup_interface(tgen
, dut
, intf
, True)
1021 clear_mroute(tgen
, "l1")
1022 clear_mroute(tgen
, "l1")
1025 "After no shut, verify traffic resume to all the receivers"
1026 " (S,G) OIL update for all the receivers"
1029 for data
in input_dict
:
1030 result
= verify_mroutes(
1033 data
["src_address"],
1038 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1041 "Shut and no shut upstream interface from FRR1 to FRR2 and "
1042 "cisco immediate after mroute/upstream got cleared"
1046 intf_l1_r2
= "l1-r2-eth4"
1047 shutdown_bringup_interface(tgen
, dut
, intf_l1_r2
, False)
1049 intf_l1_c1
= "l1-c1-eth0"
1050 shutdown_bringup_interface(tgen
, dut
, intf_l1_c1
, False)
1052 result
= verify_upstream_iif(
1053 tgen
, "l1", "Unknown", source
, IGMP_JOIN_RANGE_2
, expected
=False
1055 assert result
is not True, (
1056 "Testcase {} : Failed Error: \n "
1057 "mroutes are still present, after waiting for 10 mins".format(tc_name
)
1060 step("No shut the Source interface just after the upstream is expired" " from FRR1")
1061 shutdown_bringup_interface(tgen
, dut
, intf_l1_r2
, True)
1062 shutdown_bringup_interface(tgen
, dut
, intf_l1_c1
, True)
1064 for data
in input_dict
:
1065 result
= verify_mroutes(
1068 data
["src_address"],
1073 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1075 step("Stop the traffic to all the receivers")
1076 app_helper
.stop_all_hosts()
1078 for data
in input_dict
:
1079 result
= verify_mroutes(
1082 data
["src_address"],
1090 ), "Testcase {} : Failed \n mroutes are still present \n Error: {}".format(
1093 logger
.info("Expected Behavior: {}".format(result
))
1095 write_test_footer(tc_name
)
1098 def test_verify_mroute_when_receiver_is_outside_frr_p0(request
):
1100 TC_7: Verify mroute detail when receiver is present
1104 tgen
= get_topogen()
1105 tc_name
= request
.node
.name
1106 write_test_header(tc_name
)
1108 # Don"t run this test if we have any failure.
1109 if tgen
.routers_have_failure():
1110 pytest
.skip(tgen
.errors
)
1112 # Creating configuration from JSON
1113 app_helper
.stop_all_hosts()
1115 reset_config_on_routers(tgen
)
1116 clear_pim_interface_traffic(tgen
, topo
)
1118 step("Configure static RP on c1 for group range " "(226.1.1.1-5) and (232.1.1.1-5)")
1120 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
1121 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
1128 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
1131 "group_addr_range": _GROUP_RANGE
,
1138 result
= create_pim_config(tgen
, topo
, input_dict
)
1139 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1142 "Enable IGMP on FRR1 interface and send IGMP join"
1143 " (226.1.1.1-5) and (232.1.1.1-5)"
1145 result
= app_helper
.run_join("i1", _IGMP_JOIN_RANGE
, "l1")
1146 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1149 "Send multicast traffic from FRR3 to all the receivers "
1150 "(226.1.1.1-5) and (232.1.1.1-5)"
1152 result
= app_helper
.run_traffic("i2", _IGMP_JOIN_RANGE
, "f1")
1153 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1156 "Configure one more receiver in c2 enable IGMP and send"
1157 " join (226.1.1.1-5) and (232.1.1.1-5)"
1164 "igmp": {"version": "2", "query": {"query-interval": 15}}
1170 result
= create_igmp_config(tgen
, topo
, input_dict
)
1171 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1173 result
= app_helper
.run_join("i5", _IGMP_JOIN_RANGE
, "c2")
1174 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1176 step("FRR1 has 10 (*.G) and 10 (S,G) verify using 'show ip mroute count'")
1178 "All the receiver are receiving traffic on FRR1 and (S,G) OIL is toward"
1179 "receivers, verify using 'show ip mroute' 'show ip pim upstream'"
1182 "All the receiver are receiving traffic on c2 and (S,G) OIL is "
1183 "toward receivers, verify using 'show ip mroute' 'show ip pim upstream'"
1186 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1188 {"dut": "l1", "src_address": "*", "iif": "l1-c1-eth0", "oil": "l1-i1-eth1"},
1189 {"dut": "l1", "src_address": source
, "iif": "l1-r2-eth4", "oil": "l1-i1-eth1"},
1190 {"dut": "c2", "src_address": "*", "iif": "c2-c1-eth0", "oil": "c2-i5-eth2"},
1191 {"dut": "c2", "src_address": source
, "iif": "c2-f1-eth1", "oil": "c2-i5-eth2"},
1193 for data
in input_dict
:
1194 result
= verify_mroutes(
1197 data
["src_address"],
1202 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1205 "FRR3 has (S,G) OIL created toward c1/c2 receiver and FRR1 receiver"
1206 "'show ip pim state'"
1209 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-c2-eth0"},
1210 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-r2-eth3"},
1212 for data
in input_dict
:
1213 result
= verify_pim_state(
1219 data
["src_address"],
1221 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1223 for data
in input_dict
:
1224 result
= verify_upstream_iif(
1225 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
1227 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1229 write_test_footer(tc_name
)
1232 def test_verify_mroute_when_FRR_is_FHR_and_LHR_p0(request
):
1234 TC_8: Verify mroute when FRR is acting as FHR and LHR
1237 tgen
= get_topogen()
1238 tc_name
= request
.node
.name
1239 write_test_header(tc_name
)
1241 # Don"t run this test if we have any failure.
1242 if tgen
.routers_have_failure():
1243 pytest
.skip(tgen
.errors
)
1245 # Creating configuration from JSON
1246 app_helper
.stop_all_hosts()
1248 reset_config_on_routers(tgen
)
1249 clear_pim_interface_traffic(tgen
, topo
)
1251 step("Configure static RP for group range (226.1.1.1-5) and " "(232.1.1.1-5) on c1")
1252 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
1253 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
1260 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
1263 "group_addr_range": _GROUP_RANGE
,
1270 result
= create_pim_config(tgen
, topo
, input_dict
)
1271 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1274 "Enable IGMP on FRR1 interface and send IGMP join (226.1.1.1-5)"
1275 " and (232.1.1.1-5)"
1278 "Configure receiver on FRR3 with igmp and pim enabled and "
1279 "send IGMP join (226.1.1.1-5) and (232.1.1.1-5)"
1282 "Send multicast traffic from FRR3 to all the receivers "
1283 "(226.1.1.1-5) and (232.1.1.1-5)"
1286 step("Send IGMP join (226.1.1.1-5, 232.1.1.1-5) to LHR(l1)")
1287 result
= app_helper
.run_join("i1", _IGMP_JOIN_RANGE
, "l1")
1288 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1290 step("Send multicast traffic from FRR3 to '226.1.1.1-5'" ", '232.1.1.1-5' receiver")
1291 result
= app_helper
.run_traffic("i2", _IGMP_JOIN_RANGE
, "f1")
1292 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1295 "Configure receiver in f1 enable IGMP and send"
1296 " join (226.1.1.1-5) and (232.1.1.1-5)"
1299 step("Configure one IGMP interface on f1 node and send IGMP" " join (225.1.1.1)")
1305 "igmp": {"version": "2", "query": {"query-interval": 15}}
1311 result
= create_igmp_config(tgen
, topo
, input_dict
)
1312 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1314 result
= app_helper
.run_join("i8", _IGMP_JOIN_RANGE
, "f1")
1315 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1317 "l1 and f1 has 10 IGMP groups (226.1.1.1-5, 232.1.1.1-5),"
1318 " verify using 'show ip igmp groups'"
1321 interface
= "l1-i1-eth1"
1322 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
1323 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1326 interface
= "f1-i8-eth2"
1327 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
1328 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1331 "l1 , f1 has 10 (*,G) and 10 (S,G) for groups "
1332 "(226.1.1.1-5, 232.1.1.1-5), verify using "
1336 source
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1338 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
1339 {"dut": "f1", "src_address": source
, "iif": "f1-i2-eth1", "oil": "f1-r2-eth3"},
1340 {"dut": "l1", "src_address": "*", "iif": "l1-c1-eth0", "oil": "l1-i1-eth1"},
1341 {"dut": "l1", "src_address": source
, "iif": "l1-r2-eth4", "oil": "l1-i1-eth1"},
1343 for data
in input_dict
:
1344 result
= verify_mroutes(
1347 data
["src_address"],
1352 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1354 step("Join timer is running in FHR and LHR , verify using" " 'show ip pim state'")
1356 for data
in input_dict
:
1357 result
= verify_pim_state(
1363 data
["src_address"],
1365 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1367 # Stop the multicast traffic
1368 step("Stop the traffic to all the receivers")
1369 app_helper
.stop_all_hosts()
1372 "After traffic stopped , verify (*,G) entries are not flushed"
1373 " out from FRR1 node verify using 'show ip mroute' "
1377 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
1378 {"dut": "l1", "src_address": "*", "iif": "l1-c1-eth0", "oil": "l1-i1-eth1"},
1380 for data
in input_dict
:
1381 result
= verify_mroutes(
1384 data
["src_address"],
1391 ), "Testcase {} : Failed Error mroutes were flushed.".format(tc_name
)
1394 "After traffic stopped , verify (S,G) entries are flushed out"
1395 " from FRR1 node verify using 'show ip mroute' "
1399 {"dut": "l1", "src_address": source
, "iif": "l1-r2-eth4", "oil": "l1-i1-eth1"},
1400 {"dut": "f1", "src_address": source
, "iif": "i2-f1-eth0", "oil": "f1-r2-eth3"},
1403 for data
in input_dict
:
1404 result
= verify_mroutes(
1407 data
["src_address"],
1415 ), "Testcase {} : Failed Error: \nmroutes are still present".format(tc_name
)
1417 write_test_footer(tc_name
)
1420 def test_verify_mroute_when_5_different_receiver_joining_same_sources_p0(request
):
1422 TC_20: Verify mroute detail when 5 different receiver joining
1426 tgen
= get_topogen()
1427 tc_name
= request
.node
.name
1428 write_test_header(tc_name
)
1430 # Don"t run this test if we have any failure.
1431 if tgen
.routers_have_failure():
1432 pytest
.skip(tgen
.errors
)
1434 # Creating configuration from JSON
1435 app_helper
.stop_all_hosts()
1437 reset_config_on_routers(tgen
)
1438 clear_pim_interface_traffic(tgen
, topo
)
1440 step("Configure static RP for (226.1.1.1-5) in c1")
1441 step("Configure static RP for (232.1.1.1-5) in c2")
1443 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
1444 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
1451 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
1454 "group_addr_range": GROUP_RANGE_2
,
1463 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
1466 "group_addr_range": GROUP_RANGE_3
,
1473 result
= create_pim_config(tgen
, topo
, input_dict
)
1474 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1477 "Configure 2 IGMP interface on FRR1 and send IGMP join"
1478 "for group (226.1.1.1-5, 232.1.1.1-5) from both the interface"
1481 "Configure 2 IGMP interface on FRR3 and send IGMP join for"
1482 " group (226.1.1.1-5, 232.1.1.1-5) from both the interface"
1485 "Configure 1 IGMP interface on c2 and send IGMP join for"
1486 "group (226.1.1.1-5, 232.1.1.1-5)"
1494 "igmp": {"version": "2", "query": {"query-interval": 15}}
1497 "igmp": {"version": "2", "query": {"query-interval": 15}}
1506 "igmp": {"version": "2", "query": {"query-interval": 15}}
1512 result
= create_igmp_config(tgen
, topo
, input_dict
)
1513 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1522 for recvr
, recvr_intf
in input_join
.items():
1523 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
1524 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1526 step("Configure one source in FRR2 , one in c1")
1528 "Send multicast traffic from both the sources to all the"
1529 "receivers (226.1.1.1-5, 232.1.1.1-5)"
1532 input_src
= {"i3": "i3-r2-eth0"}
1534 for src
, src_intf
in input_src
.items():
1535 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
1536 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1538 "After all the IGMP groups received with correct port using"
1539 " 'show ip igmp groups' in FRR1, FRR3, c2"
1542 interface
= "l1-i6-eth2"
1543 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
1544 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1547 interface
= "f1-i8-eth2"
1548 result
= verify_igmp_groups(tgen
, dut
, interface
, _IGMP_JOIN_RANGE
)
1549 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1552 "(*,G) entries got created with upstream interface RP connected"
1553 " port using 'show ip pim upstream' in FRR1, FRR3, c2"
1556 "(S,G) entries created for all the receiver after starting the"
1557 " source , traffic is reaching to all the receiver , verify OIL"
1558 " of (S,G) is receiver port using 'show ip mroute' in FRR1, "
1562 source
= topo
["routers"]["i3"]["links"]["r2"]["ipv4"].split("/")[0]
1566 "src_address": source
,
1567 "iif": ["l1-r2-eth4", "l1-c1-eth0"],
1568 "oil": ["l1-i1-eth1", "l1-i6-eth2"],
1570 {"dut": "f1", "src_address": source
, "iif": "f1-r2-eth3", "oil": "f1-i8-eth2"},
1572 for data
in input_dict_all
:
1573 result
= verify_mroutes(
1576 data
["src_address"],
1581 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1583 for data
in input_dict_all
:
1584 result
= verify_upstream_iif(
1585 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
1587 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1589 step("Shut the receiver interface one by one on FRR1 node")
1590 shutdown_bringup_interface(tgen
, "l1", "l1-i1-eth1", False)
1591 shutdown_bringup_interface(tgen
, "l1", "l1-i6-eth2", False)
1594 "After shut the receiver port verify traffic is stopped immediately"
1595 " and (S,G) got timeout immediately in FRR1, FRR3, c2"
1598 {"dut": "l1", "src_address": source
, "iif": "l1-r2-eth4", "oil": "l1-i1-eth1"}
1600 for data
in input_dict
:
1601 result
= verify_mroutes(
1604 data
["src_address"],
1612 ), "Testcase {} : Failed \n mroutes are still present \n Error: {}".format(
1615 logger
.info("Expected Behavior: {}".format(result
))
1618 "No traffic impact observed on other receivers verify using"
1619 " 'show ip mroute' "
1622 {"dut": "f1", "src_address": source
, "iif": "f1-r2-eth3", "oil": "f1-i8-eth2"}
1624 for data
in input_dict
:
1625 result
= verify_mroutes(
1628 data
["src_address"],
1633 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1635 step("No shut the receiver interface one by one on FRR1 node")
1636 shutdown_bringup_interface(tgen
, "l1", "l1-i1-eth1", True)
1637 shutdown_bringup_interface(tgen
, "l1", "l1-i6-eth2", True)
1640 "After no shut of receivers all the mroute entries got populated"
1641 ", no duplicate entries present in mroute"
1644 for data
in input_dict_all
:
1645 result
= verify_mroutes(
1648 data
["src_address"],
1653 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1655 write_test_footer(tc_name
)
1658 def test_verify_oil_iif_for_mroute_after_shut_noshut_source_interface_p1(request
):
1660 TC_22: Verify OIL and IIF detail updated in (S,G) mroute after shut
1661 and no shut of the source interface
1664 tgen
= get_topogen()
1665 tc_name
= request
.node
.name
1666 write_test_header(tc_name
)
1668 # Don"t run this test if we have any failure.
1669 if tgen
.routers_have_failure():
1670 pytest
.skip(tgen
.errors
)
1672 # Creating configuration from JSON
1673 app_helper
.stop_all_hosts()
1675 reset_config_on_routers(tgen
)
1676 clear_pim_interface_traffic(tgen
, topo
)
1678 step("Configure static RP for (226.1.1.1-5) in c1")
1679 step("Configure static RP for (232.1.1.1-5) in c2")
1681 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
1682 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
1689 "rp_addr": topo
["routers"]["c1"]["links"]["lo"]["ipv4"].split(
1692 "group_addr_range": GROUP_RANGE_2
,
1701 "rp_addr": topo
["routers"]["c2"]["links"]["lo"]["ipv4"].split(
1704 "group_addr_range": GROUP_RANGE_3
,
1711 result
= create_pim_config(tgen
, topo
, input_dict
)
1712 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1715 "Configure IGMP interface on FRR1 and FRR3 and send IGMP join"
1716 " for group (226.1.1.1-5, 232.1.1.1-5)"
1724 "igmp": {"version": "2", "query": {"query-interval": 15}}
1730 result
= create_igmp_config(tgen
, topo
, input_dict
)
1731 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1733 input_join
= {"i1": "i1-l1-eth0", "i8": "i8-f1-eth0"}
1735 for recvr
, recvr_intf
in input_join
.items():
1736 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
1737 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1739 step("Configure 1 source in FRR1 , 1 in FRR3")
1741 "Send multicast traffic from both the sources to all the "
1742 "receivers (226.1.1.1-5, 232.1.1.1-5)"
1745 input_src
= {"i6": "i6-l1-eth0", "i2": "i2-f1-eth0"}
1747 for src
, src_intf
in input_src
.items():
1748 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
1749 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1752 "*,G) is created and (S,G) created on FRR1 and FRR3 for both"
1753 " the source verify using 'show ip mroute' and "
1754 " 'show ip pim upstream' to check the upstream interface"
1758 source_i6
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
1759 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1761 {"dut": "l1", "src_address": "*", "iif": "l1-c1-eth0", "oil": "l1-i1-eth1"},
1764 "src_address": source_i2
,
1765 "iif": "l1-r2-eth4",
1766 "oil": "l1-i1-eth1",
1770 "src_address": source_i6
,
1771 "iif": "l1-i6-eth2",
1772 "oil": "l1-i1-eth1",
1774 {"dut": "f1", "src_address": "*", "iif": "f1-c2-eth0", "oil": "f1-i8-eth2"},
1777 "src_address": source_i2
,
1778 "iif": "f1-i2-eth1",
1779 "oil": "f1-i8-eth2",
1783 "src_address": source_i6
,
1784 "iif": "f1-r2-eth3",
1785 "oil": "f1-i8-eth2",
1788 for data
in input_dict_all
:
1789 result
= verify_mroutes(
1792 data
["src_address"],
1797 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1799 for data
in input_dict_all
:
1800 result
= verify_upstream_iif(
1801 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
1803 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1805 step("Shut the source interface one by one on FRR1")
1806 shutdown_bringup_interface(tgen
, "f1", "f1-i2-eth1", False)
1809 "After shut of ource interface from FRR3 verify all the (S,G) "
1810 "entries flushed out from FRR3 node 'show ip pim upstream' "
1811 " 'show ip mroute' "
1814 result
= verify_mroutes(
1825 ), "Testcase {} : Failed \n mroutes are" " still present \n Error: {}".format(
1828 logger
.info("Expected Behavior: {}".format(result
))
1830 result
= verify_upstream_iif(
1831 tgen
, "f1", "Unknown", "10.0.5.2", _IGMP_JOIN_RANGE
, joinState
="NotJoined"
1833 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1835 write_test_footer(tc_name
)
1838 if __name__
== "__main__":
1839 args
= ["-s"] + sys
.argv
[1:]
1840 sys
.exit(pytest
.main(args
))