fio=$(dirname "$0")/../../fio
- opts=("--aux-path=/tmp" "--allow_file_create=0" "$@")
+ opts=("--aux-path=/tmp" "--allow_file_create=0" \
+ "--significant_figures=10" "$@")
{ echo; echo "fio ${opts[*]}"; echo; } >>"${logfile}.${test_number}"
"${dynamic_analyzer[@]}" "$fio" "${opts[@]}"
grep -q 'Specifying the zone size is mandatory for regular block devices with --zonemode=zbd'
}
-# Check whether fio handles --zonesize=1 correctly.
+# Check whether fio handles --zonesize=1 correctly for regular block devices.
test43() {
+ [ -n "$is_zbd" ] && return 0
read_one_block --zonemode=zbd --zonesize=1 |
grep -q 'zone size must be at least 512 bytes for --zonemode=zbd'
}
check_written $((size * 8)) || return $?
}
+# Check whether fio handles --zonemode=zbd --zoneskip=1 correctly.
+test47() {
+ local bs
+
+ [ -z "$is_zbd" ] && return 0
+ bs=$((logical_block_size))
+ run_one_fio_job --ioengine=psync --rw=write --bs=$bs \
+ --zonemode=zbd --zoneskip=1 \
+ >> "${logfile}.${test_number}" 2>&1 && return 1
+ grep -q 'zoneskip 1 is not a multiple of the device zone size' "${logfile}.${test_number}"
+}
+
+# Multiple overlapping random write jobs for the same drive and with a
+# limited number of open zones. This is similar to test29, but uses libaio
+# to stress test zone locking.
+test48() {
+ local i jobs=16 off opts=()
+
+ off=$((first_sequential_zone_sector * 512 + 64 * zone_size))
+ size=$((16*zone_size))
+ [ -n "$is_zbd" ] && reset_zone "$dev" $((off / 512))
+ opts=("--aux-path=/tmp" "--allow_file_create=0" "--significant_figures=10")
+ opts+=("--debug=zbd")
+ opts+=("--ioengine=libaio" "--rw=randwrite" "--direct=1")
+ opts+=("--time_based" "--runtime=30")
+ opts+=("--zonemode=zbd" "--zonesize=${zone_size}")
+ opts+=("--max_open_zones=4")
+ for ((i=0;i<jobs;i++)); do
+ opts+=("--name=job$i" "--filename=$dev" "--offset=$off" "--bs=16K")
+ opts+=("--io_size=$zone_size" "--iodepth=256" "--thread=1")
+ opts+=("--group_reporting=1")
+ done
+
+ fio=$(dirname "$0")/../../fio
+
+ { echo; echo "fio ${opts[*]}"; echo; } >>"${logfile}.${test_number}"
+
+ timeout -v -s KILL 45s \
+ "${dynamic_analyzer[@]}" "$fio" "${opts[@]}" \
+ >> "${logfile}.${test_number}" 2>&1 || return $?
+}
+
tests=()
dynamic_analyzer=()
reset_all_zones=
dev=$1
realdev=$(readlink -f "$dev")
basename=$(basename "$realdev")
-major=$((0x$(stat -L -c '%t' "$realdev")))
-minor=$((0x$(stat -L -c '%T' "$realdev")))
+major=$((0x$(stat -L -c '%t' "$realdev"))) || exit $?
+minor=$((0x$(stat -L -c '%T' "$realdev"))) || exit $?
disk_size=$(($(<"/sys/dev/block/$major:$minor/size")*512))
# When the target is a partition device, get basename of its holder device to
# access sysfs path of the holder device
esac
if [ "${#tests[@]}" = 0 ]; then
- for ((i=1;i<=46;i++)); do
- tests+=("$i")
- done
+ readarray -t tests < <(declare -F | grep "test[0-9]*" | \
+ tr -c -d "[:digit:]\n" | sort -n)
fi
logfile=$0.log