Re: [PATCH RFC] fstests: allow running custom hooks
From: Eryu Guan <hidden>
Date: 2021-07-20 04:06:10
Also in:
fstests
On Mon, Jul 19, 2021 at 10:02:14AM -0400, Theodore Y. Ts'o wrote:
On Mon, Jul 19, 2021 at 03:13:37PM +0800, Qu Wenruo wrote:quoted
This patch will allow fstests to run custom hooks before and after each test case.Nice! This is better than what I had been doing which was to set: export LOGGER_PROG=/usr/local/lib/gce-logger ... and then parse the passed message to be logged for "run xfstests $seqnum", and which only worked to hook the start of each test.quoted
diff --git a/README.hooks b/README.hooks new file mode 100644 index 00000000..be92a7d7 --- /dev/null +++ b/README.hooks@@ -0,0 +1,72 @@ +To run extra commands before and after each test case, there is the +'hooks/start.hook' and 'hooks/end.hook' files for such usage. + +Some notes for those two hooks: + +- Both hook files needs to be executable + Or they will just be ignoredMinor nit: I'd reword this as: - The hook script must be executable or it will be ignored.quoted
diff --git a/check b/check index bb7e030c..f24906f5 100755 --- a/check +++ b/check@@ -846,6 +846,10 @@ function run_section() # to be reported for each test (echo 1 > $DEBUGFS_MNT/clear_warn_once) > /dev/null 2>&1 + # Remove previous $seqres.full before start hook + rm -f $seqres.full + + _run_start_hookI wonder if it would be useful to have the start hook have a way to signal that a particular test should be skipped. This might allow for various programatic tests that could be inserted by the test runner framework.
I have the same question as Darrick does, we now have the exclude list infra to skip a given set of tests, does that work in your case? Why do you need pre hook to skip a test? Thanks, Eryu
(E.g., this is the 5.4 kernel, we know this test is guaranteed to fail, so tell check to skip the test) - Ted