]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Check if RIP `allow-ecmp` command can inject specified number of routes
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 4 May 2023 06:02:42 +0000 (09:02 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 4 May 2023 06:02:42 +0000 (09:02 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
tests/topotests/rip_allow_ecmp/r4/frr.conf [new file with mode: 0644]
tests/topotests/rip_allow_ecmp/r5/frr.conf [new file with mode: 0644]
tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py

diff --git a/tests/topotests/rip_allow_ecmp/r4/frr.conf b/tests/topotests/rip_allow_ecmp/r4/frr.conf
new file mode 100644 (file)
index 0000000..995c2be
--- /dev/null
@@ -0,0 +1,13 @@
+!
+int lo
+ ip address 10.10.10.1/32
+!
+int r4-eth0
+ ip address 192.168.1.4/24
+!
+router rip
+ network 192.168.1.0/24
+ network 10.10.10.1/32
+ timers basic 5 15 10
+exit
+
diff --git a/tests/topotests/rip_allow_ecmp/r5/frr.conf b/tests/topotests/rip_allow_ecmp/r5/frr.conf
new file mode 100644 (file)
index 0000000..57a06ec
--- /dev/null
@@ -0,0 +1,13 @@
+!
+int lo
+ ip address 10.10.10.1/32
+!
+int r5-eth0
+ ip address 192.168.1.5/24
+!
+router rip
+ network 192.168.1.0/24
+ network 10.10.10.1/32
+ timers basic 5 15 10
+exit
+
index acc0aea9e894bebc92baf27c0ff4082b91c60268..c965c8748140aef18e5df015a04c957d5b4ff253 100644 (file)
@@ -21,12 +21,13 @@ sys.path.append(os.path.join(CWD, "../"))
 # pylint: disable=C0413
 from lib import topotest
 from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.common_config import step
 
 pytestmark = [pytest.mark.ripd]
 
 
 def setup_module(mod):
-    topodef = {"s1": ("r1", "r2", "r3")}
+    topodef = {"s1": ("r1", "r2", "r3", "r4", "r5")}
     tgen = Topogen(topodef, mod.__name__)
     tgen.start_topology()
 
@@ -126,6 +127,23 @@ def test_rip_allow_ecmp():
     _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "Can't see 10.10.10.1/32 as multipath in `show ip route`"
 
+    step(
+        "Configure allow-ecmp 2, ECMP group routes SHOULD have next-hops with the lowest IPs"
+    )
+    r1.vtysh_cmd(
+        """
+    configure terminal
+        router rip
+            allow-ecmp 2
+    """
+    )
+
+    test_func = functools.partial(_show_rip_routes)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
+    assert (
+        result is None
+    ), "Can't see 10.10.10.1/32 as ECMP with the lowest next-hop IPs"
+
 
 if __name__ == "__main__":
     args = ["-s"] + sys.argv[1:]