]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Optimize test_multicast_pim_sm_topo1.py 9600/head
authorKuldeep Kashyap <kashyapk@vmware.com>
Sun, 12 Sep 2021 11:04:09 +0000 (16:34 +0530)
committerKuldeep Kashyap <kashyapk@vmware.com>
Sun, 12 Sep 2021 11:04:09 +0000 (16:34 +0530)
1. Optimized test: test_clear_pim_neighbors_and_mroute_p0 run time by clearing
mroute and verifying mroutes separately. Execution time is reduced from almots 10 mins
to ~220 sec.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
tests/topotests/multicast_pim_sm_topo1/test_multicast_pim_sm_topo1.py

index 3e14ab7164b5bfe9669b40df3566450929fc6371..dc14bc646876c85f4ec16cd8e83fcdeae013ddd9 100755 (executable)
@@ -90,7 +90,6 @@ from lib.pim import (
     clear_ip_mroute,
     clear_ip_pim_interface_traffic,
     verify_igmp_config,
-    clear_ip_mroute_verify,
     McastTesterHelper,
 )
 from lib.topolog import logger
@@ -549,21 +548,30 @@ def test_clear_pim_neighbors_and_mroute_p0(request):
     result = app_helper.run_traffic("i2", IGMP_JOIN_RANGE_1, "f1")
     assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
 
-    step("Clear the mroute on l1, wait for 5 sec")
-    result = clear_ip_mroute_verify(tgen, "l1")
-    assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result)
-
     step(
-        "After clear ip mroute (*,g) entries are re-populated again"
-        " with same OIL and IIF, verify using 'show ip mroute' and "
-        " 'show ip pim upstream' "
+        "Verify clear ip mroute (*,g) entries are populated by using "
+        "'show ip mroute' cli"
     )
 
-    source = topo["routers"]["i2"]["links"]["f1"]["ipv4"].split("/")[0]
     input_dict = [
         {"dut": "l1", "src_address": "*", "iif": "l1-c1-eth0", "oil": "l1-i1-eth1"}
     ]
 
+    for data in input_dict:
+        result = verify_ip_mroutes(
+            tgen, data["dut"], data["src_address"], IGMP_JOIN, data["iif"], data["oil"]
+        )
+        assert result is True, "Testcase{} : Failed Error: {}".format(tc_name, result)
+
+    step("Clear mroutes on l1")
+    clear_ip_mroute(tgen, "l1")
+
+    step(
+        "After clear ip mroute (*,g) entries are re-populated again"
+        " with same OIL and IIF, verify using 'show ip mroute' and "
+        " 'show ip pim upstream' "
+    )
+
     for data in input_dict:
         result = verify_ip_mroutes(
             tgen, data["dut"], data["src_address"], IGMP_JOIN, data["iif"], data["oil"]