]> www.infradead.org Git - users/hch/blktests.git/commit
blktests: Add _have_kernel_config_file() and _check_kernel_option()
authorXiao Yang <yangx.jy@fujitsu.com>
Mon, 27 Jun 2022 07:32:49 +0000 (15:32 +0800)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 28 Jun 2022 08:46:29 +0000 (17:46 +0900)
commit8ba6366d9ae6bea6c28c07134cade33a1e510846
treebd82ba85735d3bdd88c30ae43459f1756f135c09
parent6eee190375f0ec23c56e300e7ddcdc74d65279f2
blktests: Add _have_kernel_config_file() and _check_kernel_option()

The helper function _have_kernel_option() sets SKIP_REASON when the
specified kernel config option is not set. Sometimes this SKIP_REASON
update is not desired and it is unset after _have_kernel_option() calls.
This unset is not straight-forward and confusing.

To avoid the unset operation, introduce two new helper functions:

1) _have_kernel_config_file() which sets SKIP_REASON when neither
   /boot/config* nor /proc/config.gz is available.
2) _check_kernel_option() which doesn't set SKIP_RESAON when
   the specified kernel option is not defined.

Also re-implement _have_kernel_option() with the new helper functions.
When SKIP_REASON update is not desired, call _check_kernel_option() in
place of _have_kernel_option().

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
[Shin'ichiro: added change purpose in the commit message]
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/multipath-over-rdma
common/rc
tests/nvme/039
tests/nvmeof-mp/rc