]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/multicast_pim_dr_nondr_test/test_pim_dr_nondr_with_static_routes_topo1.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / multicast_pim_dr_nondr_test / test_pim_dr_nondr_with_static_routes_topo1.py
index aa7448f3540cb5dcc107615fdb1055ccde02d8ab..7c509cd0917dd9be0dc278365bc221e4364e4b56 100755 (executable)
@@ -1,24 +1,11 @@
 #!/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:
@@ -67,9 +54,9 @@ from lib.common_config import (
 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,
@@ -180,12 +167,9 @@ def setup_module(mod):
     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():
@@ -218,6 +202,7 @@ def teardown_module():
     )
     logger.info("=" * 40)
 
+
 #####################################################
 #
 #   Local APIs
@@ -693,10 +678,10 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
 
     # 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():
@@ -719,7 +704,7 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     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(
@@ -752,7 +737,7 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     ]
 
     for data in input_dict_r1_r2:
-        result = verify_ip_mroutes(
+        result = verify_mroutes(
             tgen,
             data["dut"],
             data["src_address"],
@@ -786,7 +771,9 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     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)
@@ -799,7 +786,7 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     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"],
@@ -833,7 +820,9 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     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)
@@ -842,14 +831,14 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
         "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"],
@@ -883,7 +872,7 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     )
 
     for data in input_dict_r1_r2:
-        result = verify_ip_mroutes(
+        result = verify_mroutes(
             tgen,
             data["dut"],
             data["src_address"],
@@ -892,9 +881,10 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
             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")
@@ -908,7 +898,7 @@ def test_pim_source_dr_functionality_while_rebooting_dr_non_dr_nodes_p1(request)
     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"],