#!/usr/bin/env python
+# SPDX-License-Identifier: ISC
#
# Copyright (c) 2020 by VMware, Inc. ("VMware")
# Used Copyright (c) 2018 by Network Device Education Foundation,
# Inc. ("NetDEF") in this file.
#
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
"""
Following tests are covered to test multicast pim sm:
from lib.pim import (
create_pim_config,
create_igmp_config,
- verify_ip_mroutes,
- clear_ip_mroute,
- clear_ip_pim_interface_traffic,
+ verify_mroutes,
+ clear_mroute,
+ clear_pim_interface_traffic,
verify_pim_config,
verify_upstream_iif,
verify_multicast_flag_state,
topo = tgen.json_topo
# ... and here it calls Mininet initialization functions.
- # get list of daemons needs to be started for this suite.
- daemons = topo_daemons(tgen, tgen.json_topo)
-
# Starting topology, create tmp files which are loaded to routers
# to start deamons and then start routers
- start_topology(tgen, daemons)
+ start_topology(tgen)
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
)
logger.info("=" * 40)
+
#####################################################
#
# Local APIs
# Creating configuration from JSON
app_helper.stop_all_hosts()
- clear_ip_mroute(tgen)
+ clear_mroute(tgen)
check_router_status(tgen)
reset_config_on_routers(tgen)
- clear_ip_pim_interface_traffic(tgen, topo)
+ clear_pim_interface_traffic(tgen, topo)
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
step(
- "R2 is transit router for R3 to reach R4, mroute should have (s, g) mroute with "
+ "R2 is transit router for I1 to reach R4, mroute should have (s, g) mroute with "
"OIL towards R4, using 'show ip mroute json'"
)
step(
]
for data in input_dict_r1_r2:
- result = verify_ip_mroutes(
+ result = verify_mroutes(
tgen,
data["dut"],
data["src_address"],
step("Reboot R3 node")
stop_router(tgen, "r3")
- step("After reboot of R3 verify R1 became DR, using 'show ip pim interface json'")
+ step(
+ "After reboot of R3 verify R1 continues to be DR, using 'show ip pim interface json'"
+ )
result = verify_pim_config(tgen, input_dict_dr)
assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
step("R1 has mroute with none OIL and upstream with Not Join")
for data in input_dict_r1_r2:
- result = verify_ip_mroutes(
+ result = verify_mroutes(
tgen,
data["dut"],
data["src_address"],
step("Reboot R2 node")
stop_router(tgen, "r2")
- step("After reboot of R2, R1 became DR verify using 'show ip pim interface json'")
+ step(
+ "After reboot of R2, R1 continues to be DR verify using 'show ip pim interface json'"
+ )
result = verify_pim_config(tgen, input_dict_dr)
assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
"R3 and R2 should not have any mroute and upstream , verify using "
"'show ip mroute json' 'show ip pim upstream json'"
)
- step("R1 has mroute created with OIL towards R4 , using 'show ip mroute json'")
+ step("R1 has mroute created with empty OIL, using 'show ip mroute json'")
step(
- "R1 has upstream with Join Rej Prune , verify using 'show ip pim upstream json'"
+ "R1 has upstream with Not Join, Rej Prune , verify using 'show ip pim upstream json'"
)
for data in input_dict_r1_r2:
if data["dut"] == "r1":
- result = verify_ip_mroutes(
+ result = verify_mroutes(
tgen,
data["dut"],
data["src_address"],
)
for data in input_dict_r1_r2:
- result = verify_ip_mroutes(
+ result = verify_mroutes(
tgen,
data["dut"],
data["src_address"],
data["oil"],
expected=False,
)
- assert result is not True, (
- "Testcase {} : Failed \n "
- "mroutes are still present \n Error: {}".format(tc_name, result)
+ assert (
+ result is not True
+ ), "Testcase {} : Failed \n " "mroutes are still present \n Error: {}".format(
+ tc_name, result
)
step("start FRR for all the nodes")
assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
for data in input_dict_r1_r2:
- result = verify_ip_mroutes(
+ result = verify_mroutes(
tgen,
data["dut"],
data["src_address"],