diff mbox series

[blktests,3/4] tests: use test device min io to support bs > ps

Message ID 20241218112153.3917518-4-mcgrof@kernel.org (mailing list archive)
State New
Headers show
Series enable bs > ps device testing | expand

Commit Message

Luis Chamberlain Dec. 18, 2024, 11:21 a.m. UTC
When a block device supports a minimum block size > ps we must
ensure we don't issue IOs below what is supported. Just leverage
the min optimal IO to also ensure we use the optimal IO as well.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 tests/block/003 | 4 +++-
 tests/block/007 | 3 ++-
 tests/nvme/049  | 5 +++--
 3 files changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tests/block/003 b/tests/block/003
index 2af9b89ec3e5..e57d76271b8b 100755
--- a/tests/block/003
+++ b/tests/block/003
@@ -18,10 +18,12 @@  device_requires() {
 }
 
 test_device() {
+	local test_dev_bs=$(_test_dev_min_io $TEST_DEV)
+
 	echo "Running ${TEST_NAME}"
 
 	FIO_PERF_FIELDS=("trim iops")
-	_fio_perf --bsrange=4k-4g --rw=randtrim --norandommap --name=discards \
+	_fio_perf --bsrange=${test_dev_bs}-4g --rw=randtrim --norandommap --name=discards \
 		--filename="$TEST_DEV" --number_ios=200k
 
 	echo "Test complete"
diff --git a/tests/block/007 b/tests/block/007
index 3b68d0deec35..793bb4c45c05 100755
--- a/tests/block/007
+++ b/tests/block/007
@@ -31,13 +31,14 @@  cleanup_fallback_device() {
 }
 
 run_fio_job() {
+	local test_dev_bs=$(_test_dev_min_io $TEST_DEV)
 	if _test_dev_is_rotational; then
 		size="32m"
 	else
 		size="1g"
 	fi
 
-	_fio_perf --bs=4k --rw=randread --norandommap --name=reads \
+	_fio_perf --bs=$test_dev_bs --rw=randread --norandommap --name=reads \
 		--filename="$TEST_DEV" --size="$size" --direct=1 \
 		--ioengine=pvsync2 --hipri="$1"
 }
diff --git a/tests/nvme/049 b/tests/nvme/049
index 88d4fb122988..6bb731f84fbf 100755
--- a/tests/nvme/049
+++ b/tests/nvme/049
@@ -19,10 +19,11 @@  test_device() {
 	echo "Running ${TEST_NAME}"
 
 	local ngdev=${TEST_DEV/nvme/ng}
+	local test_dev_bs=$(_test_dev_min_io $ngdev)
 	local common_args=(
 		--size=1M
 		--filename="$ngdev"
-		--bs=4k
+		--bs=$test_dev_bs
 		--rw=randread
 		--numjobs=1
 		--iodepth=16
@@ -35,7 +36,7 @@  test_device() {
 	local fio_output
 
 	# check security permission
-	if ! fio_output=$(fio --name=check --size=4k --filename="$ngdev" \
+	if ! fio_output=$(fio --name=check --bs=$test_dev_bs --size=32k --filename="$ngdev" \
 			    --rw=read --ioengine=io_uring_cmd 2>&1) &&
 			grep -q -e "Operation not permitted" \
 				-e "Permission denied" <<< "$fio_output"; then