summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-11-10 14:14:23 -0500
committerMark Stapp <mjs@voltanet.io>2020-11-10 14:14:23 -0500
commitd6a75b53e73ef932a6497deba2f7e04c682fb29a (patch)
treee667a0ea367440d4f1f4fc191b5551c7d8538074
parent3d73df359a2f64635ce2561a4b6f82326fab2447 (diff)
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 <mjs@voltanet.io>
-rw-r--r--tests/topotests/route-scale/r1/installed.routes.json8
-rw-r--r--tests/topotests/route-scale/test_route_scale.py25
2 files changed, 19 insertions, 14 deletions
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(