aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>2023-12-20 09:58:46 +0900
committerJens Axboe <axboe@kernel.dk>2023-12-19 19:52:35 -0700
commitbe943a3ef5d94d8a9fefa11dc004789f66beb8e6 (patch)
tree4e3af764eec5c30ead0926792fdb7e4aad6f8a2d
parentcbbfe5a9c91895b382aff061bff658c211acd495 (diff)
downloadfio-be943a3ef5d94d8a9fefa11dc004789f66beb8e6.tar.gz
t/zbd: add test case to confirm no write with rwmixwrite=0 option
The previous commit fixed the issue of the unexpected write with options zonemode=zbd, rw=randrw and rwmixwrite=0. Add a test to confirm the fix. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20231220005846.1371456-3-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xt/zbd/test-zbd-support23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
index 2f15a1913..532860ebc 100755
--- a/t/zbd/test-zbd-support
+++ b/t/zbd/test-zbd-support
@@ -1561,6 +1561,29 @@ test67() {
grep -q 'Exceeded max_active_zones limit' "${logfile}.${test_number}"
}
+# Test rw=randrw and rwmixwrite=0 options do not issue write I/O unit
+test68() {
+ local off size
+
+ require_zbd || return "$SKIP_TESTCASE"
+
+ reset_zone "${dev}" -1
+
+ # Write some data as preparation
+ off=$((first_sequential_zone_sector * 512))
+ size=$min_seq_write_size
+ run_one_fio_job "$(ioengine "psync")" --rw=write --offset="$off" \
+ --io_size="$size" --zonemode=strided \
+ --zonesize="$zone_size" --zonerange="$zone_size" \
+ >> "${logfile}.${test_number}" 2>&1 || return $?
+ # Run random mixed read and write specifying zero write ratio
+ run_fio_on_seq "$(ioengine "psync")" --rw=randrw --rwmixwrite=0 \
+ --time_based --runtime=1s \
+ >> "${logfile}.${test_number}" 2>&1 || return $?
+ # "WRITE:" shall be recoreded only once for the preparation
+ [[ $(grep -c "WRITE:" "${logfile}.${test_number}") == 1 ]]
+}
+
SECONDS=0
tests=()
dynamic_analyzer=()