summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-06-04 17:48:08 -0400
committerChristian Hopps <chopps@labn.net>2023-06-05 13:53:51 -0400
commitee235c606fe796af24f33a0c7e8be320df7f9483 (patch)
tree2d3a865a864f9d74fd7c277b3cc80fba9c811a27 /tests
parent4285bdadcc0616079baf67963680ddc0a52c2c06 (diff)
tests: mgmtd: add prologue to bigconf tests
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/mgmt_startup/test_bigconf.py4
-rw-r--r--tests/topotests/mgmt_startup/test_late_bigconf.py20
-rw-r--r--tests/topotests/mgmt_startup/util.py4
3 files changed, 24 insertions, 4 deletions
diff --git a/tests/topotests/mgmt_startup/test_bigconf.py b/tests/topotests/mgmt_startup/test_bigconf.py
index 3b13229af5..4f46c8fabd 100644
--- a/tests/topotests/mgmt_startup/test_bigconf.py
+++ b/tests/topotests/mgmt_startup/test_bigconf.py
@@ -42,8 +42,10 @@ def tgen(request):
tgen = Topogen(topodef, request.module.__name__)
tgen.start_topology()
+ prologue = open(f"{CWD}/r1/mgmtd.conf").read()
+
confpath = f"{tgen.gears['r1'].gearlogdir}/r1-late-big.conf"
- start, end = write_big_route_conf("10.0.0.0/8", ROUTE_COUNT, confpath)
+ start, end = write_big_route_conf("10.0.0.0/8", ROUTE_COUNT, confpath, prologue)
ROUTE_RANGE[0] = start
ROUTE_RANGE[1] = end
diff --git a/tests/topotests/mgmt_startup/test_late_bigconf.py b/tests/topotests/mgmt_startup/test_late_bigconf.py
index 5e594aba6c..0b5bf38d10 100644
--- a/tests/topotests/mgmt_startup/test_late_bigconf.py
+++ b/tests/topotests/mgmt_startup/test_late_bigconf.py
@@ -42,8 +42,10 @@ def tgen(request):
tgen = Topogen(topodef, request.module.__name__)
tgen.start_topology()
+ prologue = open(f"{CWD}/r1/mgmtd.conf").read()
+
confpath = f"{tgen.gears['r1'].gearlogdir}/r1-late-big.conf"
- start, end = write_big_route_conf("10.0.0.0/8", ROUTE_COUNT, confpath)
+ start, end = write_big_route_conf("10.0.0.0/8", ROUTE_COUNT, confpath, prologue)
ROUTE_RANGE[0] = start
ROUTE_RANGE[1] = end
@@ -74,9 +76,23 @@ def test_staticd_latestart(tgen):
assert result is not None, "last route present and should not be"
step("Starting staticd")
+ t2 = Timeout(0)
r1.startDaemons(["staticd"])
result = check_kernel(r1, ROUTE_RANGE[0], retry_timeout=60)
assert result is None, "first route not present and should be"
- result = check_kernel(r1, ROUTE_RANGE[1], retry_timeout=60)
+ logging.info("r1: elapsed time for first route %ss", t2.elapsed())
+
+ count = 0
+ ocount = 0
+ while count < ROUTE_COUNT:
+ rc, o, e = r1.net.cmd_status("ip -o route | wc -l")
+ if not rc:
+ if count > ocount + 100:
+ ocount = count
+ logging.info("r1: elapsed time for %d routes %s", count, t2.elapsed())
+ count = int(o)
+
+ result = check_kernel(r1, ROUTE_RANGE[1], retry_timeout=1200)
assert result is None, "last route not present and should be"
+ logging.info("r1: elapsed time for last route %ss", t2.elapsed())
diff --git a/tests/topotests/mgmt_startup/util.py b/tests/topotests/mgmt_startup/util.py
index 87a2ad442e..e366351326 100644
--- a/tests/topotests/mgmt_startup/util.py
+++ b/tests/topotests/mgmt_startup/util.py
@@ -50,11 +50,13 @@ def get_ip_networks(super_prefix, count):
return tuple(network.subnets(count_log2))[0:count]
-def write_big_route_conf(super_prefix, count, confpath):
+def write_big_route_conf(super_prefix, count, confpath, prologue=""):
start = None
end = None
with open(confpath, "w+", encoding="ascii") as f:
+ if prologue:
+ f.write(prologue + "\n")
for net in get_ip_networks(super_prefix, count):
end = net
if not start: