]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: reduce scale of the route scale test 7500/head
authorMark Stapp <mjs@voltanet.io>
Tue, 10 Nov 2020 19:14:23 +0000 (14:14 -0500)
committerMark Stapp <mjs@voltanet.io>
Tue, 10 Nov 2020 19:14:23 +0000 (14:14 -0500)
Reduce the number of routes used in the route-scale test: we're
having memory troubles, and this may help the CI run with fewer
false failures. Also re-orged the route-scale test code a bit
so it can be driven from the json file, with fewer hard-coded
values.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
tests/topotests/route-scale/r1/installed.routes.json
tests/topotests/route-scale/test_route_scale.py

index 25d209f9eb4ee5a1c4815b1a2118fbb098af9cbb..24a45dca81b39461aa98f008f7c19d9421a50d32 100644 (file)
@@ -6,11 +6,11 @@
       "type":"connected"
     },
     {
-      "fib":1000000,
-      "rib":1000000,
+      "fib":200000,
+      "rib":200000,
       "type":"sharp"
     }
   ],
-  "routesTotal":1000032,
-  "routesTotalFib":1000032
+  "routesTotal":200032,
+  "routesTotalFib":200032
 }
index 8aedfc198cdda3c0ee72bc28d1ecc02d8613edc6..bbd6ef8d60093cd010a46ca69f2411a3a1c5b51e 100644 (file)
@@ -122,15 +122,20 @@ def run_one_setup(r1, s):
     expected_installed = s["expect_in"]
     expected_removed = s["expect_rem"]
 
-    count = s["count"]
+    retries = s["retries"]
     wait = s["wait"]
 
-    logger.info("Testing 1 million routes X {} ecmp".format(s["ecmp"]))
+    for d in expected_installed["routes"]:
+        if d["type"] == "sharp":
+            count = d["rib"]
+            break
+
+    logger.info("Testing {} routes X {} ecmp".format(count, s["ecmp"]))
 
     r1.vtysh_cmd(
         "sharp install route 1.0.0.0 \
-                  nexthop-group {} 1000000".format(
-            s["nhg"]
+                  nexthop-group {} {}".format(
+            s["nhg"], count
         ),
         isjson=False,
     )
@@ -138,21 +143,21 @@ def run_one_setup(r1, s):
     test_func = partial(
         topotest.router_json_cmp, r1, "show ip route summary json", expected_installed
     )
-    success, result = topotest.run_and_expect(test_func, None, count, wait)
+    success, result = topotest.run_and_expect(test_func, None, retries, wait)
     assert success, "Route scale test install failed:\n{}".format(result)
 
     output = r1.vtysh_cmd("sharp data route", isjson=False)
-    logger.info("1 million routes X {} ecmp installed".format(s["ecmp"]))
+    logger.info("{} routes X {} ecmp installed".format(count, s["ecmp"]))
     logger.info(output)
-    r1.vtysh_cmd("sharp remove route 1.0.0.0 1000000", isjson=False)
+    r1.vtysh_cmd("sharp remove route 1.0.0.0 {}".format(count), isjson=False)
     test_func = partial(
         topotest.router_json_cmp, r1, "show ip route summary json", expected_removed
     )
-    success, result = topotest.run_and_expect(test_func, None, count, wait)
+    success, result = topotest.run_and_expect(test_func, None, retries, wait)
     assert success, "Route scale test remove failed:\n{}".format(result)
 
     output = r1.vtysh_cmd("sharp data route", isjson=False)
-    logger.info("1 million routes x {} ecmp removed".format(s["ecmp"]))
+    logger.info("{} routes x {} ecmp removed".format(count, s["ecmp"]))
     logger.info(output)
 
 
@@ -174,7 +179,7 @@ def test_route_install():
 
     # dict keys of params: ecmp number, corresponding nhg name, timeout,
     # number of times to wait
-    scale_keys = ["ecmp", "nhg", "wait", "count", "expect_in", "expect_rem"]
+    scale_keys = ["ecmp", "nhg", "wait", "retries", "expect_in", "expect_rem"]
 
     # Table of defaults, used for timeout values and 'expected' objects
     scale_defaults = dict(