]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Fix for test_pim_dr_nondr_with_ospf_topo2 test failure 11214/head
authorKuldeep Kashyap <kashyapk@vmware.com>
Mon, 16 May 2022 10:28:02 +0000 (03:28 -0700)
committerKuldeep Kashyap <kashyapk@vmware.com>
Mon, 16 May 2022 10:28:02 +0000 (03:28 -0700)
This test is failing intermittently because sometimes igmp
local join is not getting deleted. I did split the joins means
trying to delete igmp local joins one by one. I tried running
tests multiple times and it seems to be working fine with
current changes.

There was an issue found during debugging this test failure,
which was raised already:
Issue# https://github.com/FRRouting/frr/issues/11105

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
tests/topotests/lib/pim.py
tests/topotests/multicast_pim_dr_nondr_test/test_pim_dr_nondr_with_ospf_topo2.py

index 47892a521875389bc66068e8a6dc27dfd3285dd3..b0889373ce8b61ff1950799627ac13a0e4c5f157 100644 (file)
@@ -273,18 +273,20 @@ def create_igmp_config(tgen, topo, input_dict=None, build=False):
                 config_data.append(cmd)
                 protocol = "igmp"
                 del_action = intf_data[intf_name]["igmp"].setdefault("delete", False)
+                del_attr = intf_data[intf_name]["igmp"].setdefault("delete_attr", False)
                 cmd = "ip igmp"
                 if del_action:
                     cmd = "no {}".format(cmd)
-                config_data.append(cmd)
+                if not del_attr:
+                    config_data.append(cmd)
 
-                del_attr = intf_data[intf_name]["igmp"].setdefault("delete_attr", False)
                 for attribute, data in intf_data[intf_name]["igmp"].items():
                     if attribute == "version":
                         cmd = "ip {} {} {}".format(protocol, attribute, data)
                         if del_action:
                             cmd = "no {}".format(cmd)
-                        config_data.append(cmd)
+                        if not del_attr:
+                            config_data.append(cmd)
 
                     if attribute == "join":
                         for group in data:
index cba37bfc29368e3d4bef9e870be7504021a5aa9f..d0422e2f723572ccd5139fe4a8a0a1f67ddcf8af 100755 (executable)
@@ -894,37 +894,37 @@ def test_configuring_igmp_local_join_on_reciever_dr_non_dr_nodes_p1(request):
         assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
 
     step("Delete local join from DR node")
-    input_dict = {
-        "r1": {
-            "igmp": {
-                "interfaces": {
-                    vlan_intf_r1_s1: {
-                        "igmp": {
-                            "version": "2",
-                            "join": IGMP_JOIN_RANGE_3,
-                            "delete_attr": True,
+    for _join in IGMP_JOIN_RANGE_3:
+        input_dict = {
+            "r1": {
+                "igmp": {
+                    "interfaces": {
+                        vlan_intf_r1_s1: {
+                            "igmp": {
+                                "join": [_join],
+                                "delete_attr": True,
+                            }
                         }
                     }
                 }
             }
         }
-    }
-
-    result = create_igmp_config(tgen, topo, input_dict)
-    assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result)
 
-    step(
-        "After removing local join 227.1.1.1 group removed from IGMP join "
-        "of R1, R2 node , using 'show ip igmp groups json'"
-    )
+        result = create_igmp_config(tgen, topo, input_dict)
+        assert result is True, "Testcase {}: Failed Error: {}".format(tc_name, result)
 
-    for dut, intf in zip(["r1", "r2"], [intf_r1_s1, intf_r2_s1]):
-        result = verify_igmp_groups(tgen, dut, intf, IGMP_JOIN_RANGE_3, expected=False)
-        assert result is not True, (
-            "Testcase {} : Failed \n "
-            "IGMP groups are still present \n Error: {}".format(tc_name, result)
+        step(
+            "After removing local join 227.1.1.1 group removed from IGMP join "
+            "of R1, R2 node , using 'show ip igmp groups json'"
         )
 
+        for dut, intf in zip(["r1", "r2"], [intf_r1_s1, intf_r2_s1]):
+            result = verify_igmp_groups(tgen, dut, intf, IGMP_JOIN_RANGE_3, expected=False)
+            assert result is not True, (
+                "Testcase {} : Failed \n "
+                "IGMP groups are still present \n Error: {}".format(tc_name, result)
+            )
+
     step("(*,G) mroute for 227.1.1.1 group removed from R1 node")
     step(
         "After remove of local join from R1 and R2 node verify (*,G) and (S,G) "