The recent fio change introduced a new error message to indicate max_active_zones limit error of zoned block devices. Add a test case to check the error message is reported. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> --- t/zbd/test-zbd-support | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 6d44faf1..1d1d389b 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -1464,6 +1464,34 @@ test66() { >> "${logfile}.${test_number}" 2>&1 } +# Test max_active_zones limit failure is reported with good error message. +test67() { + local i off + + require_zbd || return $SKIP_TESTCASE + require_max_active_zones 2 || return $SKIP_TESTCASE + require_max_open_zones "${max_active_zones}" || return $SKIP_TESTCASE + require_seq_zones $((max_active_zones + 1)) || return $SKIP_TESTCASE + + reset_zone "$dev" -1 + + # Prepare max_active_zones in open condition. + off=$((first_sequential_zone_sector * 512)) + run_fio --name=w --filename="$dev" --zonemod=zbd --direct=1 \ + --offset=$((off)) --zonesize="${zone_size}" --rw=randwrite \ + --bs=4096 --size="$((zone_size * max_active_zones))" \ + --io_size="${zone_size}" "$(ioengine "psync")" \ + >> "${logfile}.${test_number}" 2>&1 || return $? + + # Write to antoher zone and trigger max_active_zones limit error. + off=$((off + zone_size * max_active_zones)) + run_one_fio_job --zonemod=zbd --direct=1 "$(ioengine "psync")" \ + --rw=write --bs=$min_seq_write_size --offset=$((off)) \ + --size=$((zone_size)) --zonesize="${zone_size}" \ + >> "${logfile}.${test_number}" 2>&1 && return $? + grep -q 'Exceeded max_active_zones limit' "${logfile}.${test_number}" +} + SECONDS=0 tests=() dynamic_analyzer=() -- 2.40.1