Skip to content

Commit

Permalink
zbd/092: Add a test that injects unaligned write errors
Browse files Browse the repository at this point in the history
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
  • Loading branch information
bvanassche committed Nov 14, 2024
1 parent 1f4ea53 commit 97fc511
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests/zbd/092
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 Google LLC

. tests/scsi/rc
. common/scsi_debug

DESCRIPTION="test support for write pipelining with error injection"
QUICK=1

requires() {
_have_fio_zbd_zonemode &&
_have_kernel_option BLK_DEV_ZONED &&
_have_module_param scsi_debug preserves_write_order
}

test() {
echo "Running ${TEST_NAME}"

#echo 7 > /sys/module/scsi_mod/parameters/scsi_logging_level
local scsi_debug_params=(
delay=0
dev_size_mb=1024
every_nth=256
preserves_write_order=1
opts=0x20000 # unaligned write
sector_size=4096
statistics=1
zbc=host-managed
zone_nr_conv=0
zone_size_mb=4
)
_init_scsi_debug "${scsi_debug_params[@]}" &&
local zdev="/dev/${SCSI_DEBUG_DEVICES[0]}" fail &&
ls -ld "${zdev}" >>"${FULL}" &&
local fio_args=(
--direct=1
--filename="${zdev}"
--ioengine=io_uring
--name=pipeline-zoned-writes
--output="${RESULTS_DIR}/fio-output-zbd-092.txt"
--runtime="${TIMEOUT:-30}"
--rw=randwrite
--time_based
--verify=md5
--zonemode=zbd
) &&
_run_fio "${fio_args[@]}" >>"${FULL}" 2>&1 ||
fail=true

_exit_scsi_debug

#echo 0 > /sys/module/scsi_mod/parameters/scsi_logging_level
if [ -z "$fail" ]; then
echo "Test complete"
else
echo "Test failed"
return 1
fi
}
2 changes: 2 additions & 0 deletions tests/zbd/092.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Running zbd/092
Test complete

0 comments on commit 97fc511

Please # to comment.