]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: ublk: fix behavior when fio is not installed
authorUday Shankar <ushankar@purestorage.com>
Wed, 17 Sep 2025 00:42:52 +0000 (18:42 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 21 Sep 2025 05:18:23 +0000 (23:18 -0600)
commita3835a44107fcbf05f183b5e8b60a8e4605b15ea
tree7bbe8e5f46ce89fa4b043a9f541cf69512a52ea9
parent755a18469ca4eca3b5bb4f52704b7708a9106db9
selftests: ublk: fix behavior when fio is not installed

Some ublk selftests have strange behavior when fio is not installed.
While most tests behave correctly (run if they don't need fio, or skip
if they need fio), the following tests have different behavior:

- test_null_01, test_null_02, test_generic_01, test_generic_02, and
  test_generic_12 try to run fio without checking if it exists first,
  and fail on any failure of the fio command (including "fio command
  not found"). So these tests fail when they should skip.
- test_stress_05 runs fio without checking if it exists first, but
  doesn't fail on fio command failure. This test passes, but that pass
  is misleading as the test doesn't do anything useful without fio
  installed. So this test passes when it should skip.

Fix these issues by adding _have_program fio checks to the top of all of
these tests.

Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/test_generic_01.sh
tools/testing/selftests/ublk/test_generic_02.sh
tools/testing/selftests/ublk/test_generic_12.sh
tools/testing/selftests/ublk/test_null_01.sh
tools/testing/selftests/ublk/test_null_02.sh
tools/testing/selftests/ublk/test_stress_05.sh