All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: osandov@fb.com, mcgrof@kernel.org
Cc: joshi.k@samsung.com, j.granados@samsung.com,
	anuj20.g@samsung.com, ankit.kumar@samsung.com,
	vincent.fu@samsung.com, ming.lei@redhat.com,
	linux-block@vger.kernel.org
Subject: [PATCH 6/6] tests/zbd: add new basic test for reading zone character device
Date: Wed, 21 Dec 2022 02:34:41 -0800	[thread overview]
Message-ID: <20221221103441.3216600-7-mcgrof@kernel.org> (raw)
In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org>

This adds a basic optimal write test using fio against a ZNS character
device.

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

diff --git a/tests/zbd/012 b/tests/zbd/012
new file mode 100755
index 000000000000..474bcb07a27b
--- /dev/null
+++ b/tests/zbd/012
@@ -0,0 +1,50 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2022 Luis Chamberlain <mcgrof@kernel.org>
+#
+# This does basic optimal write test for the zone nvme character device.
+
+. tests/zbd/rc
+
+DESCRIPTION="basic optimal write using 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"
+	) &&
+	_run_fio_verify_iouring_cmd_write_opts_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/012.out b/tests/zbd/012.out
new file mode 100644
index 000000000000..8ff654950c5f
--- /dev/null
+++ b/tests/zbd/012.out
@@ -0,0 +1,2 @@
+Running zbd/012
+Test complete
-- 
2.35.1


  parent reply	other threads:[~2022-12-21 10:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 10:34 [PATCH 0/6] blktests: char device tests with iouring-cmd fio Luis Chamberlain
2022-12-21 10:34 ` [PATCH 1/6] common/fio: add helpers using io-uring cmd engine Luis Chamberlain
2022-12-30 10:10   ` Joel Granados
2022-12-21 10:34 ` [PATCH 2/6] tests/nvme: add new test for rand-read on the nvme character device Luis Chamberlain
2022-12-23 13:11   ` Kanchan Joshi
2022-12-23 15:56     ` Luis Chamberlain
2023-01-17  7:46       ` Kanchan Joshi
2022-12-30 10:37   ` Joel Granados
2023-01-03  5:48     ` Chaitanya Kulkarni
2022-12-21 10:34 ` [PATCH 3/6] tests/nvme: add new test for rand-write " Luis Chamberlain
2022-12-21 10:34 ` [PATCH 4/6] tests/nvme: add new test for optimal write " Luis Chamberlain
2022-12-21 10:34 ` [PATCH 5/6] tests/zbd: add new basic test for reading zone " Luis Chamberlain
2022-12-21 10:34 ` Luis Chamberlain [this message]
2022-12-28  3:25 ` [PATCH 0/6] blktests: char device tests with iouring-cmd fio Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221221103441.3216600-7-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=ankit.kumar@samsung.com \
    --cc=anuj20.g@samsung.com \
    --cc=j.granados@samsung.com \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=vincent.fu@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.