This is a completely rewritten version of what I proposed some time ago. TLDR summary at first: - Allows to separate preparation of the environment (full fs, damaged fs, lots of files...) from a test itself. So multiple tests can be run in exactly the same conditions... - ... and a single test can be run in multiple environments. - It do not affects existing tests. - Two environments and tests to demonstrate its function. Long version: the goal of this patch set is to allow a single test to be run in different sitations, for example on empty filesystem, full fs, or damaged fs. it provides an interface for scripts that can prepare the requested environment and takes care of starting the test for each one. The changes in existing infrastructure are small. Most of the code is a new functionality which has to be invoked by a user or a test. How it works: Most of the it is done in the test itself: The test sets "$ENV_NAME" variable and calls "_environment_require $TEST_DIR". Where and when the test do this is in hands of its author. When using the ./new script for creating a skeleton, everything is prepared, so the author only lists desired environments. The test skeleton already contains code for for iterating over the environments and running each of them. Of course, if only one environment is given, then the test will run only once as before. Changes in ./check script are for allowing the user to somehow limit which environments are used through two new options: -ex and -eo, for exclude/include some environments. However, this only affects the tests that comply with it. So it won't select what tests to run or not. It only exports the limited list to a test, which is then free to do whatever it want. (The autogenerated skeleton is modified w.r.t. this.) Already existing tests are not affected by this new functionality at all. Also, this gives the author of a test the control over when and how the environments should be called. But if he does not wish to be bothered with it at all, he can ignore it. The change from what was before is small, only few more lines around "put your code here". Unlike in my previous patch set, I decided to not implement some persistency between different tests using the same environment. With the current code, it is possible to achieve it in the tests itself. To show how it works, I modified two performance tests (an important motivation for these patches) to work with the new environment functionality. I hope this version is in better shape. :-) Cheers, Jan Jan Ťulák (7): fstests: environments - add support for environments into the check script fstests: environments - new functions in common/rc for environment support fstests: environments - add option for skipping output diff from a test fstests: environments - add performance tests (as example of usage) fstests: environments - create the environment directory fstests: environments - add envs to the skeleton in ./new script and README fstests: environments - enable performance tests in ./check README | 12 +++- check | 142 ++++++++++++++++++++++++++++++++++++++--- common/environments | 64 +++++++++++++++++++ common/rc | 143 ++++++++++++++++++++++++++++++++++++++++++ environments/empty-files | 77 +++++++++++++++++++++++ environments/overlayfs | 136 +++++++++++++++++++++++++++++++++++++++ new | 37 ++++++++++- tests/performance/001-readdir | 123 ++++++++++++++++++++++++++++++++++++ tests/performance/002-sqlite | 124 ++++++++++++++++++++++++++++++++++++ tests/performance/Makefile | 21 +++++++ tests/performance/group | 7 +++ 11 files changed, 875 insertions(+), 11 deletions(-) create mode 100644 common/environments create mode 100644 environments/empty-files create mode 100644 environments/overlayfs create mode 100755 tests/performance/001-readdir create mode 100755 tests/performance/002-sqlite create mode 100644 tests/performance/Makefile create mode 100644 tests/performance/group -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html