Re: [PATCH RFC] fstests: allow running custom hooks

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Mon, Jul 19, 2021 at 03:13:37PM +0800, Qu Wenruo wrote:
> 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.

> 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 ignored

Minor nit: I'd reword this as:

- The hook script must be executable or it
  will be ignored.

> 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_hook

I 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.

(E.g., this is the 5.4 kernel, we know this test is guaranteed to
fail, so tell check to skip the test)

	      	      	       	    	- Ted




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux