blktests is a test suite for Linux;reg; kernel storage stack, that is, the block I/O layer as well as underlying device specific layers (SCSI, NVMe, SRP, etc). blktests is heavily inspired by the xfstests framework for testing file systems.
Recent contributions to blktests added zoned block device tests support.
The blktests project is hosted on GitHub.
blktests organizes test cases into groups. The test groups currently available are as shown in the table below.
|block||Block layer generic tests|
|loop||Loopback device tests|
|meta||blktests self tests|
|nbd||Network block device driver tests|
|nvme||NVMe driver tests|
|nvmeof-mp||NVME-over-fabrics multipath tests|
|scsi||SCSI layer tests|
|srp||SCSI RDMA Protocol driver tests|
|zbd||Zoned block device tests|
Detailed generic information on how to configure and run blktests is provided here.
For executing tests against a physical zoned block device (e.g. a ZBC/ZAC disk),
config file should be prepared and copied to the blktests
installation directory. Tests can also be executed directly from the source
directory if the
config file is copied in that location.
With this configuration, all tests relevant to zoned block devices will be
executed. The execution duration can be several 10s of minutes depending on the
target device and host system. To Shorten execution, the options
QUICK_RUN can be added to the configuration.
Of note is that the block layer generic tests of the block group also include
test cases executed against a logical device (null_blk block device). These
tests are executed twice, once with the null_blk device configured as a
regular block device and a second time with the null_blk device configured as
a zoned block device. To reduce the test cases execution to only the physical
device specified in the configuration file, the
DEVICE_ONLY option can be set.
blktests execution is done using the
check script present in the top level
directory. This script optionally takes as argument a list of test groups or
test cases to execute. Bu default, without any argument, all test groups will be
For zoned block device tests, executing the test cases of the block and zbd test groups is sufficient.
As discussed in the configuration section above, several options can speedup the execution of blktests. Such quick runs are indeed faster but at the cost of weaker testing compared to full runs.
The following command executes all test cases relevant to zoned block devices
with the device specified in the
config configuration file as target. In this
example, no options are added.
The output of some tests is [not run]. This is not a failure. This only indicates that the target device specified in the configuration file does not support the feature being tested. For example, in the above run, test case block/003 is not executed against the specified host managed disk because the disk does not support the discard command.
blkltests execution can be accelerated using the
DEVICE_ONLY configuration options.
Running only the block and zbd test groups with the above configuration gives the following results.