Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] Add test hook infrastructure
@ 2026-11-25 21:28 Zorro Lang
  2026-11-25 21:28 ` [PATCH 1/6] common: add builtin " Zorro Lang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Zorro Lang @ 2026-11-25 21:28 UTC (permalink / raw)
  To: fstests
  Cc: Andrey Albershteyn, cem, Dave Chinner, linux-xfs, linux-btrfs,
	linux-ext4

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-25 21:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 21:28 [PATCH 0/6] Add test hook infrastructure Zorro Lang
2026-11-25 21:28 ` [PATCH 1/6] common: add builtin " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox