Skip to content

Commit

Permalink
test/zbd/090: Add a SCSI test for npo2 zone sizes
Browse files Browse the repository at this point in the history
Signed-off-by: Bart Van Assche <[email protected]>
  • Loading branch information
bvanassche committed Jan 9, 2024
1 parent dc0671b commit b4413ea
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tests/zbd/090
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0+
# Copyright (C) 2023 Google LLC

. tests/zbd/rc
. common/null_blk
. common/scsi_debug

DESCRIPTION="test npo2 zone size support"
QUICK=1

requires() {
_have_fio
_have_module_param scsi_debug zone_size_mb
_have_scsi_debug
}

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

local fail
local scsi_debug_params=(
delay=0
dev_size_mb=1024
sector_size=4096
zbc=host-managed
zone_nr_conv=0
zone_size_mb=3
)
_init_scsi_debug "${scsi_debug_params[@]}" &&
local zdev="${SCSI_DEBUG_DEVICES[0]}" &&
local zpath="/dev/${zdev}" &&
ls -ld "${zpath}" >>"${FULL}" &&
head -n9 /sys/class/block/"${zdev}"/queue/{chunk_sectors,nr_zones} >>"${FULL}" &&
local fio_args=(
--direct=1
--filename="${zpath}"
--gtod_reduce=1
--ioengine=pvsync
--ioscheduler=none
--name=npo2zs
--runtime=10
--rw=randwrite
--time_based=1
--verify=crc32c
--zonemode=zbd
) &&
fio "${fio_args[@]}" >>"${FULL}" 2>&1 ||
fail=true

rm -f ./local-*-verify.state

_exit_scsi_debug

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

0 comments on commit b4413ea

Please sign in to comment.