You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skip tests if scsi_debug module is already loaded and in use
Several tests across block/, scsi/, dm/, md/, zbd/, nvme/ require
exclusive access to the scsi_debug module because they load, unload
or reconfigure it. When scsi_debug is loadable and already loaded
by the environment (e.g., by another driver or a previous setup),
these tests fail with:
modprobe: FATAL: Module scsi_debug is in use.
Unloading scsi_debug failed
scsi_debug 327680 4
To prevent these failures, this patch introduces a new helper function
_have_loadable_scsi_debug(). It verifies if the module is already loaded
by checking the ${MODULES_TO_UNLOAD[*]} array. If the module exists but
is not in the array, it indicates the module was loaded before the test
started, and the test is skipped.
Additionally, for cases where scsi_debug is built-in, the environment may
have already created additional hosts. To prevent the tests from disrupting
these hosts, _have_scsi_debug() now checks the add_host attribute. If the
number of hosts is greater than 1, the test is skipped.
Signed-off-by: Disha Goel <[email protected]>
0 commit comments