linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Shin'ichiro Kawasaki <shinichiro@fastmail.com>,
	Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de>
Subject: [PATCH blktests v4 08/11] nvme: Add minimal test image size requirement
Date: Thu, 11 May 2023 16:09:50 +0200	[thread overview]
Message-ID: <20230511140953.17609-9-dwagner@suse.de> (raw)
In-Reply-To: <20230511140953.17609-1-dwagner@suse.de>

Some tests need a minimal test image size to work correctly. Thus add a
helper to check the size and update these tests accordingly.

The image minimum is 4M because some of the test have hard coded values.
All tests which use the xfs fio verification job have a minimum
requirement of 350M impossed by the xfs filesystem.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/012 |  1 +
 tests/nvme/013 |  1 +
 tests/nvme/045 |  2 +-
 tests/nvme/rc  | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/tests/nvme/012 b/tests/nvme/012
index ecf44fcb5a51..efe227538c57 100755
--- a/tests/nvme/012
+++ b/tests/nvme/012
@@ -16,6 +16,7 @@ requires() {
 	_have_fio
 	_have_loop
 	_require_nvme_trtype_is_fabrics
+	_require_nvme_test_img_size 350m
 }
 
 test() {
diff --git a/tests/nvme/013 b/tests/nvme/013
index e249add46295..14e646a19c47 100755
--- a/tests/nvme/013
+++ b/tests/nvme/013
@@ -15,6 +15,7 @@ requires() {
 	_have_xfs
 	_have_fio
 	_require_nvme_trtype_is_fabrics
+	_require_nvme_test_img_size 350m
 }
 
 test() {
diff --git a/tests/nvme/045 b/tests/nvme/045
index 7c51da27b5f1..99012f6bed8f 100755
--- a/tests/nvme/045
+++ b/tests/nvme/045
@@ -120,7 +120,7 @@ test() {
 
 	nvmedev=$(_find_nvme_dev "${subsys_name}")
 
-	_run_fio_rand_io --size=8m --filename="/dev/${nvmedev}n1"
+	_run_fio_rand_io --size=4m --filename="/dev/${nvmedev}n1"
 
 	_nvme_disconnect_subsys "${subsys_name}"
 
diff --git a/tests/nvme/rc b/tests/nvme/rc
index 8d5305e280ad..c951339fad7d 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -21,6 +21,7 @@ nvme_img_size=${nvme_img_size:-"1G"}
 
 _nvme_requires() {
 	_have_program nvme
+	_require_nvme_test_img_size 4m
 	case ${nvme_trtype} in
 	loop)
 		_have_driver nvme-loop
@@ -94,6 +95,20 @@ _require_test_dev_is_nvme() {
 	return 0
 }
 
+_require_nvme_test_img_size() {
+	local require_sz_mb
+	local nvme_img_size_mb
+
+	require_sz_mb="$(convert_to_mb "$1")"
+	nvme_img_size_mb="$(convert_to_mb "${nvme_img_size}")"
+
+	if ((nvme_img_size_mb < require_sz_mb)); then
+		SKIP_REASONS+=("nvme_img_size must be at least ${require_sz_mb}m")
+		return 1
+	fi
+	return 0
+}
+
 _require_nvme_trtype() {
 	local trtype
 	for trtype in "$@"; do
-- 
2.40.0



  parent reply	other threads:[~2023-05-11 14:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 14:09 [PATCH blktests v4 00/11] nvme testsuite runtime optimization Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 01/11] nvme/rc: Auto convert test device size info Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 02/11] nvme{014/015}: Do not hard code device size for dd test Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 03/11] common/xfs: Make size argument optional for _xfs_run_fio_verify_io Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 04/11] common/xfs: Limit fio size job to fit into xfs fs Daniel Wagner
2023-05-17  4:37   ` Chaitanya Kulkarni
2023-05-11 14:09 ` [PATCH blktests v4 05/11] nvme{032,040}: Use runtime fio background jobs Daniel Wagner
2023-05-17  4:40   ` Chaitanya Kulkarni
2023-05-18  7:52     ` Daniel Wagner
2023-05-18  8:38       ` Chaitanya Kulkarni
2023-05-11 14:09 ` [PATCH blktests v4 06/11] Documentation: Add info on nvme_trtype Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 07/11] nvme: Make test image size configurable Daniel Wagner
2023-05-11 14:09 ` Daniel Wagner [this message]
2023-05-11 14:09 ` [PATCH blktests v4 09/11] nvme{045,047}: Calculate IO size for random fio jobs Daniel Wagner
2023-05-17  4:44   ` Chaitanya Kulkarni
2023-05-19  1:36     ` Shinichiro Kawasaki
2023-06-01  8:46       ` Daniel Wagner
2023-05-11 14:09 ` [PATCH blktests v4 10/11] nvme{002,030}: Move discovery generation counter code to rc Daniel Wagner
2023-05-13 10:27   ` Chaitanya Kulkarni
2023-05-11 14:09 ` [PATCH blktests v4 11/11] nvme{016,017}: Make the number iterations configurable Daniel Wagner
2023-05-25 23:59 ` [PATCH blktests v4 00/11] nvme testsuite runtime optimization 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=20230511140953.17609-9-dwagner@suse.de \
    --to=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=shinichiro@fastmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).