diff mbox series

[3/6] tests/nvme: add new test for rand-write on the nvme character device

Message ID 20221221103441.3216600-4-mcgrof@kernel.org (mailing list archive)
State New, archived
Headers show
Series blktests: char device tests with iouring-cmd fio | expand

Commit Message

Luis Chamberlain Dec. 21, 2022, 10:34 a.m. UTC
This does basic rand-write testing of the character device of a
conventional NVMe drive.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 tests/nvme/047     | 41 +++++++++++++++++++++++++++++++++++++++++
 tests/nvme/047.out |  2 ++
 2 files changed, 43 insertions(+)
 create mode 100755 tests/nvme/047
 create mode 100644 tests/nvme/047.out
diff mbox series

Patch

diff --git a/tests/nvme/047 b/tests/nvme/047
new file mode 100755
index 000000000000..8ba55b250bc5
--- /dev/null
+++ b/tests/nvme/047
@@ -0,0 +1,41 @@ 
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2022 Luis Chamberlain <mcgrof@kernel.org>
+#
+# This does basic random write test for the the convential nvme character
+# device.
+
+. tests/nvme/rc
+
+DESCRIPTION="basic rand-write io_uring_cmd engine for nvme-ns character device"
+QUICK=1
+
+requires() {
+	_nvme_requires
+	_have_fio
+}
+
+device_requires() {
+	_require_test_dev_is_nvme
+}
+
+test_device() {
+	echo "Running ${TEST_NAME}"
+	local ngdev=${TEST_DEV/nvme/ng}
+	local fio_args=(
+		--size=1M
+		--cmd_type=nvme
+		--filename="$ngdev"
+		--time_based
+		--runtime=10
+	) &&
+	_run_fio_verify_iouring_cmd_randwrite "${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/nvme/047.out b/tests/nvme/047.out
new file mode 100644
index 000000000000..915d0a2389ca
--- /dev/null
+++ b/tests/nvme/047.out
@@ -0,0 +1,2 @@ 
+Running nvme/047
+Test complete