diff mbox series

[blktests,v3,3/4] nvme/rc: Add parametric transport required check

Message ID 20230329090202.8351-4-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series Test different queue types | expand

Commit Message

Daniel Wagner March 29, 2023, 9:02 a.m. UTC
Not all transport support the same features thus we need to be able to
express this. Add a transport require check which can be runtime
parameterized.

While at it also update the existing helpers to test for trtype to with
an explicit list of transport types.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/rc | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Comments

Chaitanya Kulkarni March 31, 2023, 4:57 a.m. UTC | #1
On 3/29/2023 2:02 AM, Daniel Wagner wrote:
> Not all transport support the same features thus we need to be able to
> express this. Add a transport require check which can be runtime
> parameterized.
> 
> While at it also update the existing helpers to test for trtype to with
> an explicit list of transport types.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck
diff mbox series

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index c1bb08be511a..a3c9b42d91e6 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -93,17 +93,26 @@  _require_test_dev_is_nvme() {
 	return 0
 }
 
+_require_nvme_trtype() {
+	local trtype
+	for trtype in "$@"; do
+		if [[ "${nvme_trtype}" == "$trtype" ]]; then
+			return 0
+		fi
+	done
+	SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+	return 1
+}
+
 _require_nvme_trtype_is_loop() {
-	if [[ "${nvme_trtype}" != "loop" ]]; then
-		SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+	if ! _require_nvme_trtype loop; then
 		return 1
 	fi
 	return 0
 }
 
 _require_nvme_trtype_is_fabrics() {
-	if [[ "${nvme_trtype}" == "pci" ]]; then
-		SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
+	if ! _require_nvme_trtype loop fc rdma tcp; then
 		return 1
 	fi
 	return 0