]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Fix multicast_pim_bsm_topo2 static route issue
authorKuldeep Kashyap <kashyapk@vmware.com>
Thu, 7 Jul 2022 21:44:28 +0000 (14:44 -0700)
committerKuldeep Kashyap <kashyapk@vmware.com>
Mon, 11 Jul 2022 05:18:50 +0000 (22:18 -0700)
API to verify static route was checking whether
router is installed with expected nexthop. In
this particular scenario we has same route as
Connected and Static both. In heavy loaded
system static routes was taking time to get
installed and API was doing the verification
on Connected route instead Static route.
Enhanced scripts to check only static routes.

Issue: https://github.com/FRRouting/frr/issues/11563

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py
tests/topotests/multicast_pim_bsm_topo2/test_mcast_pim_bsmp_02.py

index 4610c5f15ae235bfeebdfa0327a52c7ec588d766..bcf8e5b5f3e0b03756213288d977294c3032c696 100644 (file)
@@ -304,7 +304,6 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
 
         # Add static routes
         input_dict = {
-            fhr: {"static_routes": [{"network": bsr_route, "next_hop": next_hop}]},
             rp: {"static_routes": [{"network": bsr_route, "next_hop": next_hop_rp}]},
             lhr: {"static_routes": [{"network": bsr_route, "next_hop": next_hop_lhr}]},
         }
@@ -313,9 +312,11 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        for dut, _nexthop in zip([fhr, rp, lhr], [next_hop, next_hop_rp, next_hop_lhr]):
+        for dut, _nexthop in zip([rp, lhr], [next_hop_rp, next_hop_lhr]):
             input_routes = {dut: input_dict[dut]}
-            result = verify_rib(tgen, "ipv4", dut, input_routes, _nexthop)
+            result = verify_rib(
+                tgen, "ipv4", dut, input_routes, _nexthop, protocol="static"
+            )
             assert result is True, "Testcase {} : Failed \n Error {}".format(
                 tc_name, result
             )
