File tree Expand file tree Collapse file tree 3 files changed +71
-5
lines changed
Expand file tree Collapse file tree 3 files changed +71
-5
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ _have_scsi_debug() {
1111SD_PARAM_PATH=/sys/module/scsi_debug/parameters
1212SD_PSEUDO_PATH=/sys/bus/pseudo/drivers/scsi_debug
1313
14- # shellcheck disable=SC2317 # Don't warn about unreachable commands in this function
15- _have_scsi_debug_group_number_stats () {
14+ # Test whether the scsi_debug driver supports zone sizes that are not a power
15+ # of two.
16+ _have_scsi_debug_npo2 () {
1617 modprobe -r scsi_debug >& /dev/null
17- if modprobe scsi_debug delay=0 >& /dev/null &&
18- [[ -e /sys/bus/pseudo/drivers/scsi_debug/group_number_stats ]]
18+ if modprobe scsi_debug delay=0 zbc=host-managed zone_size_mb=3 >& /dev/null &&
19+ [[ -e /sys/bus/pseudo/drivers/scsi_debug/adapter0 ]]
1920 then
2021 modprobe -r scsi_debug >& /dev/null
2122 return 0
2223 fi
23- SKIP_REASONS+=(" scsi_debug does not support group number statistics " )
24+ SKIP_REASONS+=(" scsi_debug does not support npo2 zone sizes " )
2425 modprobe -r scsi_debug >& /dev/null
2526 return 1
2627}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-License-Identifier: GPL-3.0+
3+ # Copyright (C) 2023 Google LLC
4+
5+ . tests/zbd/rc
6+ . common/null_blk
7+ . common/scsi_debug
8+
9+ DESCRIPTION=" test npo2 zone size support"
10+ QUICK=1
11+
12+ requires () {
13+ _have_fio
14+ _have_module_param scsi_debug zone_size_mb
15+ _have_scsi_debug_npo2
16+ }
17+
18+ test () {
19+ echo " Running ${TEST_NAME} " >> " $FULL "
20+ echo " Running ${TEST_NAME} "
21+
22+ local fail
23+ local scsi_debug_params=(
24+ delay=0
25+ dev_size_mb=1024
26+ sector_size=4096
27+ zbc=host-managed
28+ zone_nr_conv=0
29+ zone_size_mb=3
30+ )
31+ _init_scsi_debug " ${scsi_debug_params[@]} " &&
32+ local zdev=" ${SCSI_DEBUG_DEVICES[0]} " &&
33+ local zpath=" /dev/${zdev} " &&
34+ ls -ld " ${zpath} " >> " ${FULL} " &&
35+ head -n9 /sys/class/block/" ${zdev} " /queue/{chunk_sectors,nr_zones} >> " ${FULL} " &&
36+ local fio_args=(
37+ --direct=1
38+ --filename=" ${zpath} "
39+ --gtod_reduce=1
40+ --ioengine=pvsync
41+ --ioscheduler=none
42+ --name=npo2zs
43+ --runtime=10
44+ --rw=randwrite
45+ --time_based=1
46+ --verify=crc32c
47+ --verify_state_save=0
48+ --zonemode=zbd
49+ ) &&
50+ fio " ${fio_args[@]} " >> " ${FULL} " 2>&1 ||
51+ fail=true
52+
53+ rm -f ./local-* -verify.state
54+
55+ _exit_scsi_debug
56+
57+ if [ -z " $fail " ]; then
58+ echo " Test complete"
59+ else
60+ echo " Test failed"
61+ return 1
62+ fi
63+ }
Original file line number Diff line number Diff line change 1+ Running zbd/090
2+ Test complete
You can’t perform that action at this time.
0 commit comments