### Configure Test Devices Source: https://github.com/linux-blktests/blktests/blob/master/README.md Specify the block devices to be tested. These tests are potentially destructive, so ensure no important data is on these devices. ```bash TEST_DEVS=(\/dev\/nvme0n1 \/dev\/sdb) ``` -------------------------------- ### Run Pre-submission Checks Source: https://github.com/linux-blktests/blktests/blob/master/CONTRIBUTING.md Execute the `make check` command to run static analysis with shellcheck and other sanity checks before submitting new tests. ```bash make check ``` -------------------------------- ### Configuring Test Devices Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Define an array of block devices to be used for testing. Tests requiring a device will be run on each specified device. Note that these tests are destructive. ```sh TEST_DEVS=(/dev/nvme0n1 /dev/sdb) ``` -------------------------------- ### Enabling Quick Runs with Timeout Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Run only tests that honor the specified timeout or are otherwise considered 'quick'. This option helps to speed up test execution. ```sh QUICK_RUN=1 TIMEOUT=30 ``` -------------------------------- ### Running Blk-throttle Tests with Null_blk and SCSI Debug Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md To run blk-throttle tests with both null_blk and scsi_debug drivers, set THROTL_BLKDEV_TYPES to 'nullb sdebug'. This command executes the blk-throttle test suite using both specified drivers. ```sh THROTL_BLKDEV_TYPES="nullb sdebug" ./check throtl/ ``` -------------------------------- ### Configuring Multiple Test Devices for Specific Cases Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Define an associative array to map test cases (or patterns) to specific lists of block devices. This is used for tests requiring multiple devices. ```sh TEST_CASE_DEV_ARRAY[md/003]="/dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1" TEST_CASE_DEV_ARRAY[meta/02*]="/dev/nvme0n1 /dev/nvme1n1" ``` -------------------------------- ### Running NVMe-RDMA and SRP Tests with SIW Driver Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Use the SIW driver for NVMe-RDMA and SRP tests by setting NVMET_TRTYPES to 'rdma'. This command initiates the check for NVMe and SRP test suites. ```sh NVMET_TRTYPES=rdma ./check nvme/ ./check srp/ ``` -------------------------------- ### Running NVMe-RDMA and SRP Tests with RDMA_RXE Driver Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md To use the RDMA_RXE driver for NVMe-RDMA and SRP tests, set USE_RXE to 1 along with NVMET_TRTYPES for NVMe or directly for SRP. This command enables the RDMA_RXE driver for the respective test suites. ```sh USE_RXE=1 NVMET_TRTYPES=rdma ./check nvme/ USE_RXE=1 ./check srp/ ``` -------------------------------- ### Format Git Patches for blktests Source: https://github.com/linux-blktests/blktests/blob/master/CONTRIBUTING.md Configure Git to automatically prefix patch subjects with 'PATCH blktests' for easier management and visibility on the mailing list. ```bash git format-patch --subject-prefix="PATCH blktests" ``` ```bash git config --local format.subjectPrefix "PATCH blktests" ``` -------------------------------- ### Running Blk-throttle Tests with SCSI Debug Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Configure blk-throttle tests to use the scsi_debug driver by setting THROTL_BLKDEV_TYPES to 'sdebug'. This command runs the blk-throttle test suite with the specified driver. ```sh THROTL_BLKDEV_TYPES="sdebug" ./check throtl/ ``` -------------------------------- ### Sign Commits for blktests Source: https://github.com/linux-blktests/blktests/blob/master/CONTRIBUTING.md Ensure all commits are signed off according to the Developer Certificate of Origin. This can be done automatically using Git commands. ```bash git commit -s ``` ```bash git format-patch -s ``` -------------------------------- ### Enabling Zoned Block Device Tests Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Set this variable to run test cases for zoned block devices. Tests will be executed twice: once in non-zoned mode and once in zoned mode. ```sh RUN_ZONED_TESTS=1 ``` -------------------------------- ### Running Specific Tests or Test Groups Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Execute individual tests or entire test groups by specifying them as arguments to the check script. This allows for targeted testing of specific functionalities. ```sh ./check loop block/002 ``` -------------------------------- ### Enabling Device-Only Runs Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Configure the test runner to execute only tests that utilize the configured test devices. This is useful for testing device drivers directly. ```sh DEVICE_ONLY=1 ``` -------------------------------- ### Mounting Configfs if Not Automatically Mounted Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Check if configfs is mounted on /sys/kernel/config and mount it if it is not. This is necessary for certain test configurations that rely on configfs. ```sh if ! findmnt -t configfs /sys/kernel/config > /dev/null; then mount -t configfs configfs /sys/kernel/config fi ``` -------------------------------- ### Setting Normal User for Test Execution Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Specify the normal user for running test cases that require user privileges by setting the NORMAL_USER variable. Test cases will be skipped if a valid user is not specified. ```sh NORMAL_USER=blktests_user ``` -------------------------------- ### Setting Test Timeout Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Limit the runtime of each test to a specified number of seconds. Not all tests may honor this timeout. ```sh TIMEOUT=60 ``` -------------------------------- ### Excluding Tests Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Specify an array of tests or test groups to be excluded from the test run. Tests explicitly provided on the command line will still run. ```sh EXCLUDE=(loop block/001) ``` -------------------------------- ### Customizing PATH for Executables Source: https://github.com/linux-blktests/blktests/blob/master/Documentation/running-tests.md Modify the PATH environment variable to include a directory containing custom executables, such as those built from source. This ensures that the test runner can find and execute these tools. ```sh export PATH="/root/fio:$PATH" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.