From: Zorro Lang <zlang@kernel.org>
To: fstests@vger.kernel.org
Cc: Andrey Albershteyn <aalbersh@redhat.com>,
cem@kernel.org, Dave Chinner <david@fromorbit.com>,
linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org,
linux-ext4@vger.kernel.org
Subject: [PATCH 0/6] Add test hook infrastructure
Date: Thu, 26 Nov 2026 05:28:17 +0800 [thread overview]
Message-ID: <20261125212823.3389430-1-zlang@kernel.org> (raw)
Hi all,
This series adds test hook support to fstests, allowing users to
customize a test run (e.g., collecting traces, capturing extra debug
data, or reporting results to an external framework) without modifying
fstests itself. It is inspired by Dave Chinner's earlier hook
infrastructure RFC [1] and also addresses the use cases from a recent
fstests mailing list discussion [2], supporting both in-process and
out-of-process hooks as well as a post-result event.
Hooks are registered on the command line via --hook-pre-test, --hook-post-test,
and --hook-post-result:
--hook-<event> path=/path/to/hook[,mode=in|out][,match=<glob>]...
Options can be repeated and hooks run in the order given. Optional
match=<glob> patterns restrict a hook to matching test names; without
them, the hook runs for every test.
Two execution modes are supported:
- mode=in (default): a bash script defining hook_execute(), sourced
in a subshell with full access to the test environment and fstests
helpers.
- mode=out: a standalone executable written in any language, invoked
via env(1) with the test variables in HOOK_ENV_LIST and the hook
context.
All hook output is appended to $seqres.hooks, and hook failures are
logged there without affecting the test result.
Series overview:
- Patch 1 adds the core hook infrastructure (mode=in) in common/hooks.
- Patch 2 adds out-of-process hook support (mode=out).
- Patches 3-5 wire up the pre-test, post-test, and post-result events
and CLI options in check.
- Patch 6 adds README.hooks documenting usage and examples.
[1] https://lore.kernel.org/all/20210722064725.3077558-1-david@fromorbit.com/
[2] https://lore.kernel.org/fstests/20261119123910.294544-1-cem@kernel.org/
Feedback and reviews are welcome.
Thanks,
Zorro
Dave Chinner (1):
common: add builtin test hook infrastructure
Zorro Lang (5):
common: add out-of-process hook mode
check: introduce pre-test hook and CLI option
check: introduce post-test hook and CLI option
check: introduce post-result hook and CLI option
doc: document the test hooks
README.hooks | 156 ++++++++++++++++++++++++++++++++++
check | 30 ++++++-
common/hooks | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 414 insertions(+), 2 deletions(-)
create mode 100644 README.hooks
create mode 100644 common/hooks
--
2.56.0
next reply other threads:[~2026-11-25 21:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 21:28 Zorro Lang [this message]
2026-11-25 21:28 ` [PATCH 1/6] common: add builtin test hook infrastructure Zorro Lang
2026-11-25 21:28 ` [PATCH 2/6] common: add out-of-process hook mode Zorro Lang
2026-11-25 21:28 ` [PATCH 3/6] check: introduce pre-test hook and CLI option Zorro Lang
2026-11-25 21:28 ` [PATCH 4/6] check: introduce post-test " Zorro Lang
2026-11-25 21:28 ` [PATCH 5/6] check: introduce post-result " Zorro Lang
2026-11-25 21:28 ` [PATCH 6/6] doc: document the test hooks Zorro Lang
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=20261125212823.3389430-1-zlang@kernel.org \
--to=zlang@kernel.org \
--cc=aalbersh@redhat.com \
--cc=cem@kernel.org \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.