@@ -343,7 +344,9 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        result = verify_rib(tgen, "ipv4", fhr, input_dict, next_hop_fhr)
+        result = verify_rib(
+            tgen, "ipv4", fhr, input_dict, next_hop_fhr, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -355,7 +358,9 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        result = verify_rib(tgen, "ipv4", lhr, input_dict, next_hop_lhr)
+        result = verify_rib(
+            tgen, "ipv4", lhr, input_dict, next_hop_lhr, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -473,7 +478,9 @@ def test_BSR_higher_prefer_ip_p0(request):
     # Verifying static routes are installed
     for dut, _nexthop in zip(["i1", "l1"], [next_hop_rp, next_hop_lhr]):
         input_routes = {dut: input_dict[dut]}
-        result = verify_rib(tgen, "ipv4", dut, input_routes, _nexthop)
+        result = verify_rib(
+            tgen, "ipv4", dut, input_routes, _nexthop, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -482,7 +489,9 @@ def test_BSR_higher_prefer_ip_p0(request):
         input_routes = {
             "f1": {"static_routes": [{"network": bsr_add, "next_hop": next_hop}]}
         }
-        result = verify_rib(tgen, "ipv4", "f1", input_routes, next_hop)
+        result = verify_rib(
+            tgen, "ipv4", "f1", input_routes, next_hop, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -673,7 +682,9 @@ def test_BSR_CRP_with_blackhole_address_p1(request):
     # Verifying static routes are installed
     for dut, _nexthop in zip(["i1", "l1"], [next_hop_rp, next_hop_lhr]):
         input_routes = {dut: input_dict[dut]}
-        result = verify_rib(tgen, "ipv4", dut, input_routes, _nexthop)
+        result = verify_rib(
+            tgen, "ipv4", dut, input_routes, _nexthop, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -681,7 +692,9 @@ def test_BSR_CRP_with_blackhole_address_p1(request):
     input_routes = {
         "f1": {"static_routes": [{"network": CRP, "next_hop": next_hop_fhr}]}
     }
-    result = verify_rib(tgen, "ipv4", "f1", input_routes, expected=False)
+    result = verify_rib(
+        tgen, "ipv4", "f1", input_routes, protocol="static", expected=False
+    )
     assert (
         result is not True
     ), "Testcase {} : Failed \n " "Route is still present \n Error {}".format(
@@ -705,7 +718,7 @@ def test_BSR_CRP_with_blackhole_address_p1(request):
     assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
     # Verifying static routes are installed
-    result = verify_rib(tgen, "ipv4", "f1", input_dict)
+    result = verify_rib(tgen, "ipv4", "f1", input_dict, protocol="static")
     assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
 
     intf_f1_i1 = topo["routers"]["f1"]["links"]["i1"]["interface"]
@@ -764,7 +777,7 @@ def test_BSR_CRP_with_blackhole_address_p1(request):
     input_dict = {
         "f1": {"static_routes": [{"network": BSR1_ADDR, "next_hop": NEXT_HOP1}]}
     }
-    result = verify_rib(tgen, "ipv4", "f1", input_dict, NEXT_HOP1)
+    result = verify_rib(tgen, "ipv4", "f1", input_dict, NEXT_HOP1, protocol="static")
     assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
 
     input_dict = {
@@ -774,7 +787,9 @@ def test_BSR_CRP_with_blackhole_address_p1(request):
             ]
         }
     }
-    result = verify_rib(tgen, "ipv4", "f1", input_dict, expected=False)
+    result = verify_rib(
+        tgen, "ipv4", "f1", input_dict, protocol="static", expected=False
+    )
     assert result is not True, (
         "Testcase {} : Failed \n "
         "Routes:[{}, {}] are still present \n Error {}".format(
@@ -1703,7 +1718,9 @@ def test_iif_join_state_p0(request):
     assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
     # Verifying static routes are installed
-    result = verify_rib(tgen, "ipv4", "l1", input_dict, expected=False)
+    result = verify_rib(
+        tgen, "ipv4", "l1", input_dict, protocol="static", expected=False
+    )
     assert (
         result is not True
     ), "Testcase {} : Failed \n " "Routes:{} are still present \n Error {}".format(
@@ -1751,7 +1768,7 @@ def test_iif_join_state_p0(request):
     assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
     # Verifying static routes are installed
-    result = verify_rib(tgen, "ipv4", "l1", input_dict, next_hop_lhr)
+    result = verify_rib(tgen, "ipv4", "l1", input_dict, next_hop_lhr, protocol="static")
     assert result is True, "Testcase {}:Failed \n Error: {}".format(tc_name, result)
 
     # Verify that (*,G) installed in mroute again
index 191615cbbe044a48a6e9ee785227a4a2ec28f2ec..8a4ef1d9c70592d7be0c754ab7025a3a9bbcc79e 100644 (file)
@@ -245,7 +245,6 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
 
         # Add static routes
         input_dict = {
-            fhr: {"static_routes": [{"network": bsr_route, "next_hop": next_hop}]},
             rp: {"static_routes": [{"network": bsr_route, "next_hop": next_hop_rp}]},
             lhr: {"static_routes": [{"network": bsr_route, "next_hop": next_hop_lhr}]},
         }
@@ -254,9 +253,11 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        for dut, _nexthop in zip([fhr, rp, lhr], [next_hop, next_hop_rp, next_hop_lhr]):
+        for dut, _nexthop in zip([rp, lhr], [next_hop_rp, next_hop_lhr]):
             input_routes = {dut: input_dict[dut]}
-            result = verify_rib(tgen, "ipv4", dut, input_routes, _nexthop)
+            result = verify_rib(
+                tgen, "ipv4", dut, input_routes, _nexthop, protocol="static"
+            )
             assert result is True, "Testcase {} : Failed \n Error {}".format(
                 tc_name, result
             )
@@ -300,7 +301,9 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        result = verify_rib(tgen, "ipv4", fhr, input_dict, next_hop_fhr)
+        result = verify_rib(
+            tgen, "ipv4", fhr, input_dict, next_hop_fhr, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )
@@ -312,7 +315,9 @@ def pre_config_to_bsm(tgen, topo, tc_name, bsr, sender, receiver, fhr, rp, lhr,
         assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
 
         # Verifying static routes are installed
-        result = verify_rib(tgen, "ipv4", lhr, input_dict, next_hop_lhr)
+        result = verify_rib(
+            tgen, "ipv4", lhr, input_dict, next_hop_lhr, protocol="static"
+        )
         assert result is True, "Testcase {} : Failed \n Error {}".format(
             tc_name, result
         )