From: Mark Stapp Date: Tue, 10 Nov 2020 19:14:23 +0000 (-0500) Subject: tests: reduce scale of the route scale test X-Git-Tag: base_7.6~294^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F7500%2Fhead;p=mirror%2Ffrr.git tests: reduce scale of the route scale test 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 --- diff --git a/tests/topotests/route-scale/r1/installed.routes.json b/tests/topotests/route-scale/r1/installed.routes.json index 25d209f9eb..24a45dca81 100644 --- a/tests/topotests/route-scale/r1/installed.routes.json +++ b/tests/topotests/route-scale/r1/installed.routes.json @@ -6,11 +6,11 @@ "type":"connected" }, { - "fib":1000000, - "rib":1000000, + "fib":200000, + "rib":200000, "type":"sharp" } ], - "routesTotal":1000032, - "routesTotalFib":1000032 + "routesTotal":200032, + "routesTotalFib":200032 } diff --git a/tests/topotests/route-scale/test_route_scale.py b/tests/topotests/route-scale/test_route_scale.py index 8aedfc198c..bbd6ef8d60 100644 --- a/tests/topotests/route-scale/test_route_scale.py +++ b/tests/topotests/route-scale/test_route_scale.py @@ -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(