All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: linux-block@vger.kernel.org
Cc: linux-nvme@lists.infradead.org, Daniel Wagner <dwagern@suse.de>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH blktests 04/11] meta/{016,017}: add test cases to check repeated test case runs
Date: Thu, 11 Apr 2024 20:12:21 +0900	[thread overview]
Message-ID: <20240411111228.2290407-5-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com>

Add test cases to confirm the feature to repeat test case runs with
different conditions is working.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/meta/016     | 29 +++++++++++++++++++++++++++++
 tests/meta/016.out |  2 ++
 tests/meta/017     | 29 +++++++++++++++++++++++++++++
 tests/meta/017.out |  2 ++
 4 files changed, 62 insertions(+)
 create mode 100755 tests/meta/016
 create mode 100644 tests/meta/016.out
 create mode 100755 tests/meta/017
 create mode 100644 tests/meta/017.out

diff --git a/tests/meta/016 b/tests/meta/016
new file mode 100755
index 0000000..caf876d
--- /dev/null
+++ b/tests/meta/016
@@ -0,0 +1,29 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Western Digital Corporation or its affiliates.
+#
+# Test repeated test() run with set_conditions()
+
+. tests/meta/rc
+
+DESCRIPTION="repeat test()"
+
+declare cond_set_index
+
+set_conditions() {
+	local index=$1
+
+	if [[ -z $index ]]; then
+		echo 2
+		return
+	fi
+
+	cond_set_index=$index
+	COND_DESC="condition set $index"
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+	echo "condition set $cond_set_index" >> "$FULL"
+	echo "Test complete"
+}
diff --git a/tests/meta/016.out b/tests/meta/016.out
new file mode 100644
index 0000000..cccfec4
--- /dev/null
+++ b/tests/meta/016.out
@@ -0,0 +1,2 @@
+Running meta/016
+Test complete
diff --git a/tests/meta/017 b/tests/meta/017
new file mode 100755
index 0000000..03f92d6
--- /dev/null
+++ b/tests/meta/017
@@ -0,0 +1,29 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Western Digital Corporation or its affiliates.
+#
+# Test repeated test_device() run with set_conditions()
+
+. tests/meta/rc
+
+DESCRIPTION="repeat test_device()"
+
+declare cond_set_index
+
+set_conditions() {
+	local index=$1
+
+	if [[ -z $index ]]; then
+		echo 2
+		return
+	fi
+
+	cond_set_index=$index
+	COND_DESC="condition set $index"
+}
+
+test_device() {
+	echo "Running ${TEST_NAME}"
+	echo "condition set $cond_set_index" >> "$FULL"
+	echo "Test complete"
+}
diff --git a/tests/meta/017.out b/tests/meta/017.out
new file mode 100644
index 0000000..7fc55ff
--- /dev/null
+++ b/tests/meta/017.out
@@ -0,0 +1,2 @@
+Running meta/017
+Test complete
-- 
2.44.0


  parent reply	other threads:[~2024-04-11 11:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 11:12 [PATCH blktests 00/11] support test case repeat by different conditions Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 01/11] check: factor out _run_test() Shin'ichiro Kawasaki
     [not found]   ` <CGME20240411134129epcas5p3f28e625fc48b93a1f492547a6f4ff894@epcas5p3.samsung.com>
2024-04-11 13:34     ` Nitesh Shetty
2024-04-12 10:59       ` Shinichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 02/11] check: support test case repeat by different conditions Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 03/11] check: use set_conditions() for the CAN_BE_ZONED test cases Shin'ichiro Kawasaki
2024-04-11 11:12 ` Shin'ichiro Kawasaki [this message]
2024-04-11 11:12 ` [PATCH blktests 05/11] nvme/rc: introduce NVMET_TR_TYPES Shin'ichiro Kawasaki
2024-04-11 18:41   ` Daniel Wagner
2024-04-12 10:56     ` Shinichiro Kawasaki
2024-04-16  5:20   ` Shinichiro Kawasaki
2024-04-16 10:28     ` Shinichiro Kawasaki
2024-04-16 16:23       ` Daniel Wagner
2024-04-16 18:43         ` Chaitanya Kulkarni
2024-04-17  0:58           ` Shinichiro Kawasaki
2024-04-17  6:06             ` Daniel Wagner
2024-04-18  6:12               ` Chaitanya Kulkarni
2024-04-18  6:36                 ` Daniel Wagner
2024-04-18  7:18                   ` Chaitanya Kulkarni
2024-04-24  8:55                     ` Shinichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 06/11] nvme/rc: add blkdev type environment variable Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 07/11] nvme/rc: introduce NVMET_BLKDEV_TYPES Shin'ichiro Kawasaki
2024-04-11 18:44   ` Daniel Wagner
2024-04-12 10:56     ` Shinichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 08/11] nvme/{002-031,033-038,040-045,047,048}: support NMVET_TR_TYPES Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 09/11] nvme/{006,008,010,012,014,019,023}: support NVMET_BLKDEV_TYPES Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 10/11] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Shin'ichiro Kawasaki
2024-04-11 11:12 ` [PATCH blktests 11/11] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Shin'ichiro 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=20240411111228.2290407-5-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=dwagern@suse.de \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.