On Apr 11, 2024 / 20:44, Daniel Wagner wrote: > On Thu, Apr 11, 2024 at 08:12:24PM +0900, Shin'ichiro Kawasaki wrote: > > Some of the test cases in nvme test group do exact same test for two > > blkdev types: deice type and file type. Except for this difference, the > > test cases are pure duplication. It is desired to avoid the duplication. > > When the duplication is avoided, still it is required to control which > > condition to run the test. > > > > To avoid the duplication and also to allow the blkdev type control, > > introduce a new configuration parameter NVMET_BLKDEV_TYPES. This is an > > array to hold default values (device file). Also add the helper function > > _set_nvme_trtype_and_nvmet_blkdev_type(). It sets up nvmet_blkdev_type > > variable for each test case run from NVMET_BLKDEV_TYPES. It also sets > > nvme_trtype from NVMET_TR_TYPES. > > > > When NVMET_BLKDEV_TYPES and NVMET_TR_TYPES are set as follows, the test > > case with _set_nvme_trtype_and_nvmet_blkdev_type in set_condition() hook > > is called 2 x 3 = 6 times. > > > > NVMET_BLKDEV_TYPES=(device file) > > NVMET_TR_TYPES=(loop rdma tcp) > > > > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > > --- > > Documentation/running-tests.md | 3 +++ > > tests/nvme/rc | 16 ++++++++++++++++ > > 2 files changed, 19 insertions(+) > > > > diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md > > index ede3a81..ca11f58 100644 > > --- a/Documentation/running-tests.md > > +++ b/Documentation/running-tests.md > > @@ -108,6 +108,9 @@ The NVMe tests can be additionally parameterized via environment variables. > > - nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' > > Run the tests with the given transport. This parameter is still usable but > > replaced with NVMET_TR_TYPES. Use NVMET_TR_TYPES instead. > > +- NVMET_BLOCK_DEV_TYPES (array) > > NVMET_BLKDEV_TYPES ? That sounds better. Will rename to it.