forked from osandov/blktests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zbd/092: Add a test that injects unaligned write errors
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
- Loading branch information
1 parent
1f4ea53
commit 97fc511
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Running zbd/092 | ||
Test complete |