From patchwork Wed Mar 22 10:16:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13183821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BF90C6FD1C for ; Wed, 22 Mar 2023 10:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbjCVKQ5 (ORCPT ); Wed, 22 Mar 2023 06:16:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbjCVKQz (ORCPT ); Wed, 22 Mar 2023 06:16:55 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAD05B439 for ; Wed, 22 Mar 2023 03:16:54 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EA55120C4F; Wed, 22 Mar 2023 10:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679480212; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9UkWbDbsudQ9RC4SZ2+HeX6ArJ9hOreEut9aeSDzOY8=; b=0TNCMXIZPQYRMnd7cNXaeB/Z9ZFjNYtlJVb8j1vOUUjBWAQEDRsXnsJasu1294q4Mc/h4r 1YC5BjrIVgQ9EQmcfHHebjdR32IPOFInqS85Yfaup6vmIDR/e2FycH3SkJY0B4ZtCzoGfe j7HoKS+iFyjhGovWhtT8zyl612gA8TE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679480212; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9UkWbDbsudQ9RC4SZ2+HeX6ArJ9hOreEut9aeSDzOY8=; b=+woj71bBoB/8kr9Ykb+qiyTA8mu7rD3jzjMg+JlUmXAXtOmkiJ2BqIB6pjG1oy/tkveOG6 XFS5jTV5T7IiFbAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DC53B138E9; Wed, 22 Mar 2023 10:16:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NfvHNZTVGmR+DAAAMHmgww (envelope-from ); Wed, 22 Mar 2023 10:16:52 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Daniel Wagner Subject: [PATCH blktests v2 1/3] nvme/rc: Parse optional arguments in _nvme_connect_subsys() Date: Wed, 22 Mar 2023 11:16:46 +0100 Message-Id: <20230322101648.31514-2-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230322101648.31514-1-dwagner@suse.de> References: <20230322101648.31514-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Extend the nvme_connect_subsys() function to parse optional arguments. This avoids that all test have to pass in always all arguments. Signed-off-by: Daniel Wagner --- tests/nvme/041 | 7 ++++-- tests/nvme/042 | 10 +++++--- tests/nvme/043 | 10 +++++--- tests/nvme/044 | 23 +++++++++++------ tests/nvme/045 | 6 +++-- tests/nvme/rc | 68 +++++++++++++++++++++++++++++++++++++++++++------- 6 files changed, 95 insertions(+), 29 deletions(-) diff --git a/tests/nvme/041 b/tests/nvme/041 index 8ffcf13a500a..03e2dab25918 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -55,14 +55,17 @@ test() { # Test unauthenticated connection (should fail) echo "Test unauthenticated connection (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" _nvme_disconnect_subsys "${subsys_name}" # Test authenticated connection echo "Test authenticated connection" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/042 b/tests/nvme/042 index d581bce4a9ee..4ad726f72f5a 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -58,8 +58,9 @@ test() { _set_nvmet_hostkey "${hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle _nvme_disconnect_subsys "${subsys_name}" @@ -75,8 +76,9 @@ test() { _set_nvmet_hostkey "${hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/043 b/tests/nvme/043 index c8ce292ba2e7..c031cecf34a5 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -56,8 +56,9 @@ test() { _set_nvmet_hash "${hostnqn}" "${hash}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle @@ -71,8 +72,9 @@ test() { _set_nvmet_dhgroup "${hostnqn}" "${dhgroup}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/044 b/tests/nvme/044 index c19a9c026711..f2406ecadf7d 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -66,8 +66,9 @@ test() { # Step 1: Connect with host authentication only echo "Test host authentication" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle @@ -77,8 +78,10 @@ test() { # and invalid ctrl authentication echo "Test invalid ctrl authentication (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${hostkey}" udevadm settle @@ -88,8 +91,10 @@ test() { # and valid ctrl authentication echo "Test valid ctrl authentication" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${ctrlkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${ctrlkey}" udevadm settle @@ -100,8 +105,10 @@ test() { echo "Test invalid ctrl key (should fail)" invkey="DHHC-1:00:Jc/My1o0qtLCWRp+sHhAVafdfaS7YQOMYhk9zSmlatobqB8C:" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${invkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${invkey}" udevadm settle diff --git a/tests/nvme/045 b/tests/nvme/045 index a0e6e93ed3c7..612e5f168e3c 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -65,8 +65,10 @@ test() { _set_nvmet_dhgroup "${hostnqn}" "ffdhe2048" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${ctrlkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${ctrlkey}" udevadm settle diff --git a/tests/nvme/rc b/tests/nvme/rc index 210a82aea384..1145fed2d14c 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -316,15 +316,65 @@ _nvme_disconnect_subsys() { } _nvme_connect_subsys() { - local trtype="$1" - local subsysnqn="$2" - local traddr="${3:-$def_traddr}" - local host_traddr="${4:-$def_host_traddr}" - local trsvcid="${4:-$def_trsvcid}" - local hostnqn="${5:-$def_hostnqn}" - local hostid="${6:-$def_hostid}" - local hostkey="${7}" - local ctrlkey="${8}" + local positional_args=() + local trtype="" + local subsysnqn="" + local traddr="$def_traddr" + local host_traddr="$def_host_traddr" + local trsvcid="$def_trsvcid" + local hostnqn="$def_hostnqn" + local hostid="$def_hostid" + local hostkey="" + local ctrlkey="" + + while [[ $# -gt 0 ]]; do + case $1 in + -a|--traddr) + traddr="$2" + shift + shift + ;; + -w|--host-traddr) + host_traddr="$2" + shift + shift + ;; + -s|--trsvcid) + trsvcid="$2" + shift + shift + ;; + -n|--hostnqn) + hostnqn="$2" + shift + shift + ;; + -I|--hostid) + hostid="$2" + shift + shift + ;; + -S|--dhchap-secret) + hostkey="$2" + shift + shift + ;; + -C|--dhchap-ctrl-sectret) + ctrlkey="$2" + shift + shift + ;; + *) + positional_args+=("$1") + shift + ;; + esac + done + + set -- "${positional_args[@]}" + + trtype="$1" + subsysnqn="$2" ARGS=(-t "${trtype}" -n "${subsysnqn}") if [[ "${trtype}" == "fc" ]] ; then From patchwork Wed Mar 22 10:16:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13183820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EB0DC6FD1F for ; Wed, 22 Mar 2023 10:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbjCVKQ4 (ORCPT ); Wed, 22 Mar 2023 06:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbjCVKQz (ORCPT ); Wed, 22 Mar 2023 06:16:55 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D43DF5B437 for ; Wed, 22 Mar 2023 03:16:54 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 94BC8339B3; Wed, 22 Mar 2023 10:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679480213; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUkysKhNingyeMfZ0KjMwZybzXM1TI6WNetcJwrtqg4=; b=fBJPRHBolQ8VfgVkmsUWiKZeIRPUAq83u8n0964lD9ldMxe62SX7h6mAurmamoGtWwmPA4 ido+ykiGwxrmdn9ukwUdO21dmdW25cdQDqE+oNdDyC7UHfx+KV1JR3aDHbmIrx7II78WrZ yydvPD3nw5jQB+xHIv75P/a9HtTzw7I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679480213; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUkysKhNingyeMfZ0KjMwZybzXM1TI6WNetcJwrtqg4=; b=tQFMT4gD/EKigeXRrckkubzJDTx0T93HWSyNgG/LoYgpfeOtDaIfWoD4xNMwiR1T7nTVHQ QXu7p7uNQYzj+nCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 883E9138E9; Wed, 22 Mar 2023 10:16:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id COLjIJXVGmSCDAAAMHmgww (envelope-from ); Wed, 22 Mar 2023 10:16:53 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Daniel Wagner Subject: [PATCH blktests v2 2/3] nvme/rc: Add nr queue parser arguments Date: Wed, 22 Mar 2023 11:16:47 +0100 Message-Id: <20230322101648.31514-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230322101648.31514-1-dwagner@suse.de> References: <20230322101648.31514-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Daniel Wagner --- tests/nvme/rc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/nvme/rc b/tests/nvme/rc index 1145fed2d14c..ca3d995f7b0b 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -326,6 +326,9 @@ _nvme_connect_subsys() { local hostid="$def_hostid" local hostkey="" local ctrlkey="" + local nr_io_queues="" + local nr_write_queues="" + local nr_poll_queues="" while [[ $# -gt 0 ]]; do case $1 in @@ -364,6 +367,21 @@ _nvme_connect_subsys() { shift shift ;; + -i|--nr-io-queues) + nr_io_queues="$2" + shift + shift + ;; + -W|--nr-write-queues) + nr_write_queues="$2" + shift + shift + ;; + -P|--nr-poll-queues) + nr_poll_queues="$2" + shift + shift + ;; *) positional_args+=("$1") shift @@ -394,6 +412,16 @@ _nvme_connect_subsys() { if [[ -n "${ctrlkey}" ]]; then ARGS+=(--dhchap-ctrl-secret="${ctrlkey}") fi + if [[ -n "${nr_io_queues}" ]]; then + ARGS+=(--nr-io-queues="${nr_io_queues}") + fi + if [[ -n "${nr_write_queues}" ]]; then + ARGS+=(--nr-write-queues="${nr_write_queues}") + fi + if [[ -n "${nr_poll_queues}" ]]; then + ARGS+=(--nr-poll-queues="${nr_poll_queues}") + fi + nvme connect "${ARGS[@]}" 2> /dev/null } From patchwork Wed Mar 22 10:16:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13183822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C24EC6FD1C for ; Wed, 22 Mar 2023 10:17:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjCVKRA (ORCPT ); Wed, 22 Mar 2023 06:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbjCVKQ4 (ORCPT ); Wed, 22 Mar 2023 06:16:56 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 720315BD96 for ; Wed, 22 Mar 2023 03:16:55 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2872B339B1; Wed, 22 Mar 2023 10:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679480214; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXUrtujg2ff8LWOHRdRnBuszIDKHUpNyoCvyQ2YNsPo=; b=SrmS7TbyhiyPs9MKJz35cJDfgGQuqOEgKbB47+C2p7tre68eaPQYkUAbOnrKEeEH3pF3ik wJ5K81wGHEdfCM74TP7dFZHErHGhXKXn7vU4g2JDXNX2iaQ8gL++iWxpb39U5Wi0qrnRV5 4K9hcU8vY/1yThEFjGvHcCJL4dgJ9Tg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679480214; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXUrtujg2ff8LWOHRdRnBuszIDKHUpNyoCvyQ2YNsPo=; b=kcY4/Vi8yRREzW0svOvNPOIgBhhEGsC2c+F6qEwBsAIJ4k5eAqQ2oXzrCupn5M+bNqcIcq ftAPwsCTmPCKhbAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1A10C138E9; Wed, 22 Mar 2023 10:16:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id otIEBpbVGmSGDAAAMHmgww (envelope-from ); Wed, 22 Mar 2023 10:16:54 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Daniel Wagner Subject: [PATCH blktests v2 3/3] nvme/047: Test different queue counts Date: Wed, 22 Mar 2023 11:16:48 +0100 Message-Id: <20230322101648.31514-4-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230322101648.31514-1-dwagner@suse.de> References: <20230322101648.31514-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Test if the transport are handling the different queues correctly. We also issue some I/O to make sure that not just the plain connect works. For this we have to use a file system which supports direct I/O and hence we use a device backend. Signed-off-by: Daniel Wagner --- tests/nvme/047 | 65 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/047.out | 2 ++ 2 files changed, 67 insertions(+) create mode 100755 tests/nvme/047 create mode 100644 tests/nvme/047.out diff --git a/tests/nvme/047 b/tests/nvme/047 new file mode 100755 index 000000000000..6a37f7a569b7 --- /dev/null +++ b/tests/nvme/047 @@ -0,0 +1,65 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (C) 2023 SUSE LLC +# +# Test NVMe queue counts. + +. tests/nvme/rc +. common/xfs + +DESCRIPTION="test NVMe queue counts" + +requires() { + _nvme_requires + _have_xfs + _have_fio + _require_nvme_trtype_is_fabrics +} + +test() { + echo "Running ${TEST_NAME}" + + _setup_nvmet + + local port + local nvmedev + local loop_dev + local file_path="$TMPDIR/img" + local subsys_name="blktests-subsystem-1" + + truncate -s 512M "${file_path}" + + loop_dev="$(losetup -f --show "${file_path}")" + + _create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \ + "91fdba0d-f87b-4c25-b80f-db7be1418b9e" + port="$(_create_nvmet_port "${nvme_trtype}")" + _add_nvmet_subsys_to_port "${port}" "${subsys_name}" + + _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ + --nr-write-queues 1 + + nvmedev=$(_find_nvme_dev "${subsys_name}") + + _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" + + _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1 + + _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ + --nr-write-queues 1 \ + --nr-poll-queues 1 + + _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" + + _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1 + + _remove_nvmet_subsystem_from_port "${port}" "${subsys_name}" + _remove_nvmet_subsystem "${subsys_name}" + _remove_nvmet_port "${port}" + + losetup -d "${loop_dev}" + + rm "${file_path}" + + echo "Test complete" +} 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