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:
32 1. verify oil when join prune sent scenario_1 p0
33 2. verify oil when join prune sent scenario_2 p0
34 3. shut noshut source interface when upstream cleared from LHR p0(
35 4. shut noshut receiver interface when upstream cleared from LHR p0(
36 5. verify igmp clis p0
37 6. verify igmp cli generate query once p0
38 7. verify remove add igmp config to receiver interface p0
39 8. verify remove add igmp commands when pim configured p0
40 9. verify remove add pim commands when igmp configured p0
41 10. pim dr priority p0
42 11. pim hello timer p0
43 12. Verify mroute after removing RP sending IGMP prune p2
44 13. Verify prune is sent to LHR and FHR when PIM nbr went down
45 14. Verify mroute flag in LHR and FHR node
46 15. Verify IGMP prune processed correctly when same join received from IGMP and PIM
47 16. Verify multicast traffic flowing fine, when LHR connected to RP
48 17. Verify multicast traffic is flowing fine when FHR is connected to RP
57 from time
import sleep
59 pytestmark
= pytest
.mark
.pimd
61 # Save the Current Working Directory to find configuration files.
62 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
63 sys
.path
.append(os
.path
.join(CWD
, "../"))
64 sys
.path
.append(os
.path
.join(CWD
, "../lib/"))
66 # Required to instantiate the topology builder class.
68 # pylint: disable=C0413
69 # Import topogen and topotest helpers
70 from lib
.topogen
import Topogen
, get_topogen
72 from lib
.common_config
import (
77 reset_config_on_routers
,
78 shutdown_bringup_interface
,
81 required_linux_kernel_version
,
90 clear_pim_interface_traffic
,
95 verify_multicast_traffic
,
97 verify_multicast_flag_state
,
99 verify_pim_interface_traffic
,
101 from lib
.topolog
import logger
102 from lib
.topojson
import build_config_from_json
104 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
105 pytestmark
= pytest
.mark
.pimd
109 i4-----c1-------------c2---i5
112 i1-----l1------r2-----f1---i2
118 i1, i2, i3. i4, i5, i6, i7, i8 - FRR running iperf to send IGMP
129 GROUP_RANGE
= "225.0.0.0/8"
130 IGMP_GROUP
= "225.1.1.1/32"
131 IGMP_JOIN
= "225.1.1.1"
132 VLAN_INTF_ADRESS_1
= "10.0.8.3/24"
140 IGMP_JOIN_RANGE_1
= ["225.1.1.1", "225.1.1.2", "225.1.1.3", "225.1.1.4", "225.1.1.5"]
148 IGMP_JOIN_RANGE_2
= ["226.1.1.1", "226.1.1.2", "226.1.1.3", "226.1.1.4", "226.1.1.5"]
156 IGMP_JOIN_RANGE_3
= ["227.1.1.1", "227.1.1.2", "227.1.1.3", "227.1.1.4", "227.1.1.5"]
158 SAME_VLAN_IP_1
= {"ip": "10.1.1.1", "subnet": "255.255.255.0", "cidr": "24"}
159 SAME_VLAN_IP_2
= {"ip": "10.1.1.2", "subnet": "255.255.255.0", "cidr": "24"}
160 SAME_VLAN_IP_3
= {"ip": "10.1.1.3", "subnet": "255.255.255.0", "cidr": "24"}
161 SAME_VLAN_IP_4
= {"ip": "10.1.1.4", "subnet": "255.255.255.0", "cidr": "24"}
164 def setup_module(mod
):
166 Sets up the pytest environment
171 # Required linux kernel version for this suite to run.
172 result
= required_linux_kernel_version("4.19")
173 if result
is not True:
174 pytest
.skip("Kernel version should be >= 4.19")
176 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
177 logger
.info("Testsuite start time: {}".format(testsuite_run_time
))
178 logger
.info("=" * 40)
179 logger
.info("Master Topology: \n {}".format(TOPOLOGY
))
181 logger
.info("Running setup_module to create topology")
183 json_file
= "{}/multicast_pim_sm_topo3.json".format(CWD
)
184 tgen
= Topogen(json_file
, mod
.__name
__)
186 topo
= tgen
.json_topo
187 # ... and here it calls Mininet initialization functions.
189 # Starting topology, create tmp files which are loaded to routers
190 # to start daemons and then start routers
193 # Don"t run this test if we have any failure.
194 if tgen
.routers_have_failure():
195 pytest
.skip(tgen
.errors
)
197 # Creating configuration from JSON
198 build_config_from_json(tgen
, topo
)
200 # XXX Replace this using "with McastTesterHelper()... " in each test if possible.
202 app_helper
= McastTesterHelper(tgen
)
204 logger
.info("Running setup_module() done")
207 def teardown_module():
208 """Teardown the pytest environment"""
210 logger
.info("Running teardown_module to delete topology")
216 # Stop toplogy and Remove tmp files
220 "Testsuite end time: {}".format(time
.asctime(time
.localtime(time
.time())))
222 logger
.info("=" * 40)
225 #####################################################
229 #####################################################
232 def verify_mroute_repopulated(uptime_before
, uptime_after
):
234 API to compare uptime for mroutes
238 * `uptime_before` : Uptime dictionary for any particular instance
239 * `uptime_after` : Uptime dictionary for any particular instance
242 for group
in uptime_before
.keys():
243 for source
in uptime_before
[group
].keys():
244 if set(uptime_before
[group
]) != set(uptime_after
[group
]):
246 "mroute (%s, %s) has not come"
247 " up after mroute clear [FAILED!!]" % (source
, group
)
251 d1
= datetime
.datetime
.strptime(uptime_before
[group
][source
], "%H:%M:%S")
252 d2
= datetime
.datetime
.strptime(uptime_after
[group
][source
], "%H:%M:%S")
254 errormsg
= "mroute (%s, %s) is not " "repopulated [FAILED!!]" % (
260 logger
.info("mroute (%s, %s) is " "repopulated [PASSED!!]", source
, group
)
265 def verify_state_incremented(state_before
, state_after
):
267 API to compare interface traffic state incrementing
271 * `state_before` : State dictionary for any particular instance
272 * `state_after` : State dictionary for any particular instance
275 for ttype
, v1
in state_before
.items():
276 for intf
, v2
in v1
.items():
277 for state
, value
in v2
.items():
278 if value
>= state_after
[ttype
][intf
][state
]:
279 errormsg
= "[DUT: %s]: state %s value has not incremented, Initial value: %s, Current value: %s [FAILED!!]" % (
283 state_after
[ttype
][intf
][state
],
288 "[DUT: %s]: State %s value is incremented, Initial value: %s, Current value: %s [PASSED!!]",
292 state_after
[ttype
][intf
][state
],
298 def find_v2_query_msg_in_tcpdump(tgen
, router
, message
, count
, cap_file
):
300 Find v2 query messages in tcpdump file
304 * `tgen` : Topology handler
305 * `router` : Device under test
306 * `cap_file` : tcp dump file name
310 filepath
= os
.path
.join(tgen
.logdir
, router
, cap_file
)
311 with
open(filepath
) as f
:
312 if len(re
.findall("{}".format(message
), f
.read())) < count
:
313 errormsg
= "[DUT: %s]: Verify Message: %s in tcpdump" " [FAILED!!]" % (
320 "[DUT: %s]: Found message: %s in tcpdump " " count: %s [PASSED!!]",
328 def find_tos_in_tcpdump(tgen
, router
, message
, cap_file
):
330 Find v2 query messages in tcpdump file
334 * `tgen` : Topology handler
335 * `router` : Device under test
336 * `cap_file` : tcp dump file name
340 filepath
= os
.path
.join(tgen
.logdir
, router
, cap_file
)
341 with
open(filepath
) as f
:
343 if len(re
.findall(message
, f
.read())) < 1:
344 errormsg
= "[DUT: %s]: Verify Message: %s in tcpdump" " [FAILED!!]" % (
351 "[DUT: %s]: Found message: %s in tcpdump " "[PASSED!!]", router
, message
356 def verify_pim_stats_increament(stats_before
, stats_after
):
358 API to compare pim interface control plane traffic
362 * `stats_before` : Stats dictionary for any particular instance
363 * `stats_after` : Stats dictionary for any particular instance
366 for router
, stats_data
in stats_before
.items():
367 for stats
, value
in stats_data
.items():
368 if stats_before
[router
][stats
] >= stats_after
[router
][stats
]:
370 "[DUT: %s]: state %s value has not"
371 " incremented, Initial value: %s, "
372 "Current value: %s [FAILED!!]"
376 stats_before
[router
][stats
],
377 stats_after
[router
][stats
],
383 "[DUT: %s]: State %s value is "
384 "incremented, Initial value: %s, Current value: %s"
388 stats_before
[router
][stats
],
389 stats_after
[router
][stats
],
395 def test_verify_oil_when_join_prune_sent_scenario_1_p1(request
):
398 Verify OIL detail updated in (S,G) and (*,G) mroute when IGMP
403 tc_name
= request
.node
.name
404 write_test_header(tc_name
)
406 # Don"t run this test if we have any failure.
407 if tgen
.routers_have_failure():
408 pytest
.skip(tgen
.errors
)
410 # Creating configuration from JSON
411 app_helper
.stop_all_hosts()
413 reset_config_on_routers(tgen
)
414 clear_pim_interface_traffic(tgen
, topo
)
415 check_router_status(tgen
)
417 step("Enable the PIM on all the interfaces of FRR1, FRR2, FRR3")
419 "Enable IGMP of FRR1 interface and send IGMP joins "
420 " from FRR1 node for group range (226.1.1.1-5)"
423 "Enable IGMP of FRR3 interface and send IGMP joins "
424 " from FRR3 node for group range (226.1.1.1-5)"
427 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
433 "igmp": {"version": "2", "query": {"query-interval": 15}}
439 result
= create_igmp_config(tgen
, topo
, input_dict
)
440 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
443 "i1": topo
["routers"]["i1"]["links"]["l1"]["interface"],
444 "i8": topo
["routers"]["i8"]["links"]["f1"]["interface"],
447 for recvr
, recvr_intf
in input_join
.items():
448 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
449 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
451 step("Configure static RP for (226.1.1.1-5) in R2")
458 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
461 "group_addr_range": GROUP_RANGE
,
468 result
= create_pim_config(tgen
, topo
, input_dict
)
469 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
472 "Configure one source on FRR3 for all the groups and send" " multicast traffic"
475 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
477 for src
, src_intf
in input_src
.items():
478 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
479 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
481 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
486 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
487 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
491 "src_address": source_i2
,
492 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
493 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
499 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
503 "src_address": source_i2
,
504 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
505 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
510 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
511 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
515 "src_address": source_i2
,
516 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
517 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
521 step("Verify mroutes and iff upstream")
523 for data
in input_dict_all
:
524 result
= verify_mroutes(
532 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
534 for data
in input_dict_all
:
535 result
= verify_upstream_iif(
536 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
538 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
540 step("Send the IGMP prune from ixia to (226.1.1.1-5) receiver on " "FRR1 node")
542 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
543 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, False)
546 "After receiving the IGMP prune from FRR1 , verify traffic "
547 "immediately stopped for this receiver 'show ip multicast'"
550 input_traffic
= {"l1": {"traffic_sent": [intf_l1_i1
]}}
551 result
= verify_multicast_traffic(tgen
, input_traffic
, expected
=False)
552 assert result
is not True, (
553 "Testcase {} : Failed \n "
554 "Expected: [{}]: Multicast traffic should be stopped \n "
555 "Found: {}".format(tc_name
, "l1", result
)
559 "IGMP groups are remove from FRR1 node 'show ip igmp groups'"
560 " FRR3 IGMP still present"
564 result
= verify_igmp_groups(
565 tgen
, dut
, intf_l1_i1
, IGMP_JOIN_RANGE_1
, expected
=False
567 assert result
is not True, (
568 "Testcase {} : Failed \n "
569 "Expected: [{}]: IGMP groups should be deleted \n "
570 "Found: {}".format(tc_name
, dut
, result
)
574 result
= verify_igmp_groups(tgen
, dut
, intf_f1_i8
, IGMP_JOIN_RANGE_1
)
575 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
578 "(*,G) and (S,G) OIL got removed immediately after receiving"
579 " prune 'show ip pim state' and 'show ip mroute' on FRR1 node,"
580 " no impact on FRR3 receiver"
587 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
588 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
592 "src_address": source_i2
,
593 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
594 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
598 step("Verify mroutes and iff upstream")
600 for data
in input_dict_l1
:
601 result
= verify_mroutes(
610 assert result
is not True, (
611 "Testcase {} : Failed \n "
612 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
613 "Found: {}".format(tc_name
, data
["dut"], result
)
616 for data
in input_dict_l1
:
617 result
= verify_upstream_iif(
625 assert result
is not True, (
626 "Testcase {} : Failed \n "
627 "Expected: [{}]: Upstream IIF {} should not be present \n "
628 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
635 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
636 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
640 "src_address": source_i2
,
641 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
642 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
646 step("Verify mroutes and iff upstream")
648 for data
in input_dict_f1
:
649 result
= verify_mroutes(
657 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
659 for data
in input_dict_f1
:
660 result
= verify_upstream_iif(
661 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
663 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
665 step("Send the IGMP prune from ixia to (226.1.1.1-5) receiver on " " FRR3 node")
667 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
668 shutdown_bringup_interface(tgen
, "f1", intf_f1_i8
, False)
671 "After receiving the IGMP prune from FRR3s , verify traffic "
672 "immediately stopped for this receiver 'show ip multicast'"
675 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
676 result
= verify_multicast_traffic(tgen
, input_traffic
, expected
=False)
677 assert result
is not True, (
678 "Testcase {} : Failed \n "
679 "Expected: [{}]: Multicast traffic should be stopped \n "
680 "Found: {}".format(tc_name
, "f1", result
)
684 "IGMP groups are remove from FRR1 node 'show ip igmp groups'"
685 " FRR3 IGMP still present"
689 result
= verify_igmp_groups(
690 tgen
, dut
, intf_f1_i8
, IGMP_JOIN_RANGE_1
, expected
=False
692 assert result
is not True, (
693 "Testcase {} : Failed \n "
694 "Expected: [{}]: IGMP groups should be deleted \n "
695 "Found: {}".format(tc_name
, dut
, result
)
699 "(*,G) and (S,G) OIL got prune state (none) from all the nodes"
700 "FRR1, FRR3 verify using 'show ip mroute'"
707 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
708 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
712 "src_address": source_i2
,
713 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
714 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
718 step("Verify mroutes and iff upstream")
720 for data
in input_dict_l1
:
721 result
= verify_mroutes(
730 assert result
is not True, (
731 "Testcase {} : Failed \n "
732 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
733 "Found: {}".format(tc_name
, data
["dut"], result
)
736 for data
in input_dict_l1
:
737 result
= verify_upstream_iif(
745 assert result
is not True, (
746 "Testcase {} : Failed \n "
747 "Expected: [{}]: Upstream IIF {} should not be present \n "
748 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
751 shutdown_bringup_interface(tgen
, "f1", intf_f1_i8
, True)
752 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, True)
754 for data
in input_dict_l1
:
755 result
= verify_upstream_iif(
756 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
758 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
760 write_test_footer(tc_name
)
763 def test_verify_oil_when_join_prune_sent_scenario_2_p1(request
):
765 TC_21_2: Verify OIL detail updated in (S,G) and (*,G) mroute when IGMP
770 tc_name
= request
.node
.name
771 write_test_header(tc_name
)
773 # Don"t run this test if we have any failure.
774 if tgen
.routers_have_failure():
775 pytest
.skip(tgen
.errors
)
777 # Creating configuration from JSON
778 app_helper
.stop_all_hosts()
780 reset_config_on_routers(tgen
)
781 clear_pim_interface_traffic(tgen
, topo
)
782 check_router_status(tgen
)
784 step("Removing FRR3 to simulate topo " "FHR(FRR1)---LHR(FRR2)")
786 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
787 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
788 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
789 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
790 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
791 shutdown_bringup_interface(tgen
, "f1", intf_f1_r2
, False)
793 step("Enable the PIM on all the interfaces of FRR1, FRR2")
795 "Enable IGMP of FRR1 interface and send IGMP joins "
796 " from FRR1 node for group range (226.1.1.1-5)"
799 "Enable IGMP of FRR3 interface and send IGMP joins "
800 " from FRR3 node for group range (226.1.1.1-5)"
803 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
809 "igmp": {"version": "2", "query": {"query-interval": 15}}
815 result
= create_igmp_config(tgen
, topo
, input_dict
)
816 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
819 "i1": topo
["routers"]["i1"]["links"]["l1"]["interface"],
820 "i3": topo
["routers"]["i3"]["links"]["r2"]["interface"],
823 for recvr
, recvr_intf
in input_join
.items():
824 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
825 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
827 step("Configure static RP for (226.1.1.1-5) in R2")
834 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
837 "group_addr_range": GROUP_RANGE
,
844 result
= create_pim_config(tgen
, topo
, input_dict
)
845 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
850 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
851 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
857 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
863 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
867 step("Verify mroutes and iff upstream")
869 for data
in input_dict_all
:
870 result
= verify_mroutes(
878 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
880 for data
in input_dict_all
:
881 result
= verify_upstream_iif(
882 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
884 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
886 step("Send the IGMP prune from ixia to (226.1.1.1-5) receiver on " "FRR3(r2) node")
888 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
889 shutdown_bringup_interface(tgen
, "r2", intf_r2_i3
, False)
892 "After sending IGMP prune from FRR3(r2) node verify (*,G) OIL "
893 "immediately removed for local receiver mroute should have "
894 " PIM protocol , IGMP should be removed verify using "
895 "'show ip mroute' no impact seen on FRR1(l1) (*,G)"
903 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
907 for data
in input_dict_r2
:
908 result
= verify_mroutes(
917 assert result
is not True, (
918 "Testcase {} : Failed \n "
919 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
920 "Found: {}".format(tc_name
, data
["dut"], result
)
927 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
928 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
934 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
938 step("Verify mroutes and iff upstream")
940 for data
in input_dict_l1_r2
:
941 result
= verify_mroutes(
949 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
951 step("Send the IGMP prune from ixia to (226.1.1.1-5) receiver on " "FRR1(l1) node")
953 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
954 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, False)
957 "After sending IGMP prune from FRR1 node verify (*,G) OIL"
958 "got removed immediately from FRR1 node"
965 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
966 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
970 for data
in input_dict_l1
:
971 result
= verify_mroutes(
980 assert result
is not True, (
981 "Testcase {} : Failed \n "
982 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
983 "Found: {}".format(tc_name
, data
["dut"], result
)
986 step("After prune is sent verify upstream got removed in FRR1 node")
988 for data
in input_dict_l1
:
989 result
= verify_upstream_iif(
997 assert result
is not True, (
998 "Testcase {} : Failed \n "
999 "Expected: [{}]: Upstream IIF {} should not be present \n "
1000 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
1003 write_test_footer(tc_name
)
1006 def test_shut_noshut_source_interface_when_upstream_cleared_from_LHR_p1(request
):
1008 TC_26: Verify shut/no shut of source interface after upstream got cleared
1012 tgen
= get_topogen()
1013 tc_name
= request
.node
.name
1014 write_test_header(tc_name
)
1016 # Don"t run this test if we have any failure.
1017 if tgen
.routers_have_failure():
1018 pytest
.skip(tgen
.errors
)
1020 # Creating configuration from JSON
1021 app_helper
.stop_all_hosts()
1023 reset_config_on_routers(tgen
)
1024 clear_pim_interface_traffic(tgen
, topo
)
1025 check_router_status(tgen
)
1027 step("Enable the PIM on all the interfaces of FRR1, R2 and FRR3" " routers")
1028 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
1030 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
1032 for recvr
, recvr_intf
in input_join
.items():
1033 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
1034 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1036 step("Configure RP on R2 (loopback interface) for " "the group range 225.0.0.0/8")
1043 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
1046 "group_addr_range": GROUP_RANGE_1
,
1053 result
= create_pim_config(tgen
, topo
, input_dict
)
1054 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1056 step("Send multicast traffic from FRR3 to 225.1.1.1-225.1.1.10" " receiver")
1058 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
1060 for src
, src_intf
in input_src
.items():
1061 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1062 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1065 "'show ip mroute' showing correct RPF and OIF interface for (*,G)"
1066 " and (S,G) entries on all the nodes"
1069 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1074 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1075 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1079 "src_address": source_i2
,
1080 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1081 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1087 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1091 "src_address": source_i2
,
1092 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
1093 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1097 "src_address": source_i2
,
1098 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
1099 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
1104 "'show ip pim upstream' and 'show ip pim upstream-rpf' showing"
1105 " correct OIL and IIF on all the nodes"
1108 for data
in input_dict_all
:
1109 result
= verify_mroutes(
1112 data
["src_address"],
1117 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1119 for data
in input_dict_all
:
1120 result
= verify_upstream_iif(
1121 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1123 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1125 step("Shut the source interface from FRR3")
1126 intf_f1_i2
= topo
["routers"]["f1"]["links"]["i2"]["interface"]
1127 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, False)
1130 "After shut of source interface verify (S,G) mroutes are cleared"
1131 " from all the nodes"
1134 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
1135 result
= verify_mroutes(
1136 tgen
, "f1", source_i2
, IGMP_JOIN_RANGE_1
, intf_f1_i2
, intf_f1_r2
, expected
=False
1138 assert result
is not True, (
1139 "Testcase {} : Failed \n "
1140 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
1141 "Found: {}".format(tc_name
, "f1", result
)
1145 "After waiting for (S,G) timeout from FRR1 for same"
1146 " source verify that (S,G) is flushed from FRR1 node"
1147 " 'show ip pim upstream' 'show ip mroute' "
1150 result
= verify_upstream_iif(
1151 tgen
, "l1", "Unknown", source_i2
, IGMP_JOIN_RANGE_1
, expected
=False
1153 assert result
is not True, (
1154 "Testcase {} : Failed \n "
1155 "Expected: [{}]: Upstream IIF should be Unknown \n "
1156 "Found: {}".format(tc_name
, "l1", result
)
1159 step("No shut the Source interface just after the upstream is expired" " from FRR1")
1160 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, True)
1163 "After no shut of source interface , verify all the (S,G) is "
1164 " populated again on 'show ip mroute' 'show ip pim upstream' "
1165 " with proper OIL and IIF detail"
1168 for data
in input_dict_all
:
1169 result
= verify_mroutes(
1172 data
["src_address"],
1177 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1179 for data
in input_dict_all
:
1180 result
= verify_upstream_iif(
1181 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1183 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1185 step("shut and no shut the source interface immediately")
1186 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, False)
1187 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, True)
1190 "All the mroutes got updated with proper OIL after no shut of"
1191 "interface verify using 'show ip mroute'"
1194 for data
in input_dict_all
:
1195 result
= verify_mroutes(
1198 data
["src_address"],
1203 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1205 for data
in input_dict_all
:
1206 result
= verify_upstream_iif(
1207 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1209 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1211 write_test_footer(tc_name
)
1214 def test_shut_noshut_receiver_interface_when_upstream_cleared_from_LHR_p1(request
):
1216 TC_27: Verify shut/no shut of receiver interface after upstream got
1220 tgen
= get_topogen()
1221 tc_name
= request
.node
.name
1222 write_test_header(tc_name
)
1224 # Don"t run this test if we have any failure.
1225 if tgen
.routers_have_failure():
1226 pytest
.skip(tgen
.errors
)
1228 # Creating configuration from JSON
1229 app_helper
.stop_all_hosts()
1231 reset_config_on_routers(tgen
)
1232 clear_pim_interface_traffic(tgen
, topo
)
1233 check_router_status(tgen
)
1235 step("Enable the PIM on all the interfaces of FRR1, R2 and FRR3" " routers")
1236 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
1238 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
1240 for recvr
, recvr_intf
in input_join
.items():
1241 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
1242 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1244 step("Configure RP on R2 (loopback interface) for " "the group range 225.0.0.0/8")
1251 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
1254 "group_addr_range": GROUP_RANGE_1
,
1261 result
= create_pim_config(tgen
, topo
, input_dict
)
1262 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1264 step("Send multicast traffic from FRR3 to 225.1.1.1-225.1.1.10" " receiver")
1266 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
1268 for src
, src_intf
in input_src
.items():
1269 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1270 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1273 "'show ip mroute' showing correct RPF and OIF interface for (*,G)"
1274 " and (S,G) entries on all the nodes"
1277 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1282 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1283 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1287 "src_address": source_i2
,
1288 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1289 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1295 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1299 "src_address": source_i2
,
1300 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
1301 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1305 "src_address": source_i2
,
1306 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
1307 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
1311 for data
in input_dict_all
:
1312 result
= verify_mroutes(
1315 data
["src_address"],
1320 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1323 "'show ip pim upstream' and 'show ip pim upstream-rpf' showing"
1324 " correct OIL and IIF on all the nodes"
1327 for data
in input_dict_all
:
1328 result
= verify_upstream_iif(
1329 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1331 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1333 step("Shut the source interface FRR1")
1334 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1335 intf_f1_i2
= topo
["routers"]["f1"]["links"]["i2"]["interface"]
1336 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
1337 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, False)
1340 "After waiting for (S,G) timeout from FRR1 for same"
1341 " source verify that (S,G) is flushed from FRR1 node"
1342 " 'show ip pim upstream' 'show ip mroute' "
1345 result
= verify_upstream_iif(
1346 tgen
, "l1", "Unknown", source_i2
, IGMP_JOIN_RANGE_1
, expected
=False
1348 assert result
is not True, (
1349 "Testcase {} : Failed \n "
1350 "Expected: [{}]: Upstream IIF should be Unknown \n "
1351 "Found: {}".format(tc_name
, "l1", result
)
1354 step("No shut the Source interface just after the upstream is expired" " from FRR1")
1355 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, True)
1358 "After no shut of source interface , verify all the (S,G) is "
1359 " populated again on 'show ip mroute' 'show ip pim upstream' "
1360 " with proper OIL and IIF detail"
1363 for data
in input_dict_all
:
1364 result
= verify_mroutes(
1367 data
["src_address"],
1372 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1374 for data
in input_dict_all
:
1375 result
= verify_upstream_iif(
1376 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1378 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1380 step("shut and no shut the source interface immediately")
1381 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, False)
1382 shutdown_bringup_interface(tgen
, "f1", intf_f1_i2
, True)
1385 "After no shut of receiver interface , verify all the (S,G) is "
1386 "populated again on 'show ip mroute' 'show ip pim upstream' "
1387 "with proper OIL and IIF detail"
1390 for data
in input_dict_all
:
1391 result
= verify_mroutes(
1394 data
["src_address"],
1399 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1401 for data
in input_dict_all
:
1402 result
= verify_upstream_iif(
1403 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1405 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1407 write_test_footer(tc_name
)
1410 def test_verify_remove_add_igmp_config_to_receiver_interface_p0(request
):
1412 TC_33: Verify removing and adding IGMP config from the receiver interface
1414 tgen
= get_topogen()
1415 tc_name
= request
.node
.name
1416 write_test_header(tc_name
)
1418 # Don"t run this test if we have any failure.
1419 if tgen
.routers_have_failure():
1420 pytest
.skip(tgen
.errors
)
1422 # Creating configuration from JSON
1423 app_helper
.stop_all_hosts()
1425 reset_config_on_routers(tgen
)
1426 clear_pim_interface_traffic(tgen
, topo
)
1427 check_router_status(tgen
)
1429 step("Enable PIM on all routers")
1430 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
1432 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
1434 for recvr
, recvr_intf
in input_join
.items():
1435 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
1436 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1438 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in cisco-1(f1)")
1445 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
1448 "group_addr_range": GROUP_RANGE
,
1455 result
= create_pim_config(tgen
, topo
, input_dict
)
1456 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1458 step("Configure source on FRR3 and start the traffic for" " (225.1.1.1-225.1.1.10)")
1460 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
1462 for src
, src_intf
in input_src
.items():
1463 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1464 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1466 step("Configure source on FRR1 and start the traffic for" " (225.1.1.1-225.1.1.10)")
1468 input_src
= {"i6": topo
["routers"]["i6"]["links"]["l1"]["interface"]}
1470 for src
, src_intf
in input_src
.items():
1471 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1472 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1474 source_i6
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
1475 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1480 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1481 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1485 "src_address": source_i6
,
1486 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
1487 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1491 "src_address": source_i2
,
1492 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1493 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1499 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1503 "src_address": source_i2
,
1504 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
1505 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
1509 for data
in input_dict_all
:
1510 result
= verify_mroutes(
1513 data
["src_address"],
1518 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1520 for data
in input_dict_all
:
1521 result
= verify_upstream_iif(
1522 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1524 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1527 "Remove igmp 'no ip igmp' and 'no ip igmp version 2' from"
1528 " receiver interface of FRR1"
1531 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1546 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1547 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1549 step("IGMP join removed from FRR1 , verify using " "'show ip igmp groups json'")
1552 interface
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1553 result
= verify_igmp_groups(tgen
, dut
, interface
, IGMP_JOIN_RANGE_1
, expected
=False)
1554 assert result
is not True, (
1555 "Testcase {} : Failed \n "
1556 "Expected: [{}]: IGMP groups should not be present \n "
1557 "Found: {}".format(tc_name
, dut
, result
)
1560 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
1561 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1562 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
1563 intf_f1_i2
= topo
["routers"]["f1"]["links"]["i2"]["interface"]
1565 "l1": {"traffic_received": [intf_l1_r2
], "traffic_sent": [intf_l1_i1
]},
1566 "f1": {"traffic_sent": [intf_f1_r2
], "traffic_received": [intf_f1_i2
]},
1568 result
= verify_multicast_traffic(tgen
, input_traffic
)
1569 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1572 "Configure igmp 'ip igmp' and 'ip igmp version 2' from "
1573 "receiver interface of FRR1"
1581 "igmp": {"version": "2", "query": {"query-interval": 15}}
1587 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1588 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1591 "After adding IGMP on receiver interface verify (S,G) and (*,G)"
1592 " entries got populated and traffic is resumed on FRR1 and FRR3 node"
1596 "Verify OIL/IIF and drJoinDesired using 'show ip mroute , and traffic"
1597 " using show ip pim upstream and show ip multicast'"
1600 for data
in input_dict_all
:
1601 result
= verify_mroutes(
1604 data
["src_address"],
1609 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1611 for data
in input_dict_all
:
1612 result
= verify_upstream_iif(
1613 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1615 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1617 result
= verify_multicast_traffic(tgen
, input_traffic
)
1618 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1620 step("Verify that no core is observed")
1621 if tgen
.routers_have_failure():
1622 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1625 "Remove igmp 'no ip igmp' and 'no ip igmp version 2' from"
1626 " receiver interface of FRR1"
1644 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1645 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1647 step("IGMP join removed from FRR1 , verify using " "'show ip igmp groups json'")
1650 interface
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1651 result
= verify_igmp_groups(tgen
, dut
, interface
, IGMP_JOIN_RANGE_1
, expected
=False)
1652 assert result
is not True, (
1653 "Testcase {} : Failed \n "
1654 "Expected: [{}]: IGMP groups should not be present \n "
1655 "Found: {}".format(tc_name
, dut
, result
)
1658 result
= verify_multicast_traffic(tgen
, input_traffic
)
1659 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1662 "Configure igmp 'ip igmp' and 'ip igmp version 2' from "
1663 "receiver interface of FRR1"
1671 "igmp": {"version": "2", "query": {"query-interval": 15}}
1677 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1678 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1681 "After adding IGMP on receiver interface verify (S,G) and (*,G)"
1682 " entries got populated and traffic is resumed on FRR1 and FRR3 node"
1686 "Verify OIL/IIF and drJoinDesired using 'show ip mroute , and traffic"
1687 " using show ip pim upstream and show ip multicast'"
1690 input_dict_l1_f1
= [
1694 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1695 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1699 "src_address": source_i6
,
1700 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
1701 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1705 "src_address": source_i2
,
1706 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1707 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1711 "src_address": source_i2
,
1712 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
1713 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
1717 for data
in input_dict_l1_f1
:
1718 result
= verify_mroutes(
1721 data
["src_address"],
1726 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1728 for data
in input_dict_l1_f1
:
1729 result
= verify_upstream_iif(
1730 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1732 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1734 result
= verify_multicast_traffic(tgen
, input_traffic
)
1735 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1737 step("Verify that no core is observed")
1738 if tgen
.routers_have_failure():
1739 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1741 step("Remove ip igmp and send igmp prune from FRR1 interface")
1757 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1758 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1760 "Verification: After removing igmp 'no ip igmp' and "
1761 " sending prune verify mroute and upstream got removed"
1762 " from FRR1 verify using 'show ip mroute' and "
1763 "'show ip pim upstream'"
1767 iif
= topo
["routers"]["l1"]["links"]["i6"]["interface"]
1768 oil
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1770 result
= verify_mroutes(
1771 tgen
, dut
, source
, IGMP_JOIN_RANGE_1
, iif
, oil
, expected
=False
1773 assert result
is not True, (
1774 "Testcase {} : Failed \n "
1775 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
1776 "Found: {}".format(tc_name
, dut
, result
)
1779 write_test_footer(tc_name
)
1782 def test_verify_remove_add_igmp_commands_when_pim_configured_p0(request
):
1784 TC_34: Verify removing and adding IGMP commands when PIM is already
1788 tgen
= get_topogen()
1789 tc_name
= request
.node
.name
1790 write_test_header(tc_name
)
1792 # Don"t run this test if we have any failure.
1793 if tgen
.routers_have_failure():
1794 pytest
.skip(tgen
.errors
)
1796 # Creating configuration from JSON
1797 app_helper
.stop_all_hosts()
1799 reset_config_on_routers(tgen
)
1800 clear_pim_interface_traffic(tgen
, topo
)
1801 check_router_status(tgen
)
1803 step("Enable PIM on all routers")
1804 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
1806 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
1808 for recvr
, recvr_intf
in input_join
.items():
1809 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
1810 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1812 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in cisco-1(f1)")
1819 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
1822 "group_addr_range": GROUP_RANGE
,
1829 result
= create_pim_config(tgen
, topo
, input_dict
)
1830 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1832 step("Configure source on FRR3 and start the traffic for" " (225.1.1.1-225.1.1.10)")
1834 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
1836 for src
, src_intf
in input_src
.items():
1837 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1838 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1840 step("Configure source on FRR1 and start the traffic for" " (225.1.1.1-225.1.1.10)")
1842 input_src
= {"i6": topo
["routers"]["i6"]["links"]["l1"]["interface"]}
1844 for src
, src_intf
in input_src
.items():
1845 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
1846 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1848 source_i6
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
1849 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
1854 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1855 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1859 "src_address": source_i6
,
1860 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
1861 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1865 "src_address": source_i2
,
1866 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
1867 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
1873 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
1877 "src_address": source_i2
,
1878 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
1879 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
1883 for data
in input_dict_all
:
1884 result
= verify_mroutes(
1887 data
["src_address"],
1892 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1894 for data
in input_dict_all
:
1895 result
= verify_upstream_iif(
1896 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
1898 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1901 "Verification: After configuring IGMP related config , "
1902 "verify config is present in the interface "
1903 "'show ip igmp interface ensxx json'"
1906 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
1915 "query-max-response-time": 40,
1916 "query-interval": 5,
1925 result
= verify_igmp_config(tgen
, input_dict_1
)
1926 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1929 "Remove igmp 'no ip igmp' and 'no ip igmp version 2' from"
1930 " receiver interface of FRR1"
1948 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
1949 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1952 "Verification: After removing the config CLI got removed "
1953 "'show ip igmp interface ensxx json'"
1956 result
= verify_igmp_config(tgen
, input_dict_1
, expected
=False)
1957 assert result
is not True, (
1958 "Testcase {} : Failed \n "
1959 "Expected: [{}]: IGMP interface should be removed \n "
1960 "Found: {}".format(tc_name
, data
["dut"], result
)
1963 step("Verify that no core is observed")
1964 if tgen
.routers_have_failure():
1965 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1967 step("Configure 'ip igmp last-member-query-count 10' on FRR1" " receiver interface")
1973 "l1-i1-eth1": {"igmp": {"query": {"last-member-query-count": 5}}}
1978 result
= create_igmp_config(tgen
, topo
, input_dict_3
)
1979 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1981 result
= verify_igmp_config(tgen
, input_dict_3
)
1982 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1984 step("Remove 'ip igmp last-member-query-count 10' on FRR1" " receiver interface")
1992 "query": {"last-member-query-count": "", "delete": True}
1999 result
= create_igmp_config(tgen
, topo
, input_dict_3
)
2000 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2006 "l1-i1-eth1": {"igmp": {"query": {"last-member-query-count": 2}}}
2011 result
= verify_igmp_config(tgen
, input_dict_3
)
2012 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2014 step("Verify that no core is observed")
2015 if tgen
.routers_have_failure():
2016 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2019 "Configure 'ip igmp last-member-query-interval 20' on FRR1"
2020 " receiver interface"
2028 "igmp": {"query": {"last-member-query-interval": 20}}
2034 result
= create_igmp_config(tgen
, topo
, input_dict_3
)
2035 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2037 result
= verify_igmp_config(tgen
, input_dict_3
)
2038 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2040 step("Remove 'ip igmp last-member-query-count 10' on FRR1" " receiver interface")
2048 "query": {"last-member-query-interval": "", "delete": True}
2055 result
= create_igmp_config(tgen
, topo
, input_dict_3
)
2056 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2063 "igmp": {"query": {"last-member-query-interval": 10}}
2069 result
= verify_igmp_config(tgen
, input_dict_3
)
2070 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2072 step("Verify that no core is observed")
2073 if tgen
.routers_have_failure():
2074 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2076 write_test_footer(tc_name
)
2079 def test_verify_remove_add_pim_commands_when_igmp_configured_p1(request
):
2081 TC_35: Verify removing and adding PIM commands when IGMP is already
2085 tgen
= get_topogen()
2086 tc_name
= request
.node
.name
2087 write_test_header(tc_name
)
2089 # Don"t run this test if we have any failure.
2090 if tgen
.routers_have_failure():
2091 pytest
.skip(tgen
.errors
)
2093 # Creating configuration from JSON
2094 app_helper
.stop_all_hosts()
2096 reset_config_on_routers(tgen
)
2097 clear_pim_interface_traffic(tgen
, topo
)
2098 check_router_status(tgen
)
2100 step("Configure 'ip pim' on receiver interface on FRR1")
2101 step("Enable PIM on all routers")
2102 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
2104 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
2106 for recvr
, recvr_intf
in input_join
.items():
2107 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
2108 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2110 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in cisco-1(f1)")
2117 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2120 "group_addr_range": GROUP_RANGE
,
2127 result
= create_pim_config(tgen
, topo
, input_dict
)
2128 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2130 step("Remove 'no ip pim' on receiver interface on FRR1")
2132 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
2134 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "no ip pim"]}
2136 result
= apply_raw_config(tgen
, raw_config
)
2137 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2139 step("Verify that no core is observed")
2140 if tgen
.routers_have_failure():
2141 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2143 step("Configure 'ip pim bsm' on receiver interface on FRR1")
2146 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "ip pim bsm"]}
2148 result
= apply_raw_config(tgen
, raw_config
)
2149 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2151 step("Remove 'no ip pim bsm' on receiver interface on FRR1")
2154 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "no ip pim bsm"]}
2156 result
= apply_raw_config(tgen
, raw_config
)
2157 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2159 step("Verify that no core is observed")
2160 if tgen
.routers_have_failure():
2161 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2163 step("Configure 'ip pim drpriority' on receiver interface on FRR1")
2167 "raw_config": ["interface {}".format(intf_l1_i1
), "ip pim drpriority 10"]
2170 result
= apply_raw_config(tgen
, raw_config
)
2171 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2174 "Verification: After configuring PIM related config, "
2175 "verify config is present in the interface "
2176 "'show ip pim interface ensxx json'"
2179 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_i1
: {"drPriority": 10}}}}}
2180 result
= verify_pim_config(tgen
, input_dict_dr
)
2181 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2183 step("Remove 'no ip pim drpriority' on receiver interface on FRR1")
2187 "raw_config": ["interface {}".format(intf_l1_i1
), "no ip pim drpriority 10"]
2190 result
= apply_raw_config(tgen
, raw_config
)
2191 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2194 "Verification: After removing the config CLI got removed "
2195 "'show ip pim interface ensxx json'"
2198 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_i1
: {"drPriority": 1}}}}}
2199 result
= verify_pim_config(tgen
, input_dict_dr
)
2200 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2202 step("Verify that no core is observed")
2203 if tgen
.routers_have_failure():
2204 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2206 step("Configure 'ip pim hello' on receiver interface on FRR1")
2209 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "ip pim hello 50"]}
2211 result
= apply_raw_config(tgen
, raw_config
)
2212 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2215 "Verification: After configuring PIM related config, "
2216 "verify config is present in the interface "
2217 "'show ip pim interface ensxx json'"
2220 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_i1
: {"helloPeriod": 50}}}}}
2221 result
= verify_pim_config(tgen
, input_dict_dr
)
2222 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2224 step("Remove 'no ip pim hello' on receiver interface on FRR1")
2227 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "no ip pim hello"]}
2229 result
= apply_raw_config(tgen
, raw_config
)
2230 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2233 "Verification: After removing the config CLI got removed "
2234 "'show ip pim interface ensxx json'"
2237 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_i1
: {"helloPeriod": 30}}}}}
2238 result
= verify_pim_config(tgen
, input_dict_dr
)
2239 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2241 step("Verify that no core is observed")
2242 if tgen
.routers_have_failure():
2243 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2245 step("Configure 'ip pim unicast-bsm' on receiver interface on FRR1")
2248 "l1": {"raw_config": ["interface {}".format(intf_l1_i1
), "ip pim unicast-bsm"]}
2250 result
= apply_raw_config(tgen
, raw_config
)
2251 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2253 step("Remove 'no ip pim hello' on receiver interface on FRR1")
2257 "raw_config": ["interface {}".format(intf_l1_i1
), "no ip pim unicast-bsm"]
2260 result
= apply_raw_config(tgen
, raw_config
)
2261 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2263 step("Verify that no core is observed")
2264 if tgen
.routers_have_failure():
2265 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2267 write_test_footer(tc_name
)
2270 def test_pim_dr_priority_p0(request
):
2272 TC_36: Verify highest DR priority become the PIM DR
2275 tgen
= get_topogen()
2276 tc_name
= request
.node
.name
2277 write_test_header(tc_name
)
2279 # Don"t run this test if we have any failure.
2280 if tgen
.routers_have_failure():
2281 pytest
.skip(tgen
.errors
)
2283 # Creating configuration from JSON
2284 app_helper
.stop_all_hosts()
2286 reset_config_on_routers(tgen
)
2287 clear_pim_interface_traffic(tgen
, topo
)
2288 check_router_status(tgen
)
2290 step("Configure 'ip pim' on receiver interface on FRR1")
2291 step("Enable PIM on all routers")
2292 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
2294 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
2296 for recvr
, recvr_intf
in input_join
.items():
2297 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
2298 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2300 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in cisco-1(f1)")
2307 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2310 "group_addr_range": GROUP_RANGE
,
2317 result
= create_pim_config(tgen
, topo
, input_dict
)
2318 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2320 input_src
= {"i2": topo
["routers"]["i2"]["links"]["f1"]["interface"]}
2322 for src
, src_intf
in input_src
.items():
2323 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
2324 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2326 source_i2
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
2331 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
2332 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
2336 "src_address": source_i2
,
2337 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
2338 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
2344 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
2348 "src_address": source_i2
,
2349 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
2350 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
2354 for data
in input_dict_all
:
2355 result
= verify_mroutes(
2358 data
["src_address"],
2363 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2365 for data
in input_dict_all
:
2366 result
= verify_upstream_iif(
2367 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
2369 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2371 step("Configure 'ip pim drpriority 10' on receiver interface on FRR1(LHR)")
2373 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
2376 "raw_config": ["interface {}".format(intf_l1_r2
), "ip pim drpriority 10"]
2379 result
= apply_raw_config(tgen
, raw_config
)
2380 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2383 "DR config is successful on FRR1 node , verify using "
2384 " 'show ip pim interface json'"
2387 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_r2
: {"drPriority": 10}}}}}
2388 result
= verify_pim_config(tgen
, input_dict_dr
)
2389 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2391 for data
in input_dict_all
:
2392 result
= verify_mroutes(
2395 data
["src_address"],
2400 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2402 for data
in input_dict_all
:
2403 result
= verify_upstream_iif(
2404 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
2406 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2408 step("Configure 'ip pim drpriority 20' on receiver interface on FRR3(FHR)")
2410 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
2413 "raw_config": ["interface {}".format(intf_f1_r2
), "ip pim drpriority 20"]
2416 result
= apply_raw_config(tgen
, raw_config
)
2417 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2420 "DR config is successful on FRR3 node , verify using "
2421 " 'show ip pim interface json'"
2424 input_dict_dr
= {"f1": {"pim": {"interfaces": {intf_f1_r2
: {"drPriority": 20}}}}}
2425 result
= verify_pim_config(tgen
, input_dict_dr
)
2426 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2428 for data
in input_dict_all
:
2429 result
= verify_mroutes(
2432 data
["src_address"],
2437 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2439 for data
in input_dict_all
:
2440 result
= verify_upstream_iif(
2441 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
2443 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2446 "PIM is enable on FRR1, FRR2 interface and neighbor is up, "
2447 " verify using 'show ip pim interface'"
2450 result
= verify_pim_interface(tgen
, topo
, "l1")
2451 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2453 result
= verify_pim_interface(tgen
, topo
, "f1")
2454 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2457 "Highet IP become PIM DR , verify using "
2458 "'show ip pim interface json' and 'show ip pim neighbor'"
2460 step("Highest priority become PIM DR")
2462 dr_address
= topo
["routers"]["l1"]["links"]["r2"]["ipv4"].split("/")[0]
2464 "l1": {"pim": {"interfaces": {intf_l1_r2
: {"drAddress": dr_address
}}}}
2466 result
= verify_pim_config(tgen
, input_dict_dr
)
2467 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2469 dr_address
= topo
["routers"]["f1"]["links"]["r2"]["ipv4"].split("/")[0]
2471 "f1": {"pim": {"interfaces": {intf_f1_r2
: {"drAddress": dr_address
}}}}
2473 result
= verify_pim_config(tgen
, input_dict_dr
)
2474 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2476 step("Remove 'no ip pim drpriority' on receiver interface on FRR1")
2480 "raw_config": ["interface {}".format(intf_l1_r2
), "no ip pim drpriority 10"]
2483 result
= apply_raw_config(tgen
, raw_config
)
2484 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2486 step("Remove 'no ip pim drpriority' on receiver interface on FRR3")
2490 "raw_config": ["interface {}".format(intf_f1_r2
), "no ip pim drpriority 20"]
2493 result
= apply_raw_config(tgen
, raw_config
)
2494 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2497 "After removing drpriority , config got removed from both the "
2498 "nodes and highest IP become PIM DR"
2501 input_dict_dr
= {"l1": {"pim": {"interfaces": {intf_l1_r2
: {"drPriority": 1}}}}}
2502 result
= verify_pim_config(tgen
, input_dict_dr
)
2503 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2505 input_dict_dr
= {"f1": {"pim": {"interfaces": {intf_f1_r2
: {"drPriority": 1}}}}}
2506 result
= verify_pim_config(tgen
, input_dict_dr
)
2507 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2509 dr_address
= topo
["routers"]["r2"]["links"]["l1"]["ipv4"].split("/")[0]
2511 "l1": {"pim": {"interfaces": {intf_l1_r2
: {"drAddress": dr_address
}}}}
2513 result
= verify_pim_config(tgen
, input_dict_dr
)
2514 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2516 dr_address
= topo
["routers"]["r2"]["links"]["f1"]["ipv4"].split("/")[0]
2518 "f1": {"pim": {"interfaces": {intf_f1_r2
: {"drAddress": dr_address
}}}}
2520 result
= verify_pim_config(tgen
, input_dict_dr
)
2521 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2523 for data
in input_dict_all
:
2524 result
= verify_mroutes(
2527 data
["src_address"],
2532 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2534 for data
in input_dict_all
:
2535 result
= verify_upstream_iif(
2536 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
2538 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2540 write_test_footer(tc_name
)
2543 def test_pim_hello_timer_p1(request
):
2545 TC_37: Verify PIM hello is sent on configured timer
2548 tgen
= get_topogen()
2549 tc_name
= request
.node
.name
2550 write_test_header(tc_name
)
2552 # Don"t run this test if we have any failure.
2553 if tgen
.routers_have_failure():
2554 pytest
.skip(tgen
.errors
)
2556 # Creating configuration from JSON
2557 app_helper
.stop_all_hosts()
2559 reset_config_on_routers(tgen
)
2560 clear_pim_interface_traffic(tgen
, topo
)
2561 check_router_status(tgen
)
2563 step("Configure 'ip pim' on receiver interface on FRR1")
2564 step("Enable PIM on all routers")
2565 step("Enable IGMP on FRR1 interface and send IGMP join " "(225.1.1.1-225.1.1.10)")
2567 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
2569 for recvr
, recvr_intf
in input_join
.items():
2570 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
2571 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2573 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in cisco-1(f1)")
2580 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2583 "group_addr_range": GROUP_RANGE
,
2590 result
= create_pim_config(tgen
, topo
, input_dict
)
2591 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2593 step("Configure PIM hello interval timer 100 on FRR1 node (FRR1-FRR2 link)")
2595 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
2597 "l1": {"raw_config": ["interface {}".format(intf_l1_r2
), "ip pim hello 100"]}
2599 result
= apply_raw_config(tgen
, raw_config
)
2600 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2603 "PIM hello interval is configured on interface verify using "
2604 "'show ip pim interface'"
2607 input_dict_hello
= {
2608 "l1": {"pim": {"interfaces": {intf_l1_r2
: {"helloPeriod": 100}}}}
2610 result
= verify_pim_config(tgen
, input_dict_hello
)
2611 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2613 step("Modify hello timer to 180 and then 50sec")
2615 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
2617 "l1": {"raw_config": ["interface {}".format(intf_l1_r2
), "ip pim hello 180"]}
2619 result
= apply_raw_config(tgen
, raw_config
)
2620 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2623 "PIM hello interval is configured on interface verify using "
2624 "'show ip pim interface'"
2627 input_dict_hello
= {
2628 "l1": {"pim": {"interfaces": {intf_l1_r2
: {"helloPeriod": 180}}}}
2630 result
= verify_pim_config(tgen
, input_dict_hello
)
2631 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2633 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
2635 "l1": {"raw_config": ["interface {}".format(intf_l1_r2
), "ip pim hello 50"]}
2637 result
= apply_raw_config(tgen
, raw_config
)
2638 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2641 "PIM hello interval is configured on interface verify using "
2642 "'show ip pim interface'"
2645 input_dict_hello
= {
2646 "l1": {"pim": {"interfaces": {intf_l1_r2
: {"helloPeriod": 50}}}}
2648 result
= verify_pim_config(tgen
, input_dict_hello
)
2649 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2651 step("Verify that no core is observed")
2652 if tgen
.routers_have_failure():
2653 assert False, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2655 write_test_footer(tc_name
)
2658 def test_mroute_after_removing_RP_sending_IGMP_prune_p2(request
):
2660 TC_39 Verify mroute after removing the RP and sending IGMP prune
2663 tgen
= get_topogen()
2664 tc_name
= request
.node
.name
2665 write_test_header(tc_name
)
2667 # Don"t run this test if we have any failure.
2668 if tgen
.routers_have_failure():
2669 pytest
.skip(tgen
.errors
)
2671 # Creating configuration from JSON
2672 app_helper
.stop_all_hosts()
2674 reset_config_on_routers(tgen
)
2675 clear_pim_interface_traffic(tgen
, topo
)
2676 check_router_status(tgen
)
2679 "Remove cisco connected link to simulate topo "
2680 "LHR(FRR1(f1))----RP(cisco(f1)---FHR(FRR3(l1))"
2683 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
2684 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
2685 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
2686 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
2688 step("Enable the PIM on all the interfaces of FRR1, FRR2, FRR3")
2690 "Enable IGMP of FRR1 interface and send IGMP joins "
2691 " from FRR1 node for group range (225.1.1.1-5)"
2694 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
2700 "igmp": {"version": "2", "query": {"query-interval": 15}}
2706 result
= create_igmp_config(tgen
, topo
, input_dict
)
2707 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2709 input_join
= {"i8": topo
["routers"]["i8"]["links"]["f1"]["interface"]}
2711 for recvr
, recvr_intf
in input_join
.items():
2712 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
2713 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2715 step("Configure static RP for (225.1.1.1-5) as R2")
2722 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2725 "group_addr_range": GROUP_RANGE
,
2732 result
= create_pim_config(tgen
, topo
, input_dict
)
2733 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2736 "Send traffic from FHR to all the groups ( 225.1.1.1 to 225.1.1.5) and send"
2737 " multicast traffic"
2740 input_src
= {"i6": topo
["routers"]["i6"]["links"]["l1"]["interface"]}
2742 for src
, src_intf
in input_src
.items():
2743 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
2744 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2746 source_i2
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
2751 "src_address": source_i2
,
2752 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
2753 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
2758 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
2759 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
2763 "src_address": source_i2
,
2764 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
2765 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
2769 step("Verify mroutes and iff upstream")
2771 for data
in input_dict_all
:
2772 result
= verify_mroutes(
2775 data
["src_address"],
2780 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2782 for data
in input_dict_all
:
2783 result
= verify_upstream_iif(
2784 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
2786 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2788 step("Remove the RP config for both the range from all the nodes")
2795 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2798 "group_addr_range": GROUP_RANGE
,
2806 result
= create_pim_config(tgen
, topo
, input_dict
)
2807 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2809 input_dict_starg
= [
2813 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
2814 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
2821 "src_address": source_i2
,
2822 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
2823 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
2827 "src_address": source_i2
,
2828 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
2829 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
2833 for data
in input_dict_starg
:
2834 result
= verify_mroutes(
2837 data
["src_address"],
2843 assert result
is not True, (
2844 "Testcase {} : Failed \n "
2845 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
2846 "Found: {}".format(tc_name
, data
["dut"], result
)
2849 for data
in input_dict_sg
:
2850 result
= verify_mroutes(
2853 data
["src_address"],
2858 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2860 step("Send prune from receiver-1 (using ctrl+c) on iperf interface")
2861 app_helper
.stop_all_hosts()
2863 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
2864 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
2865 traffic_before
= verify_multicast_traffic(tgen
, input_traffic
, return_traffic
=True)
2866 assert isinstance(traffic_before
, dict), (
2867 "Testcase {} : Failed \n traffic_before is not dictionary \n "
2868 "Error: {}".format(tc_name
, result
)
2871 step("IGMP groups are remove from FRR1 node 'show ip igmp groups'")
2874 result
= verify_igmp_groups(
2875 tgen
, dut
, intf_f1_i8
, IGMP_JOIN_RANGE_1
, expected
=False
2877 assert result
is not True, (
2878 "Testcase {} : Failed \n "
2879 "Expected: [{}]: IGMP groups should not present \n "
2880 "Found: {}".format(tc_name
, dut
, result
)
2884 "After receiving the IGMP prune from FRR1 , verify traffic "
2885 "immediately stopped for this receiver 'show ip multicast'"
2888 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
2889 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
2890 traffic_after
= verify_multicast_traffic(tgen
, input_traffic
, return_traffic
=True)
2891 assert isinstance(traffic_after
, dict), (
2892 "Testcase {} : Failed \n traffic_after is not dictionary \n "
2893 "Error: {}".format(tc_name
, result
)
2896 result
= verify_state_incremented(traffic_before
, traffic_after
)
2897 assert result
is not True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2898 logger
.info("Expected Behaviour: {}".format(result
))
2900 step("Configure static RP for (225.1.1.1-5) as R2 loopback interface")
2907 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
2910 "group_addr_range": GROUP_RANGE
,
2917 result
= create_pim_config(tgen
, topo
, input_dict
)
2918 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2920 step("Send IGMP joins again from LHR,check IGMP joins and starg received")
2922 for recvr
, recvr_intf
in input_join
.items():
2923 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
2924 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
2926 for data
in input_dict_starg
:
2927 result
= verify_mroutes(
2930 data
["src_address"],
2935 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2937 step("Send traffic from FHR and verify mroute upstream")
2939 for src
, src_intf
in input_src
.items():
2940 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
2941 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2943 source_i2
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
2945 for data
in input_dict_sg
:
2946 result
= verify_mroutes(
2949 data
["src_address"],
2954 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
2956 write_test_footer(tc_name
)
2959 def test_prune_sent_to_LHR_and_FHR_when_PIMnbr_down_p2(request
):
2961 TC_38 Verify prune is sent to LHR and FHR when PIM nbr went down
2964 tgen
= get_topogen()
2965 tc_name
= request
.node
.name
2966 write_test_header(tc_name
)
2968 # Don"t run this test if we have any failure.
2969 if tgen
.routers_have_failure():
2970 pytest
.skip(tgen
.errors
)
2972 # Creating configuration from JSON
2973 app_helper
.stop_all_hosts()
2975 reset_config_on_routers(tgen
)
2976 clear_pim_interface_traffic(tgen
, topo
)
2977 check_router_status(tgen
)
2980 "Remove cisco connected link to simulate topo "
2981 "LHR(FRR1(f1))----RP(cisco(f1)---FHR(FRR3(l1))"
2984 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
2985 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
2986 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
2987 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
2989 step("Enable the PIM on all the interfaces of FRR1, FRR2, FRR3")
2991 "Enable IGMP of FRR1 interface and send IGMP joins "
2992 " from FRR1 node for group range (225.1.1.1-5)"
2995 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3001 "igmp": {"version": "2", "query": {"query-interval": 15}}
3007 result
= create_igmp_config(tgen
, topo
, input_dict
)
3008 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3010 input_join
= {"i8": topo
["routers"]["i8"]["links"]["f1"]["interface"]}
3012 for recvr
, recvr_intf
in input_join
.items():
3013 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
3014 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3016 step("Configure static RP for (225.1.1.1-5) as R2")
3023 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
3026 "group_addr_range": GROUP_RANGE
,
3033 result
= create_pim_config(tgen
, topo
, input_dict
)
3034 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3037 "Send traffic from FHR to all the groups ( 225.1.1.1 to 225.1.1.5) and send"
3038 " multicast traffic"
3042 "i6": topo
["routers"]["i6"]["links"]["l1"]["interface"],
3043 "i2": topo
["routers"]["i2"]["links"]["f1"]["interface"],
3046 for src
, src_intf
in input_src
.items():
3047 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
3048 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3050 source_i2
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
3051 source_i1
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
3056 "src_address": source_i2
,
3057 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
3058 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
3063 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3064 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3068 "src_address": source_i1
,
3069 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
3070 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3074 "src_address": source_i2
,
3075 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3076 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3080 step("Verify mroutes and iff upstream")
3082 for data
in input_dict_all
:
3083 result
= verify_mroutes(
3086 data
["src_address"],
3091 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3093 for data
in input_dict_all
:
3094 result
= verify_upstream_iif(
3095 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3097 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3098 step("Verify mcast traffic received")
3099 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3100 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
3102 result
= verify_multicast_traffic(tgen
, input_traffic
)
3103 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3105 step("Shut the link from LHR to RP from RP node")
3107 intf_r2_f1
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
3108 shutdown_bringup_interface(tgen
, "r2", intf_r2_f1
, False)
3110 step("Verify RP info after Shut the link from LHR to RP from RP node")
3112 rp_address
= "1.0.5.17"
3114 result
= verify_pim_rp_info(
3115 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
3117 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
3119 input_dict_starg
= [
3123 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3124 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3128 input_dict_sg_i2
= [
3131 "src_address": source_i2
,
3132 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
3133 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
3137 "src_address": source_i2
,
3138 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3139 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3143 input_dict_sg_i1
= [
3146 "src_address": source_i1
,
3147 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
3148 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3152 input_dict_sg_i2_l1
= [
3155 "src_address": source_i2
,
3156 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
3157 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
3161 step("Verify mroute after Shut the link from LHR to RP from RP node")
3163 for data
in input_dict_starg
:
3164 result
= verify_mroutes(
3167 data
["src_address"],
3173 assert result
is not True, (
3174 "Testcase {} : Failed \n "
3175 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
3176 "Found: {}".format(tc_name
, data
["dut"], result
)
3179 for data
in input_dict_sg_i1
:
3180 result
= verify_mroutes(
3183 data
["src_address"],
3188 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3190 step("Verify upstream after Shut the link from LHR to RP from RP node")
3192 for data
in input_dict_starg
:
3193 result
= verify_upstream_iif(
3197 data
["src_address"],
3201 assert result
is not True, (
3202 "Testcase {} : Failed \n "
3203 "Expected: [{}]: Upstream IIF interface {} should not be present\n"
3204 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
3207 for data
in input_dict_sg_i1
:
3208 result
= verify_upstream_iif(
3209 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3211 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3213 step("No shut the link from LHR to RP from RP node")
3215 intf_r2_f1
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
3216 shutdown_bringup_interface(tgen
, "r2", intf_r2_f1
, True)
3218 step("Verify RP info after No shut the link from LHR to RP from RP node")
3220 rp_address
= "1.0.5.17"
3222 result
= verify_pim_rp_info(
3223 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
, expected
=False
3225 assert result
is not True, (
3226 "Testcase {} : Failed \n "
3227 "Expected: [{}]: RP IIF should be updated as Unknown \n "
3228 "Found: {}".format(tc_name
, dut
, result
)
3231 step("Verify mroute after No shut the link from LHR to RP from RP node")
3233 for data
in input_dict_starg
:
3234 result
= verify_mroutes(
3237 data
["src_address"],
3242 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3244 for data
in input_dict_sg_i2
:
3245 result
= verify_mroutes(
3248 data
["src_address"],
3253 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3255 for data
in input_dict_sg_i1
:
3256 result
= verify_mroutes(
3259 data
["src_address"],
3264 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3266 step("Verify upstrem after No shut the link from LHR to RP from RP node")
3268 for data
in input_dict_starg
:
3269 result
= verify_upstream_iif(
3270 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3272 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3274 for data
in input_dict_sg_i1
:
3275 result
= verify_upstream_iif(
3276 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3278 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3280 for data
in input_dict_sg_i2
:
3281 result
= verify_upstream_iif(
3282 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3284 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3286 step("Verify mcast traffic received after noshut LHR to RP from RP node")
3288 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3289 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
3290 result
= verify_multicast_traffic(tgen
, input_traffic
)
3291 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3293 step("Shut the link from FHR to RP from RP node")
3295 intf_r2_l1
= topo
["routers"]["r2"]["links"]["l1"]["interface"]
3296 shutdown_bringup_interface(tgen
, "r2", intf_r2_l1
, False)
3298 step("Verify RP info after Shut the link from FHR to RP from RP node")
3300 rp_address
= "1.0.5.17"
3302 result
= verify_pim_rp_info(
3303 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
3305 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
3307 step("Verify mroute after Shut the link from FHR to RP from RP node")
3309 for data
in input_dict_starg
:
3310 result
= verify_mroutes(
3313 data
["src_address"],
3318 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3320 for data
in input_dict_sg_i1
:
3321 result
= verify_mroutes(
3324 data
["src_address"],
3329 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3331 step("Verify upstream after Shut the link from FHR to RP from RP node")
3333 for data
in input_dict_starg
:
3334 result
= verify_upstream_iif(
3335 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3337 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3339 for data
in input_dict_sg_i1
:
3340 result
= verify_upstream_iif(
3341 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3343 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3345 for data
in input_dict_sg_i2_l1
:
3346 result
= verify_upstream_iif(
3350 data
["src_address"],
3354 assert result
is not True, (
3355 "Testcase {} : Failed \n "
3356 "Expected: [{}]: Upstream IIF interface {} should not be present"
3357 " after shutting link from RP to FHR \n"
3358 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
3361 step(" No shut the link from FHR to RP from RP node")
3363 intf_r2_l1
= topo
["routers"]["r2"]["links"]["l1"]["interface"]
3364 shutdown_bringup_interface(tgen
, "r2", intf_r2_l1
, True)
3366 step("Verify RP info after Noshut the link from FHR to RP from RP node")
3369 rp_address
= "1.0.5.17"
3371 result
= verify_pim_rp_info(
3372 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
, expected
=False
3374 assert result
is not True, (
3375 "Testcase {} : Failed \n "
3376 "Expected: [{}]: RP IIF should be updated as Unknown \n"
3377 "Found: {}".format(tc_name
, dut
, result
)
3380 step("Verify mroute after Noshut the link from FHR to RP from RP node")
3382 for data
in input_dict_starg
:
3383 result
= verify_mroutes(
3386 data
["src_address"],
3391 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3393 for data
in input_dict_sg_i2
:
3394 result
= verify_mroutes(
3397 data
["src_address"],
3402 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3404 for data
in input_dict_sg_i1
:
3405 result
= verify_mroutes(
3408 data
["src_address"],
3413 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3415 step("Verify mroute after Noshut the link from FHR to RP from RP node")
3417 for data
in input_dict_starg
:
3418 result
= verify_upstream_iif(
3419 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3421 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3423 for data
in input_dict_sg_i1
:
3424 result
= verify_upstream_iif(
3425 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3427 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3429 for data
in input_dict_sg_i2
:
3430 result
= verify_upstream_iif(
3431 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3433 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3435 step("Verify mcast traffic received after noshut FHR to RP from RP node")
3436 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3437 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
3438 result
= verify_multicast_traffic(tgen
, input_traffic
)
3439 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3441 step("Shut the link from FHR to RP from FHR node")
3443 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
3444 shutdown_bringup_interface(tgen
, "l1", intf_l1_r2
, False)
3446 step("Verify PIM Nbrs after Shut the link from FHR to RP from FHR node")
3448 step("Verify RP info after Shut the link from FHR to RP from FHR node")
3450 rp_address
= "1.0.5.17"
3452 result
= verify_pim_rp_info(
3453 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
3455 assert result
is True, "Testcase {} :Failed \n Error: {}".format(tc_name
, result
)
3457 step("Verify mroute after Shut the link from FHR to RP from FHR node")
3459 for data
in input_dict_starg
:
3460 result
= verify_mroutes(
3463 data
["src_address"],
3468 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3470 for data
in input_dict_sg_i1
:
3471 result
= verify_mroutes(
3474 data
["src_address"],
3479 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3481 step("Verify upstream after Shut the link from FHR to RP from FHR node")
3482 for data
in input_dict_starg
:
3483 result
= verify_upstream_iif(
3484 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3486 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3488 for data
in input_dict_sg_i1
:
3489 result
= verify_upstream_iif(
3490 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3492 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3494 for data
in input_dict_sg_i2_l1
:
3495 result
= verify_upstream_iif(
3499 data
["src_address"],
3503 assert result
is not True, (
3504 "Testcase {} : Failed \n "
3505 "Expected: [{}]: Upstream IIF interface {} should not be present"
3506 " after shutting link from FHR to RP \n"
3507 "Found: {}".format(tc_name
, data
["dut"], data
["iif"], result
)
3510 step(" No shut the link from FHR to RP from FHR node")
3512 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
3513 shutdown_bringup_interface(tgen
, "l1", intf_l1_r2
, True)
3515 step("Verify RP info after No Shut the link from FHR to RP from FHR node")
3517 rp_address
= "1.0.5.17"
3519 result
= verify_pim_rp_info(
3520 tgen
, topo
, dut
, GROUP_RANGE_1
, "Unknown", rp_address
, SOURCE
, expected
=False
3522 assert result
is not True, (
3523 "Testcase {} : Failed \n "
3524 "Expected: [{}]: RP IIF should be updated as Unknown \n"
3525 "Found: {}".format(tc_name
, dut
, result
)
3528 step("Verify mroute after No Shut the link from FHR to RP from FHR node")
3530 for data
in input_dict_starg
:
3531 result
= verify_mroutes(
3534 data
["src_address"],
3539 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3541 for data
in input_dict_sg_i2
:
3542 result
= verify_mroutes(
3545 data
["src_address"],
3550 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3552 for data
in input_dict_sg_i1
:
3553 result
= verify_mroutes(
3556 data
["src_address"],
3561 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3563 step("Verify upstream after No Shut the link from FHR to RP from FHR node")
3565 for data
in input_dict_starg
:
3566 result
= verify_upstream_iif(
3567 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3569 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3571 for data
in input_dict_sg_i1
:
3572 result
= verify_upstream_iif(
3573 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3575 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3577 for data
in input_dict_sg_i2
:
3578 result
= verify_upstream_iif(
3579 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3581 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3583 step("Verify mcast traffic received after noshut FHR to RP from FHR node")
3584 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3585 input_traffic
= {"f1": {"traffic_sent": [intf_f1_i8
]}}
3586 result
= verify_multicast_traffic(tgen
, input_traffic
)
3587 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3589 write_test_footer(tc_name
)
3592 def test_mroute_flags_p1(request
):
3594 TC_47 Verify mroute flag in LHR and FHR node
3597 tgen
= get_topogen()
3598 tc_name
= request
.node
.name
3599 write_test_header(tc_name
)
3601 # Don"t run this test if we have any failure.
3602 if tgen
.routers_have_failure():
3603 pytest
.skip(tgen
.errors
)
3605 # Creating configuration from JSON
3606 app_helper
.stop_all_hosts()
3608 reset_config_on_routers(tgen
)
3609 clear_pim_interface_traffic(tgen
, topo
)
3610 check_router_status(tgen
)
3613 "Remove cisco connected link to simulate topo "
3614 "LHR(FRR1(f1))----RP(cisco(f1)---FHR(FRR3(l1))"
3617 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
3618 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
3619 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
3620 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
3622 step("Enable the PIM on all the interfaces of FRR1, FRR2, FRR3")
3624 "Enable IGMP of FRR1 interface and send IGMP joins "
3625 " from FRR1 node for group range (225.1.1.1-5)"
3628 intf_f1_i8
= topo
["routers"]["f1"]["links"]["i8"]["interface"]
3634 "igmp": {"version": "2", "query": {"query-interval": 15}}
3640 result
= create_igmp_config(tgen
, topo
, input_dict
)
3641 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3643 input_join
= {"i8": topo
["routers"]["i8"]["links"]["f1"]["interface"]}
3645 for recvr
, recvr_intf
in input_join
.items():
3646 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
3647 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3649 step("Configure static RP for (225.1.1.1-5) as R2")
3656 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
3659 "group_addr_range": GROUP_RANGE
,
3666 result
= create_pim_config(tgen
, topo
, input_dict
)
3667 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3670 "Send traffic from FHR to all the groups ( 225.1.1.1 to 225.1.1.5) and send"
3671 " multicast traffic"
3675 "i6": topo
["routers"]["i6"]["links"]["l1"]["interface"],
3676 "i2": topo
["routers"]["i2"]["links"]["f1"]["interface"],
3679 for src
, src_intf
in input_src
.items():
3680 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
3681 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3683 source_i2
= topo
["routers"]["i6"]["links"]["l1"]["ipv4"].split("/")[0]
3684 source_i1
= topo
["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
3689 "src_address": source_i2
,
3690 "iif": topo
["routers"]["l1"]["links"]["i6"]["interface"],
3691 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
3696 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3697 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3701 "src_address": source_i1
,
3702 "iif": topo
["routers"]["f1"]["links"]["i2"]["interface"],
3703 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3707 "src_address": source_i2
,
3708 "iif": topo
["routers"]["f1"]["links"]["r2"]["interface"],
3709 "oil": topo
["routers"]["f1"]["links"]["i8"]["interface"],
3713 step("Verify mroutes and iff upstream")
3715 for data
in input_dict_all
:
3716 result
= verify_mroutes(
3719 data
["src_address"],
3724 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3726 result
= verify_upstream_iif(
3727 tgen
, data
["dut"], data
["iif"], data
["src_address"], IGMP_JOIN_RANGE_1
3729 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3732 step("verify flag for (*,G) on f1")
3735 result
= verify_multicast_flag_state(
3736 tgen
, dut
, src_address
, IGMP_JOIN_RANGE_1
, flag
3738 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3740 step("verify flag for (S,G) on f1 for Remote spurce ")
3741 src_address
= source_i2
3743 result
= verify_multicast_flag_state(
3744 tgen
, dut
, src_address
, IGMP_JOIN_RANGE_1
, flag
3746 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3748 write_test_footer(tc_name
)
3751 def test_verify_multicast_traffic_when_LHR_connected_to_RP_p1(request
):
3753 TC_11: Verify multicast traffic flowing fine, when LHR connected to RP
3755 FHR(FRR3(l1))---LHR(FRR1(r2)----RP(FRR2(f1))
3758 tgen
= get_topogen()
3759 tc_name
= request
.node
.name
3760 write_test_header(tc_name
)
3762 # Don"t run this test if we have any failure.
3763 if tgen
.routers_have_failure():
3764 pytest
.skip(tgen
.errors
)
3766 # Creating configuration from JSON
3767 app_helper
.stop_all_hosts()
3769 reset_config_on_routers(tgen
)
3770 clear_pim_interface_traffic(tgen
, topo
)
3771 check_router_status(tgen
)
3774 "Remove FRR3 to cisco connected link to simulate topo "
3775 "FHR(FRR3(l1))---LHR(FRR1(r2)----RP(FRR2(f1))"
3778 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
3779 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
3780 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
3781 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
3783 step("Disable IGMP config from l1")
3798 result
= create_igmp_config(tgen
, topo
, input_dict_2
)
3799 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3801 step("Enable the PIM on all the interfaces of FRR1, R2 and FRR3" " routers")
3803 "Enable IGMP on FRR1(r2) interface and send IGMP join (226.1.1.1-5)"
3804 " and (232.1.1.1-5)"
3807 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
3813 "igmp": {"version": "2", "query": {"query-interval": 15}}
3819 result
= create_igmp_config(tgen
, topo
, input_dict
)
3820 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3822 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
3823 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
3825 input_join
= {"i3": topo
["routers"]["i3"]["links"]["r2"]["interface"]}
3827 for recvr
, recvr_intf
in input_join
.items():
3828 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
3829 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
3831 step("Configure RP for (226.1.1.1-5) and (232.1.1.1-5) in (f1)")
3838 "rp_addr": topo
["routers"]["f1"]["links"]["lo"]["ipv4"].split(
3841 "group_addr_range": _GROUP_RANGE
,
3848 result
= create_pim_config(tgen
, topo
, input_dict
)
3849 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3851 step("Send multicast traffic from FRR3 to 225.1.1.1-225.1.1.10" " receiver")
3853 input_src
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
3855 for src
, src_intf
in input_src
.items():
3856 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
3857 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3860 "'show ip mroute' showing correct RPF and OIF interface for (*,G)"
3861 " and (S,G) entries on all the nodes"
3864 source_i1
= topo
["routers"]["i1"]["links"]["l1"]["ipv4"].split("/")[0]
3868 "src_address": source_i1
,
3869 "iif": topo
["routers"]["l1"]["links"]["i1"]["interface"],
3870 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
3875 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
3876 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
3880 "src_address": source_i1
,
3881 "iif": topo
["routers"]["r2"]["links"]["l1"]["interface"],
3882 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
3886 for data
in input_dict_all
:
3887 result
= verify_mroutes(
3890 data
["src_address"],
3895 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3897 for data
in input_dict_all
:
3898 result
= verify_upstream_iif(
3899 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
3901 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3904 "Multicast traffic is flowing for all the groups verify"
3905 "using 'show ip multicast'"
3908 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
3909 intf_r2_l1
= topo
["routers"]["r2"]["links"]["l1"]["interface"]
3910 intf_r2_f1
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
3911 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
3912 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
3914 "l1": {"traffic_received": [intf_l1_i1
]},
3915 "r2": {"traffic_received": [intf_r2_l1
], "traffic_sent": [intf_r2_i3
]},
3917 result
= verify_multicast_traffic(tgen
, input_traffic
)
3918 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3920 step("Shut and No shut the receiver port")
3922 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
3923 shutdown_bringup_interface(tgen
, "r2", intf_r2_i3
, False)
3926 "Verification: After Shut of receiver port, Verify (*,G) and "
3927 "(S,G) got removed from LHR node (FRR1) using 'show ip mroute'"
3934 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
3935 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
3939 "src_address": source_i1
,
3940 "iif": topo
["routers"]["r2"]["links"]["l1"]["interface"],
3941 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
3945 for data
in input_dict_r2
:
3946 result
= verify_mroutes(
3949 data
["src_address"],
3955 assert result
is not True, (
3956 "Testcase {} : Failed \n "
3957 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
3958 "Found: {}".format(tc_name
, data
["dut"], result
)
3961 shutdown_bringup_interface(tgen
, "r2", intf_r2_i3
, True)
3964 "Verification: After No shut of receiver port , Verify (*,G)"
3965 " and (S,G) got populated on LHR node (FRR1) using "
3966 "'show ip mroute' 'show ip pim upstream'"
3969 for data
in input_dict_r2
:
3970 result
= verify_mroutes(
3973 data
["src_address"],
3978 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3980 for data
in input_dict_r2
:
3981 result
= verify_upstream_iif(
3982 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
3984 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3987 "Multicast traffic is resumed for all the groups verify "
3988 "using 'show ip multicast'"
3991 result
= verify_multicast_traffic(tgen
, input_traffic
)
3992 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
3994 step("Shut and No shut the source port")
3996 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
3997 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, False)
4000 "Verification: After Shut of source port, Verify (*,G) and "
4001 "(S,G) got removed from LHR node (FRR1) using 'show ip mroute'"
4007 "src_address": source_i1
,
4008 "iif": topo
["routers"]["l1"]["links"]["i1"]["interface"],
4009 "oil": topo
["routers"]["l1"]["links"]["r2"]["interface"],
4013 for data
in input_dict_l1
:
4014 result
= verify_mroutes(
4017 data
["src_address"],
4023 assert result
is not True, (
4024 "Testcase {} : Failed \n "
4025 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4026 "Found: {}".format(tc_name
, data
["dut"], result
)
4029 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, True)
4032 "Verification: After No shut of source port , Verify (*,G)"
4033 " and (S,G) got populated on LHR node (FRR1) using "
4034 "'show ip mroute' 'show ip pim upstream'"
4037 for data
in input_dict_l1
:
4038 result
= verify_mroutes(
4041 data
["src_address"],
4046 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4048 for data
in input_dict_l1
:
4049 result
= verify_upstream_iif(
4050 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4052 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4055 "Multicast traffic is resumed for all the groups verify "
4056 "using 'show ip multicast'"
4059 result
= verify_multicast_traffic(tgen
, input_traffic
)
4060 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4062 step("Shut and No shut of LHR to cisco port from LHR side")
4064 intf_r2_f1
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
4065 shutdown_bringup_interface(tgen
, "r2", intf_r2_f1
, False)
4068 "Verification: After Shut of source port, Verify (S,G) got "
4069 "removed from LHR and FHR using 'show ip mroute'"
4072 input_dict_r2_f1
= [
4076 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
4077 "oil": topo
["routers"]["r2"]["links"]["i3"]["interface"],
4083 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
4087 for data
in input_dict_r2_f1
:
4088 result
= verify_mroutes(
4091 data
["src_address"],
4097 assert result
is not True, (
4098 "Testcase {} : Failed \n "
4099 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4100 "Found: {}".format(tc_name
, data
["dut"], result
)
4103 shutdown_bringup_interface(tgen
, "r2", intf_r2_f1
, True)
4106 "Verification: After No shut of source port , Verify (*,G)"
4107 " and (S,G) got populated on LHR node (FRR1) using "
4108 "'show ip mroute' 'show ip pim upstream'"
4111 for data
in input_dict_all
:
4112 result
= verify_mroutes(
4115 data
["src_address"],
4120 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4122 for data
in input_dict_all
:
4123 result
= verify_upstream_iif(
4124 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4126 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4129 "Multicast traffic is resumed for all the groups verify "
4130 "using 'show ip multicast'"
4133 input_traffic_r2
= {
4134 "r2": {"traffic_received": [intf_r2_l1
], "traffic_sent": [intf_r2_i3
]}
4136 result
= verify_multicast_traffic(tgen
, input_traffic_r2
)
4137 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4139 step("Shut and no shut of FHR to LHR port from FHR side")
4141 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
4142 shutdown_bringup_interface(tgen
, "l1", intf_l1_r2
, False)
4145 "Verification: After Shut of LHR to FHR port, Verify (S,G)"
4146 "got removed from LHR 'show ip mroute'"
4151 iif
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
4152 oil
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
4154 result
= verify_mroutes(tgen
, dut
, src_address
, _IGMP_JOIN_RANGE
, iif
, oil
)
4155 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4157 src_address
= source_i1
4158 iif
= topo
["routers"]["r2"]["links"]["l1"]["interface"]
4159 oil
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
4161 result
= verify_mroutes(
4162 tgen
, dut
, src_address
, _IGMP_JOIN_RANGE
, iif
, oil
, expected
=False
4164 assert result
is not True, (
4165 "Testcase {} : Failed \n "
4166 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4167 "Found: {}".format(tc_name
, dut
, result
)
4170 shutdown_bringup_interface(tgen
, "l1", intf_l1_r2
, True)
4173 "Verification: After No shut of source port , Verify (*,G)"
4174 " and (S,G) got populated on LHR node (FRR1) using "
4175 "'show ip mroute' 'show ip pim upstream'"
4178 for data
in input_dict_all
:
4179 result
= verify_mroutes(
4182 data
["src_address"],
4187 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4189 for data
in input_dict_all
:
4190 result
= verify_upstream_iif(
4191 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4193 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4196 "Multicast traffic is resumed for all the groups verify "
4197 "using 'show ip multicast'"
4200 result
= verify_multicast_traffic(tgen
, input_traffic_r2
)
4201 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4203 write_test_footer(tc_name
)
4206 def test_verify_multicast_traffic_when_FHR_connected_to_RP_p1(request
):
4208 TC_12: Verify multicast traffic is flowing fine when FHR is connected to RP
4210 LHR(FRR1)---FHR(FRR3)----RP(FRR2)
4213 tgen
= get_topogen()
4214 tc_name
= request
.node
.name
4215 write_test_header(tc_name
)
4217 # Don"t run this test if we have any failure.
4218 if tgen
.routers_have_failure():
4219 pytest
.skip(tgen
.errors
)
4221 # Creating configuration from JSON
4222 app_helper
.stop_all_hosts()
4224 reset_config_on_routers(tgen
)
4225 clear_pim_interface_traffic(tgen
, topo
)
4226 check_router_status(tgen
)
4229 "Remove FRR3 to FRR2 connected link to simulate topo "
4230 "FHR(FRR3)---LHR(FRR1)----RP(FFR2)"
4233 intf_l1_c1
= topo
["routers"]["l1"]["links"]["c1"]["interface"]
4234 intf_f1_c2
= topo
["routers"]["f1"]["links"]["c2"]["interface"]
4235 shutdown_bringup_interface(tgen
, "l1", intf_l1_c1
, False)
4236 shutdown_bringup_interface(tgen
, "f1", intf_f1_c2
, False)
4238 step("Enable the PIM on all the interfaces of FRR1, R2 and FRR3" " routers")
4239 step("Enable IGMP on FRR1(l1) interface and send IGMP join " " and (225.1.1.1-5)")
4241 _GROUP_RANGE
= GROUP_RANGE_2
+ GROUP_RANGE_3
4242 _IGMP_JOIN_RANGE
= IGMP_JOIN_RANGE_2
+ IGMP_JOIN_RANGE_3
4244 input_join
= {"i1": topo
["routers"]["i1"]["links"]["l1"]["interface"]}
4246 for recvr
, recvr_intf
in input_join
.items():
4247 result
= app_helper
.run_join(recvr
, _IGMP_JOIN_RANGE
, join_intf
=recvr_intf
)
4248 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
4250 step("Configure RP for (225.1.1.1-5) in (f1)")
4257 "rp_addr": topo
["routers"]["f1"]["links"]["lo"]["ipv4"].split(
4260 "group_addr_range": _GROUP_RANGE
,
4267 result
= create_pim_config(tgen
, topo
, input_dict
)
4268 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4270 step("Send multicast traffic from FRR3(r2) to 225.1.1.1-225.1.1.10" " receiver")
4272 input_src
= {"i3": topo
["routers"]["i3"]["links"]["r2"]["interface"]}
4274 for src
, src_intf
in input_src
.items():
4275 result
= app_helper
.run_traffic(src
, _IGMP_JOIN_RANGE
, bind_intf
=src_intf
)
4276 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4279 "'show ip mroute' showing correct RPF and OIF interface for (*,G)"
4280 " and (S,G) entries on all the nodes"
4283 source_i3
= topo
["routers"]["i3"]["links"]["r2"]["ipv4"].split("/")[0]
4288 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
4289 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
4293 "src_address": source_i3
,
4294 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
4295 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
4300 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
4301 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
4305 "src_address": source_i3
,
4306 "iif": topo
["routers"]["r2"]["links"]["i3"]["interface"],
4307 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
4311 for data
in input_dict_all
:
4312 result
= verify_mroutes(
4315 data
["src_address"],
4320 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4322 for data
in input_dict_all
:
4323 result
= verify_upstream_iif(
4324 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4326 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4328 intf_l1_r2
= topo
["routers"]["l1"]["links"]["r2"]["interface"]
4329 intf_f1_r2
= topo
["routers"]["f1"]["links"]["r2"]["interface"]
4330 intf_l1_i1
= topo
["routers"]["l1"]["links"]["i1"]["interface"]
4332 "l1": {"traffic_received": [intf_l1_r2
], "traffic_sent": [intf_l1_i1
]}
4334 result
= verify_multicast_traffic(tgen
, input_traffic
)
4335 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4337 step("Shut the receiver(l1) port in 1 min interval")
4339 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, False)
4342 "Verification: After Shut of receiver port, Verify (*,G) and "
4343 "(S,G) got removed from LHR node (FRR1) using 'show ip mroute'"
4349 "src_address": source_i3
,
4350 "iif": topo
["routers"]["l1"]["links"]["r2"]["interface"],
4351 "oil": topo
["routers"]["l1"]["links"]["i1"]["interface"],
4355 for data
in input_dict_l1
:
4356 result
= verify_mroutes(
4359 data
["src_address"],
4365 assert result
is not True, (
4366 "Testcase {} : Failed \n "
4367 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4368 "Found: {}".format(tc_name
, data
["dut"], result
)
4371 step("No shut the receiver(l1) port in 1 min interval")
4373 shutdown_bringup_interface(tgen
, "l1", intf_l1_i1
, True)
4376 "Verification: After No shut of receiver port , Verify (*,G)"
4377 " and (S,G) got populated on LHR node (FRR1) using "
4378 "'show ip mroute' 'show ip pim upstream'"
4381 for data
in input_dict_l1
:
4382 result
= verify_mroutes(
4385 data
["src_address"],
4390 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4392 for data
in input_dict_l1
:
4393 result
= verify_upstream_iif(
4394 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4396 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4398 result
= verify_multicast_traffic(tgen
, input_traffic
)
4399 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4401 step("Shut the source(r2) port in 1 min interval")
4403 intf_r2_i3
= topo
["routers"]["r2"]["links"]["i3"]["interface"]
4404 shutdown_bringup_interface(tgen
, "r2", intf_r2_i3
, False)
4407 "Verification: After Shut of source port, Verify (S,G) got "
4408 "removed from FHR using 'show ip mroute'"
4414 "src_address": source_i3
,
4415 "iif": topo
["routers"]["r2"]["links"]["i3"]["interface"],
4416 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
4420 for data
in input_dict_r2
:
4421 result
= verify_mroutes(
4424 data
["src_address"],
4430 assert result
is not True, (
4431 "Testcase {} : Failed \n "
4432 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4433 "Found: {}".format(tc_name
, data
["dut"], result
)
4436 step("No shut the source(r2) port in 1 min interval")
4438 shutdown_bringup_interface(tgen
, "r2", intf_r2_i3
, True)
4441 "Verification: After No shut of source port , Verify (*,G)"
4442 " and (S,G) got populated on LHR and FHR using "
4443 "'show ip mroute' 'show ip pim upstream'"
4446 for data
in input_dict_r2
:
4447 result
= verify_mroutes(
4450 data
["src_address"],
4455 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4457 for data
in input_dict_r2
:
4458 result
= verify_upstream_iif(
4459 tgen
, data
["dut"], data
["iif"], data
["src_address"], _IGMP_JOIN_RANGE
4461 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4463 result
= verify_multicast_traffic(tgen
, input_traffic
)
4464 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4466 step("Shut FHR to RP port from FHR side")
4468 intf_r2_f1
= topo
["routers"]["r2"]["links"]["f1"]["interface"]
4469 shutdown_bringup_interface(tgen
, "r2", intf_r2_f1
, False)
4472 "Verification: After Shut of FHR to cisco port, Verify (*,G) "
4473 "got removed from FHR and cisco node using 'show ip mroute'"
4476 input_dict_all_star
= [
4480 "iif": topo
["routers"]["r2"]["links"]["f1"]["interface"],
4481 "oil": topo
["routers"]["r2"]["links"]["l1"]["interface"],
4487 "oil": topo
["routers"]["f1"]["links"]["r2"]["interface"],
4491 for data
in input_dict_all_star
:
4492 result
= verify_mroutes(
4495 data
["src_address"],
4501 assert result
is not True, (
4502 "Testcase {} : Failed \n "
4503 "Expected: [{}]: mroute (S, G) should not be present in mroute table \n "
4504 "Found: {}".format(tc_name
, data
["dut"], result
)
4507 write_test_footer(tc_name
)
4510 def test_PIM_passive_p1(request
):
4512 TC Verify PIM passive functionality"
4515 tgen
= get_topogen()
4516 tc_name
= request
.node
.name
4517 write_test_header(tc_name
)
4518 app_helper
.stop_all_hosts()
4519 # Creating configuration from JSON
4521 if tgen
.routers_have_failure():
4522 check_router_status(tgen
)
4523 reset_config_on_routers(tgen
)
4524 clear_pim_interface_traffic(tgen
, topo
)
4526 step("Enable the PIM on all the interfaces of FRR1, FRR2, FRR3")
4528 "Enable IGMP of FRR1 interface and send IGMP joins "
4529 " from FRR1 node for group range (225.1.1.1-5)"
4532 intf_c1_i4
= topo
["routers"]["c1"]["links"]["i4"]["interface"]
4535 "configure PIM passive on receiver interface to verify no impact on IGMP join"
4536 "and multicast traffic on pim passive interface"
4540 "c1": {"raw_config": ["interface {}".format(intf_c1_i4
), "ip pim passive"]}
4542 result
= apply_raw_config(tgen
, raw_config
)
4543 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4545 step("configure IGMPv2 and send IGMP joinon on PIM passive interface")
4547 "c1": {"igmp": {"interfaces": {intf_c1_i4
: {"igmp": {"version": "2"}}}}}
4549 result
= create_igmp_config(tgen
, topo
, input_dict
)
4550 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
4552 input_join
= {"i4": topo
["routers"]["i4"]["links"]["c1"]["interface"]}
4553 for recvr
, recvr_intf
in input_join
.items():
4554 result
= app_helper
.run_join(recvr
, IGMP_JOIN_RANGE_1
, join_intf
=recvr_intf
)
4555 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
4557 step("Configure static RP for (225.1.1.1-5) as R2")
4564 "rp_addr": topo
["routers"]["r2"]["links"]["lo"]["ipv4"].split(
4567 "group_addr_range": GROUP_RANGE_1
,
4574 result
= create_pim_config(tgen
, topo
, input_dict
)
4575 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4577 step("Send Mcast traffic from C2 to all the groups ( 225.1.1.1 to 225.1.1.5)")
4579 input_src
= {"i5": topo
["routers"]["i5"]["links"]["c2"]["interface"]}
4580 for src
, src_intf
in input_src
.items():
4581 result
= app_helper
.run_traffic(src
, IGMP_JOIN_RANGE_1
, bind_intf
=src_intf
)
4582 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4584 source_i5
= topo
["routers"]["i5"]["links"]["c2"]["ipv4"].split("/")[0]
4586 input_dict_starg
= [
4590 "iif": topo
["routers"]["c1"]["links"]["l1"]["interface"],
4591 "oil": topo
["routers"]["c1"]["links"]["i4"]["interface"],
4598 "src_address": source_i5
,
4599 "iif": topo
["routers"]["c1"]["links"]["c2"]["interface"],
4600 "oil": topo
["routers"]["c1"]["links"]["i4"]["interface"],
4604 step("(*,G) and (S,G) created on f1 and node verify using 'show ip mroute'")
4606 for data
in input_dict_sg
:
4607 result
= verify_mroutes(
4610 data
["src_address"],
4615 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4617 for data
in input_dict_sg
:
4618 result
= verify_mroutes(
4621 data
["src_address"],
4626 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4628 for data
in input_dict_starg
:
4629 result
= verify_mroutes(
4632 data
["src_address"],
4637 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4639 intf_c1_c2
= topo
["routers"]["c1"]["links"]["c2"]["interface"]
4640 intf_c2_c1
= topo
["routers"]["c2"]["links"]["c1"]["interface"]
4643 "configure PIM passive on upstream interface to verify"
4644 "hello tx/rx counts are not incremented"
4647 # Changing hello timer to 3sec for checking more number of packets
4652 "interface {}".format(intf_c1_c2
),
4657 "c2": {"raw_config": ["interface {}".format(intf_c2_c1
), "ip pim hello 3"]},
4659 result
= apply_raw_config(tgen
, raw_config
)
4660 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4662 step("verify PIM hello tx/rx stats on C1")
4665 intf_c1_c2
: ["helloTx", "helloRx"],
4669 logger
.info("waiting for 5 sec config to get apply and hello count update")
4672 c1_state_before
= verify_pim_interface_traffic(tgen
, state_dict
)
4674 c1_state_before
, dict
4675 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
4680 "sleeping for 30 sec hello interval timer to verify count are not increamented"
4684 c1_state_after
= verify_pim_interface_traffic(tgen
, state_dict
)
4686 c1_state_after
, dict
4687 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
4691 step("verify stats not increamented on c1")
4692 result
= verify_pim_stats_increament(c1_state_before
, c1_state_after
)
4695 ), "Testcase{} : Failed Error: {}" "stats incremented".format(tc_name
, result
)
4697 step("No impact observed on mroutes")
4698 for data
in input_dict_sg
:
4699 result
= verify_mroutes(
4702 data
["src_address"],
4707 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4709 for data
in input_dict_sg
:
4710 result
= verify_mroutes(
4713 data
["src_address"],
4718 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4720 for data
in input_dict_starg
:
4721 result
= verify_mroutes(
4724 data
["src_address"],
4729 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4731 step("remove PIM passive and verify hello tx/rx is increamented")
4735 "interface {}".format(intf_c1_c2
),
4736 "no ip pim passive",
4741 result
= apply_raw_config(tgen
, raw_config
)
4742 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
4744 logger
.info("waiting for 30 sec for pim hello to receive")
4747 c1_state_after
= verify_pim_interface_traffic(tgen
, state_dict
)
4749 c1_state_after
, dict
4750 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
4754 step("verify stats increamented on c1 after removing pim passive")
4755 result
= verify_pim_stats_increament(c1_state_before
, c1_state_after
)
4756 assert result
is True, "Testcase{} : Failed Error: {}" "stats incremented".format(
4760 write_test_footer(tc_name
)
4763 if __name__
== "__main__":
4764 args
= ["-s"] + sys
.argv
[1:]
4765 sys
.exit(pytest
.main(args
))