Skip to content

Commit

Permalink
nvme/rc: fix rdma driver check
Browse files Browse the repository at this point in the history
Since the commit 4824ac3 ("Skip tests based on SKIP_REASON, not
return value"), blktests no longer checks return values of _have_foo
helpers. Instead, it checks if _have_foo helpers set SKIP_REASON, which
was renamed to SKIP_REASONS later, to judge test case skip. If two
_have_foo helpers are chained with ||, the skip check does not work as
expected since one of the helper may set SKIP_REASONS even when the
other does not set. Such chain with || is done in _nvme_requires() to
check rdma drivers.

To fix the check, do not chain the helper functions with || operator.
Instead, refer $use_rxe to call only the required function.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
  • Loading branch information
kawasaki committed Oct 12, 2023
1 parent 1aeff01 commit b6a7ca0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/nvme/rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ _nvme_requires() {
_have_driver nvmet-rdma
_have_configfs
_have_program rdma
_have_driver rdma_rxe || _have_driver siw
if [ -n "$use_rxe" ]; then
_have_driver rdma_rxe
else
_have_driver siw
fi
;;
fc)
_have_driver nvme-fc
Expand Down

0 comments on commit b6a7ca0

Please sign in to comment.