[PATCH blktests v1 0/3] add blkdev type environment variable
Daniel Wagner
dwagner at suse.de
Thu Apr 4 01:29:08 PDT 2024
On Thu, Apr 04, 2024 at 07:43:28AM +0000, Shinichiro Kawasaki wrote:
> Actually, similar feature is implemented in the common code so that some
> test case can be run twice, once for regular the block device, and one more
> time for the zoned block device. You can find test cases with CAN_BE_ZONED=1
> flag. They are run twice when RUN_ZONED_TESTS is set in the config.
>
> To be precise, this applies to the test cases with test() function.
> CAN_BE_ZONED has different meaning for test cases with test_device().
>
> Now we want to run some of test cases twice for the two nvmet block device
> types. This is essentially common feature as the repeated runs for the
> CAN_BE_ZONED test cases. I think it's time to generalize these two uses cases
> and support "repeated test case runs with different test conditions".
Sounds reasonable.
> > requires() = {
> >
> > _nvmet_setup_target
> > }
>
> Hmm, I think this abuses the hook. IMO, it's the better to introduce a new hook.
Indeed :)
> >
> > What do you think about this idea?
>
> It sounds an interesting idea :) I prototyped the common code change based on
> the idea and shared it on GitHub [*]. It introduces two new config arrays
> NVMET_BLKDEV_TYPES and NVMET_TR_TYPES. When these two are set in config file as
> follows,
>
> NVMET_BLKDEV_TYPES=(device file)
> NVMET_TR_TYPES=(loop rdma tcp)
>
> it will run a single test case as follows. 2 x 3 = 6 times repeptitions.
>
> $ sudo ./check nvme/006
> nvme/006(nvmet dev=device tr=loop)(create an NVMeOF target) [passed]
> runtime 0.090s ... 0.091s
> nvme/006(nvmet dev=device tr=rdma)(create an NVMeOF target) [passed]
> runtime 0.310s ... 0.305s
> nvme/006(nvmet dev=device tr=tcp)(create an NVMeOF target) [passed]
> runtime 0.149s ... 0.153s
> nvme/006(nvmet dev=file tr=loop)(create an NVMeOF target) [passed]
> runtime 0.138s ... 0.135s
> nvme/006(nvmet dev=file tr=rdma)(create an NVMeOF target) [passed]
> runtime 0.300s ... 0.305s
> nvme/006(nvmet dev=file tr=tcp)(create an NVMeOF target) [passed]
> runtime 0.141s ... 0.147s
>
> I hope this meets your needs.
Yes, this is very useful.
> [*] https://github.com/kawasaki/blktests/tree/conditions
I quickly looked into the changes. The only thing I'd say it looks a
bit hard to extend if we have yet another variable. But maybe I'd make
it too complex. I don't think we have to be too future proof here,
because we can change this part without problems, it is all 'under the
hood' and doesn't change the 'user interface'.
Great stuff!
More information about the Linux-nvme
mailing list