2 # SPDX-License-Identifier: ISC
5 # Copyright (c) 2022 by VMware, Inc. ("VMware")
6 # Used Copyright (c) 2018 by Network Device Education Foundation,
7 # Inc. ("NetDEF") in this file.
11 Following tests are covered to test Multicast basic functionality:
18 r0-----r1-------------r3-----r5
24 - Create topology (setup module)
27 1. Verify upstream interfaces(IIF) and join state are updated
28 properly after adding and deleting the static RP
29 2. Verify IIF and OIL in "show ipv6 PIM6 state" updated properly when
30 RP becomes unreachable
31 3. Verify RP becomes reachable after MLD join received, PIM6 join
32 towards RP is sent immediately
33 4. Verify (*,G) and (S,G) populated correctly when SPT and RPT
35 5. Verify OIF and RPF for (*,G) and (S,G) when static RP configure
37 6. Verify OIF and RFP for (*,G) and (S,G) when static RP configure
39 7. Verify (*,G) and (S,G) populated correctly when RPT and SPT path
41 8. Verify PIM6 join send towards the higher preferred RP
42 9. Verify PIM6 prune send towards the lower preferred RP
51 # Save the Current Working Directory to find configuration files.
52 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
53 sys
.path
.append(os
.path
.join(CWD
, "../"))
54 sys
.path
.append(os
.path
.join(CWD
, "../lib/"))
56 # Required to instantiate the topology builder class.
58 # pylint: disable=C0413
59 # Import topogen and topotest helpers
60 from lib
.topogen
import Topogen
, get_topogen
62 from lib
.common_config
import (
66 reset_config_on_routers
,
68 shutdown_bringup_interface
,
74 socat_send_pim6_traffic
,
80 verify_join_state_and_timer
,
83 verify_pim_interface_traffic
,
86 clear_pim6_interface_traffic
,
88 verify_pim6_neighbors
,
89 get_pim6_interface_traffic
,
90 clear_pim6_interfaces
,
93 from lib
.topolog
import logger
94 from lib
.topojson
import build_topo_from_json
, build_config_from_json
97 GROUP_RANGE_1
= "ff08::/64"
98 GROUP_ADDRESS_1
= "ff08::1"
99 GROUP_RANGE_3
= "ffaa::/64"
100 GROUP_ADDRESS_3
= "ffaa::1"
101 GROUP_RANGE_4
= "ff00::/8"
102 GROUP_ADDRESS_4
= "ff00::1"
105 ASSERT_MSG
= "Testcase {} : Failed Error: {}"
107 pytestmark
= [pytest
.mark
.pim6d
]
110 def build_topo(tgen
):
113 # Building topology from json file
114 build_topo_from_json(tgen
, TOPO
)
117 def setup_module(mod
):
119 Sets up the pytest environment
124 testsuite_run_time
= time
.asctime(time
.localtime(time
.time()))
125 logger
.info("Testsuite start time: %s", testsuite_run_time
)
126 logger
.info("=" * 40)
133 r0-----r1-------------r3-----r5
139 logger
.info("Master Topology: \n %s", topology
)
141 logger
.info("Running setup_module to create topology")
143 # This function initiates the topology build with Topogen...
144 json_file
= "{}/multicast_pim6_static_rp.json".format(CWD
)
145 tgen
= Topogen(json_file
, mod
.__name
__)
147 TOPO
= tgen
.json_topo
149 # ... and here it calls Mininet initialization functions.
151 # Starting topology, create tmp files which are loaded to routers
152 # to start daemons and then start routers
155 # Don"t run this test if we have any failure.
156 if tgen
.routers_have_failure():
157 pytest
.skip(tgen
.errors
)
159 # Creating configuration from JSON
160 build_config_from_json(tgen
, TOPO
)
162 # Verify PIM6 neighbors
163 result
= verify_pim6_neighbors(tgen
, TOPO
)
164 assert result
is True, "setup_module :Failed \n Error:" " {}".format(result
)
166 logger
.info("Running setup_module() done")
169 def teardown_module():
170 """Teardown the pytest environment"""
172 logger
.info("Running teardown_module to delete topology")
175 # Stop toplogy and Remove tmp files
178 logger
.info("Testsuite end time: %s", time
.asctime(time
.localtime(time
.time())))
179 logger
.info("=" * 40)
182 #####################################################
186 #####################################################
189 def verify_state_incremented(state_before
, state_after
):
191 API to compare interface traffic state incrementing
195 * `state_before` : State dictionary for any particular instance
196 * `state_after` : State dictionary for any particular instance
199 for router
, state_data
in state_before
.items():
200 for state
, value
in state_data
.items():
201 if state_before
[router
][state
] >= state_after
[router
][state
]:
203 "[DUT: %s]: state %s value has not"
204 " incremented, Initial value: %s, "
205 "Current value: %s [FAILED!!]"
209 state_before
[router
][state
],
210 state_after
[router
][state
],
216 "[DUT: %s]: State %s value is "
217 "incremented, Initial value: %s, Current value: %s"
221 state_before
[router
][state
],
222 state_after
[router
][state
],
228 #####################################################
232 #####################################################
235 def test_pim6_add_delete_static_RP_p0(request
):
237 Verify upstream interfaces(IIF) and join state are updated
238 properly after adding and deleting the static RP
239 Verify IIF and OIL in "show ipv6 PIM6 state" updated properly when
240 RP becomes unreachable
241 Verify RP becomes reachable after MLD join received, PIM6 join
242 towards RP is sent immediately
250 tc_name
= request
.node
.name
251 write_test_header(tc_name
)
253 # Don"t run this test if we have any failure.
254 if tgen
.routers_have_failure():
255 check_router_status(tgen
)
257 step("Creating configuration from JSON")
258 reset_config_on_routers(tgen
)
260 step("Shut link b/w R1 and R3 and R1 and R4 as per testcase topology")
261 intf_r1_r3
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
262 intf_r1_r4
= TOPO
["routers"]["r1"]["links"]["r4"]["interface"]
263 for intf
in [intf_r1_r3
, intf_r1_r4
]:
264 shutdown_bringup_interface(tgen
, "r1", intf
, ifaceaction
=False)
266 step("Enable PIM6 between r1 and r2")
268 "Enable MLD on r1 interface and send MLD " "join {} to r1".format(GROUP_RANGE_1
)
270 step("Configure r2 loopback interface as RP")
276 "rp_addr": TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split(
279 "group_addr_range": GROUP_RANGE_1
,
286 result
= create_pim_config(tgen
, TOPO
, input_dict
)
287 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
289 step("r1: Verify show ipv6 mld group without any MLD join")
291 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
292 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
, expected
=False)
293 assert result
is not True, (
294 "Testcase {} : Failed \n "
295 "r1: mld group present without any MLD join \n Error: {}".format(
300 step("Verify show ipv6 PIM6 interface traffic without any mld join")
302 "r1": {TOPO
["routers"]["r1"]["links"]["r2"]["interface"]: ["pruneTx"]}
305 state_before
= verify_pim_interface_traffic(tgen
, state_dict
, addr_type
="ipv6")
308 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
312 step("send mld join {} to R1".format(GROUP_ADDRESS_1
))
313 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
314 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
315 result
= socat_send_mld_join(
316 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_1
, intf
, intf_ip
318 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
320 step("r1: Verify MLD groups")
321 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
)
322 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
324 step("r1: Verify RP info")
326 oif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
327 iif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
328 rp_address
= TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split("/")[0]
329 result
= verify_pim_rp_info(tgen
, TOPO
, dut
, GROUP_RANGE_1
, oif
, rp_address
, SOURCE
)
330 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
332 step("r1: Verify upstream IIF interface")
333 result
= verify_upstream_iif(tgen
, dut
, oif
, STAR
, GROUP_ADDRESS_1
)
334 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
336 step("r1: Verify upstream join state and join timer")
337 result
= verify_join_state_and_timer(tgen
, dut
, oif
, STAR
, GROUP_ADDRESS_1
)
338 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
340 step("r1: Verify PIM6 state")
341 result
= verify_pim_state(tgen
, dut
, oif
, iif
, GROUP_ADDRESS_1
)
342 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
344 step("r1: Verify ip mroutes")
345 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, oif
, iif
)
346 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
348 step("r1: Delete RP configuration")
354 "rp_addr": TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split(
357 "group_addr_range": GROUP_RANGE_1
,
365 result
= create_pim_config(tgen
, TOPO
, input_dict
)
366 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
368 step("r1: Verify RP info")
369 result
= verify_pim_rp_info(
370 tgen
, TOPO
, dut
, GROUP_RANGE_1
, oif
, rp_address
, SOURCE
, expected
=False
374 ), "Testcase {} :Failed \n " "RP: {} info is still present \n Error: {}".format(
375 tc_name
, rp_address
, result
378 step("r1: Verify upstream IIF interface")
379 result
= verify_upstream_iif(tgen
, dut
, oif
, STAR
, GROUP_ADDRESS_1
, expected
=False)
380 assert result
is not True, (
381 "Testcase {} :Failed \n "
382 "Upstream ({}, {}) is still in join state \n Error: {}".format(
383 tc_name
, STAR
, GROUP_ADDRESS_1
, result
387 step("r1: Verify upstream join state and join timer")
388 result
= verify_join_state_and_timer(
389 tgen
, dut
, oif
, STAR
, GROUP_ADDRESS_1
, expected
=False
391 assert result
is not True, (
392 "Testcase {} :Failed \n "
393 "Upstream ({}, {}) timer is still running \n Error: {}".format(
394 tc_name
, STAR
, GROUP_ADDRESS_1
, result
398 step("r1: Verify PIM6 state")
399 result
= verify_pim_state(tgen
, dut
, oif
, iif
, GROUP_ADDRESS_1
, expected
=False)
400 assert result
is not True, (
401 "Testcase {} :Failed \n "
402 "PIM state for group: {} is still Active \n Error: {}".format(
403 tc_name
, GROUP_ADDRESS_1
, result
407 step("r1: Verify ip mroutes")
408 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, oif
, iif
, expected
=False)
409 assert result
is not True, (
410 "Testcase {} :Failed \n "
411 "mroute ({}, {}) is still present \n Error: {}".format(
412 tc_name
, STAR
, GROUP_ADDRESS_1
, result
416 step("r1: Verify show ipv6 PIM6 interface traffic without any MLD join")
417 state_after
= verify_pim_interface_traffic(tgen
, state_dict
, addr_type
="ipv6")
420 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
424 result
= verify_state_incremented(state_before
, state_after
)
425 assert result
is True, "Testcase{} : Failed Error: {}".format(tc_name
, result
)
427 write_test_footer(tc_name
)
430 def test_pim6_SPT_RPT_path_same_p1(request
):
432 Verify (*,G) and (S,G) populated correctly when SPT and RPT
447 tc_name
= request
.node
.name
448 write_test_header(tc_name
)
450 # Don"t run this test if we have any failure.
451 if tgen
.routers_have_failure():
452 pytest
.skip(tgen
.errors
)
454 step("Creating configuration from JSON")
455 reset_config_on_routers(tgen
)
457 step("Shut link b/w R1->R3, R1->R4 and R3->R1, R3->R4 as per " "testcase topology")
458 intf_r1_r3
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
459 intf_r1_r4
= TOPO
["routers"]["r1"]["links"]["r4"]["interface"]
460 intf_r3_r1
= TOPO
["routers"]["r3"]["links"]["r1"]["interface"]
461 intf_r3_r4
= TOPO
["routers"]["r3"]["links"]["r4"]["interface"]
462 for intf
in [intf_r1_r3
, intf_r1_r4
]:
463 shutdown_bringup_interface(tgen
, "r1", intf
, ifaceaction
=False)
465 for intf
in [intf_r3_r1
, intf_r3_r4
]:
466 shutdown_bringup_interface(tgen
, "r3", intf
, ifaceaction
=False)
468 step("Enable the PIM6 on all the interfaces of r1, r2, r3 and r4 routers")
470 "Configure RP on r2 (loopback interface) for the group range {}".format(
479 "rp_addr": TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split(
482 "group_addr_range": GROUP_RANGE_1
,
488 result
= create_pim_config(tgen
, TOPO
, input_dict
)
489 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
492 "Enable MLD on r1 interface and send MLD join {} to R1".format(GROUP_ADDRESS_1
)
494 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
495 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
496 result
= socat_send_mld_join(
497 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_1
, intf
, intf_ip
499 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
501 step("r1: Verify MLD groups")
503 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
504 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
)
505 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
507 step("Send multicast traffic from R5")
508 intf
= TOPO
["routers"]["r5"]["links"]["r3"]["interface"]
509 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
510 result
= socat_send_pim6_traffic(tgen
, "r5", "UDP6-SEND", GROUP_ADDRESS_1
, intf
)
511 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
513 step("r2: Verify RP info")
516 rp_address
= TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split("/")[0]
517 result
= verify_pim_rp_info(tgen
, TOPO
, dut
, GROUP_RANGE_1
, oif
, rp_address
, SOURCE
)
518 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
520 step("r1: Verify (*, G) upstream IIF interface")
522 iif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
523 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
524 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
526 step("r1: Verify (*, G) upstream join state and join timer")
527 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
528 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
530 step("r1: Verify (*, G) ip mroutes")
531 oif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
532 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
533 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
535 step("r1: Verify (S, G) upstream IIF interface")
536 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
537 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
539 step("r1: Verify (S, G) upstream join state and join timer")
540 result
= verify_join_state_and_timer(
541 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
543 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
545 step("r1: Verify (S, G) ip mroutes")
546 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
547 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
549 step("r2: Verify (*, G) upstream IIF interface")
552 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
553 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
555 step("r2: Verify (*, G) upstream join state and join timer")
556 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
557 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
559 step("r2: Verify (*, G) ip mroutes")
560 oif
= TOPO
["routers"]["r2"]["links"]["r1"]["interface"]
561 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
562 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
564 step("r2: Verify (S, G) upstream IIF interface")
565 iif
= TOPO
["routers"]["r2"]["links"]["r3"]["interface"]
566 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
567 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
569 step("r2: Verify (S, G) upstream join state and join timer")
570 result
= verify_join_state_and_timer(
571 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
573 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
575 step("r2: Verify (S, G) ip mroutes")
576 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
577 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
579 step("r3: Verify (S, G) upstream IIF interface")
581 iif
= TOPO
["routers"]["r3"]["links"]["r5"]["interface"]
582 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
583 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
585 step("r3: Verify (S, G) upstream join state and join timer")
586 result
= verify_join_state_and_timer(
587 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, expected
=False
589 assert result
is not True, (
590 "Testcase {} : Failed \n "
591 "r3: (S, G) upstream join state is up and join timer is running\n Error: {}".format(
596 step("r3: Verify (S, G) ip mroutes")
597 oif
= TOPO
["routers"]["r3"]["links"]["r2"]["interface"]
598 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
599 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
601 write_test_footer(tc_name
)
604 def test_pim6_RP_configured_as_LHR_p1(request
):
606 Verify OIF and RPF for (*,G) and (S,G) when static RP configure
613 r0-----r1-------------r3-----r5
620 tc_name
= request
.node
.name
621 write_test_header(tc_name
)
623 # Don"t run this test if we have any failure.
624 if tgen
.routers_have_failure():
625 pytest
.skip(tgen
.errors
)
627 step("Creating configuration from JSON")
628 reset_config_on_routers(tgen
)
630 step("Enable MLD on r1 interface")
631 step("Enable the PIM6 on all the interfaces of r1, r2, r3 and r4 routers")
633 step("r1: Configure r1(LHR) as RP")
639 "rp_addr": TOPO
["routers"]["r1"]["links"]["lo"]["ipv6"].split(
642 "group_addr_range": GROUP_RANGE_1
,
649 result
= create_pim_config(tgen
, TOPO
, input_dict
)
650 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
652 step("r1: Shut not Shut loopback interface")
653 shutdown_bringup_interface(tgen
, "r1", "lo", False)
654 shutdown_bringup_interface(tgen
, "r1", "lo", True)
656 step("r1: Verify RP info")
659 oif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
660 rp_address
= TOPO
["routers"]["r1"]["links"]["lo"]["ipv6"].split("/")[0]
661 result
= verify_pim_rp_info(tgen
, TOPO
, dut
, GROUP_RANGE_1
, iif
, rp_address
, SOURCE
)
662 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
664 step("send mld join {} to R1".format(GROUP_ADDRESS_1
))
665 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
666 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
667 result
= socat_send_mld_join(
668 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_1
, intf
, intf_ip
670 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
672 step("r1: Verify MLD groups")
674 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
675 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
)
676 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
678 step("r5: Send multicast traffic for group {}".format(GROUP_ADDRESS_1
))
679 intf
= TOPO
["routers"]["r5"]["links"]["r3"]["interface"]
680 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
681 result
= socat_send_pim6_traffic(tgen
, "r5", "UDP6-SEND", GROUP_ADDRESS_1
, intf
)
682 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
684 step("r1: Verify (*, G) upstream IIF interface")
685 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
686 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
688 step("r1: Verify (*, G) upstream join state and join timer")
689 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
690 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
692 step("r1: Verify (*, G) ip mroutes")
693 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
694 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
696 step("r1: Verify (S, G) upstream IIF interface")
697 iif
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
698 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
699 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
700 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
702 step("r1: Verify (S, G) upstream join state and join timer")
703 result
= verify_join_state_and_timer(
704 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
706 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
708 step("r1: Verify (S, G) ip mroutes")
709 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
710 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
712 step("r3: Verify (S, G) upstream IIF interface")
714 iif
= TOPO
["routers"]["r3"]["links"]["r5"]["interface"]
715 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
716 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
718 step("r3: Verify (S, G) upstream join state and join timer")
719 result
= verify_join_state_and_timer(
720 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, expected
=False
722 assert result
is not True, (
723 "Testcase {} : Failed \n "
724 "r3: (S, G) upstream join state is joined and join"
725 " timer is running \n Error: {}".format(tc_name
, result
)
728 step("r3: Verify (S, G) ip mroutes")
729 oif
= TOPO
["routers"]["r3"]["links"]["r1"]["interface"]
730 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
731 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
733 write_test_footer(tc_name
)
736 def test_pim6_RP_configured_as_FHR_p1(request
):
738 Verify OIF and RFP for (*,G) and (S,G) when static RP configure
745 r0-----r1-------------r3-----r5
752 tc_name
= request
.node
.name
753 write_test_header(tc_name
)
755 # Don"t run this test if we have any failure.
756 if tgen
.routers_have_failure():
757 pytest
.skip(tgen
.errors
)
759 step("Creating configuration from JSON")
760 reset_config_on_routers(tgen
)
762 step("Enable MLD on r1 interface")
763 step("Enable the PIM6 on all the interfaces of r1, r2, r3 and r4 routers")
764 step("r3: Configure r3(FHR) as RP")
770 "rp_addr": TOPO
["routers"]["r3"]["links"]["lo"]["ipv6"].split(
773 "group_addr_range": GROUP_RANGE_1
,
780 result
= create_pim_config(tgen
, TOPO
, input_dict
)
781 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
783 step("r1: Verify RP info")
785 iif
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
786 oif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
787 rp_address
= TOPO
["routers"]["r3"]["links"]["lo"]["ipv6"].split("/")[0]
788 result
= verify_pim_rp_info(tgen
, TOPO
, dut
, GROUP_RANGE_1
, iif
, rp_address
, SOURCE
)
789 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
791 step("send mld join {} to R1".format(GROUP_ADDRESS_1
))
792 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
793 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
794 result
= socat_send_mld_join(
795 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_1
, intf
, intf_ip
797 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
799 step("r1: Verify MLD groups")
801 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
802 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
)
803 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
805 step("r5: Send multicast traffic for group {}".format(GROUP_ADDRESS_1
))
806 intf
= TOPO
["routers"]["r5"]["links"]["r3"]["interface"]
807 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
808 result
= socat_send_pim6_traffic(tgen
, "r5", "UDP6-SEND", GROUP_ADDRESS_1
, intf
)
809 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
811 step("r1: Verify (*, G) upstream IIF interface")
812 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
813 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
815 step("r1: Verify (*, G) upstream join state and join timer")
816 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
817 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
819 step("r1: Verify (*, G) ip mroutes")
820 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
821 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
823 step("r1: Verify (S, G) upstream IIF interface")
824 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
825 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
826 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
828 step("r1: Verify (S, G) upstream join state and join timer")
829 result
= verify_join_state_and_timer(
830 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
832 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
834 step("r1: Verify (S, G) ip mroutes")
835 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
836 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
838 step("r3: Verify (S, G) upstream IIF interface")
840 iif
= TOPO
["routers"]["r3"]["links"]["r5"]["interface"]
841 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
842 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
844 step("r3: Verify (S, G) upstream join state and join timer")
845 result
= verify_join_state_and_timer(
846 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, expected
=False
848 assert result
is not True, (
849 "Testcase {} : Failed \n "
850 "r3: (S,G) upstream state is joined and join timer is running\n Error: {}".format(
855 step("r3: Verify (S, G) ip mroutes")
856 oif
= TOPO
["routers"]["r3"]["links"]["r1"]["interface"]
857 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
858 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
860 write_test_footer(tc_name
)
863 def test_pim6_SPT_RPT_path_different_p1(request
):
865 Verify (*,G) and (S,G) populated correctly when RPT and SPT path
872 r0-----r1-------------r3-----r5
880 tc_name
= request
.node
.name
881 write_test_header(tc_name
)
883 # Don"t run this test if we have any failure.
884 if tgen
.routers_have_failure():
885 pytest
.skip(tgen
.errors
)
887 step("Creating configuration from JSON")
888 reset_config_on_routers(tgen
)
890 step("Enable MLD on r1 interface")
891 step("Enable the PIM6 on all the interfaces of r1, r2, r3 and r4 routers")
892 step("r2: Configure r2 as RP")
898 "rp_addr": TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split(
901 "group_addr_range": GROUP_RANGE_1
,
908 result
= create_pim_config(tgen
, TOPO
, input_dict
)
909 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
911 step("r2: Verify RP info")
914 rp_address
= TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split("/")[0]
915 result
= verify_pim_rp_info(
916 tgen
, TOPO
, dut
, GROUP_ADDRESS_1
, iif
, rp_address
, SOURCE
918 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
920 step("send mld join {} to R1".format(GROUP_ADDRESS_1
))
921 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
922 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
923 result
= socat_send_mld_join(
924 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_1
, intf
, intf_ip
926 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
928 step("r1: Verify MLD groups")
930 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
931 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_1
)
932 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
934 step("r5: Send multicast traffic for group {}".format(GROUP_ADDRESS_1
))
935 intf
= TOPO
["routers"]["r5"]["links"]["r3"]["interface"]
936 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
937 result
= socat_send_pim6_traffic(tgen
, "r5", "UDP6-SEND", GROUP_ADDRESS_1
, intf
)
938 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
940 step("r1: Verify (*, G) upstream IIF interface")
942 iif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
943 oif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
944 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
945 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
947 step("r1: Verify (*, G) upstream join state and join timer")
948 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
949 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
951 step("r1: Verify (*, G) ip mroutes")
952 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
953 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
955 step("r1: Verify (S, G) ip mroutes")
956 iif
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
957 SOURCE_ADDRESS
= TOPO
["routers"]["r5"]["links"]["r3"]["ipv6"].split("/")[0]
958 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
959 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
961 step("r1: Verify (S, G) upstream IIF interface")
962 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
963 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
965 step("r1: Verify (S, G) upstream join state and join timer")
966 result
= verify_join_state_and_timer(
967 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
969 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
971 step("r2: Verify (*, G) upstream IIF interface")
974 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
975 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
977 step("r2: Verify (*, G) upstream join state and join timer")
978 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_1
)
979 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
981 step("r2: Verify (*, G) ip mroutes")
982 oif
= TOPO
["routers"]["r2"]["links"]["r1"]["interface"]
983 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_1
, iif
, oif
)
984 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
986 step("r3: Verify (S, G) upstream IIF interface")
988 iif
= TOPO
["routers"]["r3"]["links"]["r5"]["interface"]
989 result
= verify_upstream_iif(tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
)
990 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
992 step("r3: Verify (S, G) upstream join state and join timer")
993 result
= verify_join_state_and_timer(
994 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, expected
=False
996 assert result
is not True, (
997 "Testcase {} : Failed \n "
998 "r3: (S,G) upstream state is joined and join timer is running\n Error: {}".format(
1003 step("r3: Verify (S, G) ip mroutes")
1004 oif
= TOPO
["routers"]["r3"]["links"]["r1"]["interface"]
1005 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
1006 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1008 step("r2: Verify (S, G) upstream IIF interface")
1010 iif
= TOPO
["routers"]["r2"]["links"]["r3"]["interface"]
1011 result
= verify_upstream_iif(
1012 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, joinState
="NotJoined"
1014 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1016 step("r2: Verify (S, G) upstream join state and join timer")
1017 result
= verify_join_state_and_timer(
1018 tgen
, dut
, iif
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, expected
=False
1020 assert result
is not True, (
1021 "Testcase {} : Failed \n "
1022 "r2: (S,G) upstream state is joined and join timer is running\n Error: {}".format(
1027 step("r2: Verify (S, G) ip mroutes")
1029 result
= verify_mroutes(tgen
, dut
, SOURCE_ADDRESS
, GROUP_ADDRESS_1
, iif
, oif
)
1030 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1032 write_test_footer(tc_name
)
1035 def test_pim6_send_join_on_higher_preffered_rp_p1(request
):
1037 Verify PIM6 join send towards the higher preferred RP
1038 Verify PIM6 prune send towards the lower preferred RP
1049 tgen
= get_topogen()
1050 tc_name
= request
.node
.name
1051 write_test_header(tc_name
)
1053 # Don"t run this test if we have any failure.
1054 if tgen
.routers_have_failure():
1055 pytest
.skip(tgen
.errors
)
1057 step("Creating configuration from JSON")
1058 reset_config_on_routers(tgen
)
1060 step("Enable MLD on r1 interface")
1061 step("Enable the PIM66 on all the interfaces of r1, r2, r3 and r4 routers")
1063 "Configure RP on r2 (loopback interface) for the group range {}".format(
1072 "rp_addr": TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split(
1075 "group_addr_range": GROUP_RANGE_4
,
1081 result
= create_pim_config(tgen
, TOPO
, input_dict
)
1082 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1084 step("r3 : Make all interface not reachable")
1085 intf_r3_r1
= TOPO
["routers"]["r3"]["links"]["r1"]["interface"]
1086 intf_r3_r2
= TOPO
["routers"]["r3"]["links"]["r2"]["interface"]
1087 intf_r3_r4
= TOPO
["routers"]["r3"]["links"]["r4"]["interface"]
1088 intf_r1_r3
= TOPO
["routers"]["r1"]["links"]["r3"]["interface"]
1089 intf_r2_r3
= TOPO
["routers"]["r2"]["links"]["r3"]["interface"]
1090 intf_r4_r3
= TOPO
["routers"]["r4"]["links"]["r3"]["interface"]
1092 for dut
, intf
in zip(["r1", "r2", "r3"], [intf_r1_r3
, intf_r2_r3
, intf_r4_r3
]):
1093 shutdown_bringup_interface(tgen
, dut
, intf
, ifaceaction
=False)
1095 for intf
in [intf_r3_r1
, intf_r3_r4
, intf_r3_r4
]:
1096 shutdown_bringup_interface(tgen
, "r3", intf
, ifaceaction
=False)
1098 step("Verify show ipv6 PIM6 interface traffic without any mld join")
1099 state_dict
= {"r1": {TOPO
["routers"]["r1"]["links"]["r4"]["interface"]: ["joinTx"]}}
1101 state_before
= get_pim6_interface_traffic(tgen
, state_dict
)
1104 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
1108 step("r0: send mld join {} to R1".format(GROUP_ADDRESS_3
))
1109 intf
= TOPO
["routers"]["r0"]["links"]["r1"]["interface"]
1110 intf_ip
= TOPO
["routers"]["r0"]["links"]["r1"]["ipv6"].split("/")[0]
1111 result
= socat_send_mld_join(
1112 tgen
, "r0", "UDP6-RECV", GROUP_ADDRESS_3
, intf
, intf_ip
1114 assert result
is True, "Testcase {}: Failed Error: {}".format(tc_name
, result
)
1116 step("r1: Verify MLD groups")
1118 intf_r1_r0
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
1119 result
= verify_mld_groups(tgen
, dut
, intf_r1_r0
, GROUP_ADDRESS_3
)
1120 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1122 step("Configure RP on r4 (loopback interface) for the group range " "ffaa::/128")
1128 "rp_addr": TOPO
["routers"]["r4"]["links"]["lo"]["ipv6"].split(
1131 "group_addr_range": GROUP_RANGE_3
,
1137 result
= create_pim_config(tgen
, TOPO
, input_dict
)
1138 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1140 step("r1 : Verify RP info for group {}".format(GROUP_ADDRESS_4
))
1142 iif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
1143 rp_address_1
= TOPO
["routers"]["r2"]["links"]["lo"]["ipv6"].split("/")[0]
1144 result
= verify_pim_rp_info(
1145 tgen
, TOPO
, dut
, GROUP_ADDRESS_4
, iif
, rp_address_1
, SOURCE
1147 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1149 step("r1 : Verify RP info for group {}".format(GROUP_ADDRESS_3
))
1151 iif
= TOPO
["routers"]["r1"]["links"]["r4"]["interface"]
1152 rp_address_2
= TOPO
["routers"]["r4"]["links"]["lo"]["ipv6"].split("/")[0]
1153 result
= verify_pim_rp_info(
1154 tgen
, TOPO
, dut
, GROUP_ADDRESS_3
, iif
, rp_address_2
, SOURCE
1156 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1158 step("r1 : Verify join is sent to higher preferred RP")
1159 step("r1 : Verify prune is sent to lower preferred RP")
1160 state_after
= get_pim6_interface_traffic(tgen
, state_dict
)
1163 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
1167 result
= verify_state_incremented(state_before
, state_after
)
1168 assert result
is True, "Testcase{} : Failed Error: {}".format(tc_name
, result
)
1170 step("r1 : Verify ip mroutes")
1171 oif
= TOPO
["routers"]["r1"]["links"]["r0"]["interface"]
1172 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_3
, iif
, oif
)
1173 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1175 step("r1 : Verify PIM6 state")
1176 result
= verify_pim_state(tgen
, dut
, iif
, oif
, GROUP_ADDRESS_3
)
1177 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1179 step("r1 : Verify upstream IIF interface")
1180 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_3
)
1181 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1183 step("r1 : Verify upstream join state and join timer")
1184 result
= verify_join_state_and_timer(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_3
)
1185 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1187 clear_pim6_interface_traffic(tgen
, TOPO
)
1189 step("r1 : Verify joinTx, pruneTx count before RP gets deleted")
1192 TOPO
["routers"]["r1"]["links"]["r2"]["interface"]: ["joinTx"],
1193 TOPO
["routers"]["r1"]["links"]["r4"]["interface"]: ["pruneTx"],
1196 state_before
= get_pim6_interface_traffic(tgen
, state_dict
)
1199 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
1203 step("r1 : Delete RP configuration for {}".format(GROUP_RANGE_3
))
1209 "rp_addr": TOPO
["routers"]["r4"]["links"]["lo"]["ipv6"].split(
1212 "group_addr_range": GROUP_RANGE_3
,
1219 result
= create_pim_config(tgen
, TOPO
, input_dict
)
1220 assert result
is True, "Testcase {} : Failed Error: {}".format(tc_name
, result
)
1222 step("r1 : Verify rp-info for group {}".format(GROUP_RANGE_3
))
1223 iif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
1224 result
= verify_pim_rp_info(
1225 tgen
, TOPO
, dut
, GROUP_RANGE_3
, iif
, rp_address_1
, SOURCE
1227 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1229 step("r1 : Verify rp-info for group {}".format(GROUP_RANGE_4
))
1230 iif
= TOPO
["routers"]["r1"]["links"]["r4"]["interface"]
1231 result
= verify_pim_rp_info(
1232 tgen
, TOPO
, dut
, GROUP_RANGE_4
, oif
, rp_address_2
, SOURCE
, expected
=False
1234 assert result
is not True, (
1235 "Testcase {} : Failed \n "
1236 "r1: rp-info is present for group {} \n Error: {}".format(
1237 tc_name
, GROUP_RANGE_4
, result
1242 "r1 : Verify RPF interface updated in mroute when higher preferred"
1245 iif
= TOPO
["routers"]["r1"]["links"]["r2"]["interface"]
1246 result
= verify_mroutes(tgen
, dut
, STAR
, GROUP_ADDRESS_3
, iif
, oif
)
1247 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1248 logger
.info("Expected behavior: %s", result
)
1251 "r1 : Verify IIF and OIL in show ipv6 PIM6 state updated when higher"
1252 "preferred overlapping RP is deleted"
1254 result
= verify_pim_state(tgen
, dut
, iif
, oif
, GROUP_ADDRESS_3
)
1255 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1258 "r1 : Verify upstream IIF updated when higher preferred overlapping"
1261 result
= verify_upstream_iif(tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_3
)
1262 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1265 "r1 : Verify upstream join state and join timer updated when higher"
1266 "preferred overlapping RP deleted"
1268 result
= verify_join_state_and_timer(
1269 tgen
, dut
, iif
, STAR
, GROUP_ADDRESS_3
, addr_type
="ipv6"
1271 assert result
is True, ASSERT_MSG
.format(tc_name
, result
)
1274 "r1 : Verify join is sent to lower preferred RP, when higher"
1275 "preferred RP gets deleted"
1278 "r1 : Verify prune is sent to higher preferred RP when higher"
1279 " preferred RP gets deleted"
1281 state_after
= get_pim6_interface_traffic(tgen
, state_dict
)
1284 ), "Testcase{} : Failed \n state_before is not dictionary \n " "Error: {}".format(
1288 result
= verify_state_incremented(state_before
, state_after
)
1289 assert result
is True, "Testcase{} : Failed Error: {}".format(tc_name
, result
)
1290 write_test_footer(tc_name
)
1293 if __name__
== "__main__":
1294 args
= ["-s"] + sys
.argv
[1:]
1295 sys
.exit(pytest
.main(args
))