[PATCH 5/6] tests/zbd: add new basic test for reading zone character device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a basic test to read using fio against a ZNS character device.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
 tests/zbd/011     | 52 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/zbd/011.out |  2 ++
 2 files changed, 54 insertions(+)
 create mode 100755 tests/zbd/011
 create mode 100644 tests/zbd/011.out

diff --git a/tests/zbd/011 b/tests/zbd/011
new file mode 100755
index 000000000000..a4d46fcd6cd3
--- /dev/null
+++ b/tests/zbd/011
@@ -0,0 +1,52 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2022 Luis Chamberlain <mcgrof@xxxxxxxxxx>
+#
+# This does basic read test for the zone nvme character device.
+
+. tests/zbd/rc
+
+DESCRIPTION="basic read io_uring_cmd engine for zone nvme-ns character device"
+QUICK=1
+CAN_BE_ZONED=1
+
+requires() {
+	_have_fio
+}
+
+fallback_device() {
+	_fallback_null_blk_zoned
+}
+
+cleanup_fallback_device() {
+	_exit_null_blk
+}
+
+test_device() {
+	echo "Running ${TEST_NAME}"
+	local -i bs
+	declare -a fio_args
+	local ngdev=${TEST_DEV/nvme/ng}
+
+	_get_sysfs_variable "${TEST_DEV}" || return $?
+	bs=${SYSFS_VARS[$SV_PHYS_BLK_SIZE]}
+	_put_sysfs_variable
+
+	fio_args=(
+		--bs="$bs"
+		--size=1024M
+		--cmd_type=nvme
+		--filename="$ngdev"
+		--time_based
+		--runtime=10
+	) &&
+	_run_fio_iouring_cmd_zone "${fio_args[@]}" >>"${FULL}" 2>&1 ||
+	fail=true
+
+	if [ -z "$fail" ]; then
+		echo "Test complete"
+	else
+		echo "Test failed"
+		return 1
+	fi
+}
diff --git a/tests/zbd/011.out b/tests/zbd/011.out
new file mode 100644
index 000000000000..aec7f703938a
--- /dev/null
+++ b/tests/zbd/011.out
@@ -0,0 +1,2 @@
+Running zbd/011
+Test complete
-- 
2.35.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux