To allow running tests using scsi_debug device with the zoned mode disabled (current setup) as well as enabled, modify the _init_scsi_debug helper function. When RUN_FOR_ZONED is set, specify zbc=host-managed parameter to scsi_debug module so that the scsi_debug devices are prepared in zoned mode. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> --- common/scsi_debug | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/scsi_debug b/common/scsi_debug index b48cdc9..95da14e 100644 --- a/common/scsi_debug +++ b/common/scsi_debug @@ -9,7 +9,16 @@ _have_scsi_debug() { } _init_scsi_debug() { - if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then + local -a args=("$@") + + if (( RUN_FOR_ZONED )); then + if ! _have_module_param scsi_debug zbc; then + return + fi + args+=(zbc=host-managed zone_nr_conv=0) + fi + + if ! modprobe -r scsi_debug || ! modprobe scsi_debug "${args[@]}"; then return 1 fi -- 2.34.1