From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 1/3] auto-t: make test timeout configurable
Date: Mon, 13 Nov 2023 06:32:53 -0800 [thread overview]
Message-ID: <20231113143255.278191-1-prestwoj@gmail.com> (raw)
With the addition of DPP PKEX autotests some of the timeouts are
quite long and hit test-runners maximum timeouts. For UML we should
allow this since time-travel lets us skip idle waits. Move the test
timeout out of a global define and into the argument list so QEMU
and UML can define it differently.
---
tools/run-tests | 12 +++++-------
tools/runner.py | 7 +++++++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/tools/run-tests b/tools/run-tests
index 32c09723..11ad73c0 100755
--- a/tools/run-tests
+++ b/tools/run-tests
@@ -27,8 +27,6 @@ from utils import Process, Namespace, BarChart
config = None
intf_id = 0
-TEST_MAX_TIMEOUT = 240
-
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
def dbg(*s, **kwargs):
@@ -52,7 +50,7 @@ def exit_vm():
p.kill()
if config.ctx and config.ctx.results:
- success = print_results(config.ctx.results)
+ success = print_results(config.ctx.results, int(config.ctx.args.timeout))
if config.ctx.args.result:
write_results(config.ctx.args.result, config.ctx.results)
@@ -917,7 +915,7 @@ def post_test(ctx, to_copy):
except:
pass
-def print_results(results):
+def print_results(results, max_timeout):
table = PrettyTable(['Test', colored('Passed', 'green'), colored('Failed', 'red'), \
colored('Skipped', 'cyan'), colored('Time', 'yellow')])
@@ -928,7 +926,7 @@ def print_results(results):
for test, result in results.items():
- if result.time == TEST_MAX_TIMEOUT:
+ if result.time == max_timeout:
failed = "Timed out"
passed = "Timed out"
elif result.time == 0:
@@ -975,7 +973,7 @@ def run_auto_tests(ctx, args):
p.start()
# Rather than time each subtest we just time the total but
# mutiply the default time by the number of tests being run.
- p.join(TEST_MAX_TIMEOUT * len(subtests))
+ p.join(int(args.timeout) * len(subtests))
if p.is_alive():
# Timeout
@@ -983,7 +981,7 @@ def run_auto_tests(ctx, args):
ctx.results[os.path.basename(test)] = SimpleResult(run=0,
failures=0, errors=0,
- skipped=0, time=TEST_MAX_TIMEOUT)
+ skipped=0, time=int(args.timeout))
else:
ctx.results[os.path.basename(test)] = rqueue.get()
diff --git a/tools/runner.py b/tools/runner.py
index 004bf46d..03f44611 100644
--- a/tools/runner.py
+++ b/tools/runner.py
@@ -120,9 +120,12 @@ class RunnerCoreArgParse(ArgumentParser):
const=True,
action='store',
help='Use physical adapters for tests (passthrough)')
+
+ # Hidden options only meant to be passed to the kernel
self.add_argument('--testhome', help=SUPPRESS)
self.add_argument('--monitor-parent', help=SUPPRESS)
self.add_argument('--result-parent', help=SUPPRESS)
+ self.add_argument('--timeout', help=SUPPRESS)
# Prevent --autotest/--unittest from being used together
auto_unit_group = self.add_mutually_exclusive_group()
@@ -385,6 +388,8 @@ class QemuRunner(RunnerAbstract):
self._prepare_outfiles()
+ self.args.timeout = 240
+
if args.hw:
if os.path.isfile(args.hw):
hw_conf = ConfigParser()
@@ -543,6 +548,8 @@ class UmlRunner(RunnerAbstract):
self._prepare_outfiles()
+ self.args.timeout = 1000
+
kern_log = "ignore_loglevel" if "kernel" in args.verbose else "quiet"
cmd = [args.kernel, 'rootfstype=hostfs', 'ro', 'mem=256M', 'mac80211_hwsim.radios=0',
--
2.25.1
next reply other threads:[~2023-11-13 14:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 14:32 James Prestwood [this message]
2023-11-13 14:32 ` [PATCH 2/3] auto-t: add stop APIs and fix some issues wpas.py James Prestwood
2023-11-13 14:32 ` [PATCH 3/3] auto-t: get DPP PKEX test running reliably James Prestwood
2023-11-13 15:48 ` [PATCH 1/3] auto-t: make test timeout configurable Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231113143255.278191-1-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).