From patchwork Wed Jun 28 15:16:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 113963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9027281vqr; Wed, 28 Jun 2023 08:53:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qCViBiSBTyk8ReEiWsPulWOBBYpK6IrRAH8T4k48ZG598Ol5HsAR35Qcw22obzI2XW0Xj X-Received: by 2002:a05:6a00:1f95:b0:677:3439:874a with SMTP id bg21-20020a056a001f9500b006773439874amr10726467pfb.3.1687967580915; Wed, 28 Jun 2023 08:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687967580; cv=none; d=google.com; s=arc-20160816; b=V2UxwnVSpte0L+UO9MZNkK4P3xT1PVsq0UO0JnZEeteq4blobr7OuhOkbnrlKhtkGM 5oKL0toPQbkhs7UIm7nxNoh/Q1GvLddOx5NA+IfLO0RFGBLMxMxm5EbvTFDqx5/SW0PR moDW0jAoJij2x17Its96H6FqwX8SDMdxqDUQ7zK1mrMpRgOUXgow6X+d4qCO1vyXCpiB 0DC5W8ZIkQVb0h3A+33TK2uZaF3LyDcCMuwTAw+S7BRJ3k2zha5lGoh+ctbJYhU+geBt zhfT3T4tTyTManCfBcqOPURky+6NqJSK9x70Ub8hq1VkUB2AwycvQPX6+oOzu3ofzF1t FaOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=y/IJwReM/uXABoejcS3ER1zTUO2yvPD9h8VV7ZhYdrs=; fh=1hFOl/y8Yf4puYJGEUtFyF3ISWJIUs31OsNfiF8r3oc=; b=BIty/pXUrOQkj2tOibaKKDL+gPhlXMbFMkETPCF8bICkUO1rcQICDuNK3Q8r4oQw6j 4N9t/swZ0Wq61HdzX9TEOG9VIsDU9YvE5dSO+YDtn6HuNtEfNmR1AyyK5v8WwHIQX5tb GScGEKQ6ByatjiA0wzw6KqC5iigXoHDF+zvYG75USivrjSPsTSRGCMZKZSn8tQbDl5/0 W0xQ4KUL/VVoyDYJzIwZzsQ5dRalgJWH6U7HF1ITF63jRRGGCvnKkDx+weTGZfutj3ej oFI7/dU55Wh3Whgsubv2tx5sMAvyzfvuww20M0s90CsS9406EeCehWTv+udDIUYc1LLS EEXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mPp5Gnt1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=4KbCazMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ct8-20020a056a000f8800b006796dca10d3si5434112pfb.100.2023.06.28.08.52.47; Wed, 28 Jun 2023 08:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mPp5Gnt1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=4KbCazMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjF1PQa (ORCPT + 99 others); Wed, 28 Jun 2023 11:16:30 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:51904 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbjF1PQ1 (ORCPT ); Wed, 28 Jun 2023 11:16:27 -0400 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 2B4B421860; Wed, 28 Jun 2023 15:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687965386; 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=y/IJwReM/uXABoejcS3ER1zTUO2yvPD9h8VV7ZhYdrs=; b=mPp5Gnt1bSBq8z+O3iDXMBeGZfZVLiov6zxoT8q41d15eE1O8kGbV5zALKsiWs2TjYVoxU PhWkUsJiYeB6+eQ30m6xhIzuHdIk454kuaZFTqFrYndolcpW/8j3mtUxtXW/GPatlsTKPm B2AWIV51K/icuPejvpjgOWthfDDcnL8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687965386; 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=y/IJwReM/uXABoejcS3ER1zTUO2yvPD9h8VV7ZhYdrs=; b=4KbCazMVeoHA4YKRFdDw2HfCRMOh7D8AGUfhG1PZoSrCSuMCiF+wJ3HhZLeUFCB5/iFanq xkRUSobbAqL92mAA== 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 1D308138E8; Wed, 28 Jun 2023 15:16:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Tq/tBspOnGQxOQAAMHmgww (envelope-from ); Wed, 28 Jun 2023 15:16:26 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , Hannes Reinecke , James Smart , Daniel Wagner Subject: [PATCH blktests v2 1/3] nvme/048: Check for queue count check directly Date: Wed, 28 Jun 2023 17:16:21 +0200 Message-ID: <20230628151623.11340-2-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230628151623.11340-1-dwagner@suse.de> References: <20230628151623.11340-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769962293909959709?= X-GMAIL-MSGID: =?utf-8?q?1769962293909959709?= The test monitored the state changes live -> resetting -> connecting -> live, to figure out the queue count change was successful. The fc transport is reconnecting very fast and the state transitions are not observed by the current approach. So instead trying to monitor the state changes, let's just wait for the live state and the correct queue number. As queue count is depending on the number of online CPUs we explicitly use 1 and 2 for the max_queue count. This means the queue_count value needs to reach either 2 or 3 (admin queue included). Signed-off-by: Daniel Wagner --- tests/nvme/048 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/nvme/048 b/tests/nvme/048 index 81084f0440c2..bbfb9873b5e8 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -42,6 +42,24 @@ nvmf_wait_for_state() { return 0 } +nvmf_check_queue_count() { + local subsys_name="$1" + local queue_count="$2" + local nvmedev + local queue_count_file + + nvmedev=$(_find_nvme_dev "${subsys_name}") + queue_count_file=$(cat /sys/class/nvme-fabrics/ctl/"${nvmedev}"/queue_count) + + queue_count=$((queue_count + 1)) + if [[ "${queue_count}" -ne "${queue_count_file}" ]]; then + echo "expected queue count ${queue_count} not set" + return 1 + fi + + return 0 +} + set_nvmet_attr_qid_max() { local nvmet_subsystem="$1" local qid_max="$2" @@ -56,10 +74,8 @@ set_qid_max() { local qid_max="$3" set_nvmet_attr_qid_max "${subsys_name}" "${qid_max}" - - # Setting qid_max forces a disconnect and the reconntect attempt starts - nvmf_wait_for_state "${subsys_name}" "connecting" || return 1 nvmf_wait_for_state "${subsys_name}" "live" || return 1 + nvmf_check_queue_count "${subsys_name}" "${qid_max}" || return 1 return 0 } @@ -103,7 +119,7 @@ test() { echo FAIL else set_qid_max "${port}" "${subsys_name}" 1 || echo FAIL - set_qid_max "${port}" "${subsys_name}" 128 || echo FAIL + set_qid_max "${port}" "${subsys_name}" 2 || echo FAIL fi _nvme_disconnect_subsys "${subsys_name}" From patchwork Wed Jun 28 15:16:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 113953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9014198vqr; Wed, 28 Jun 2023 08:32:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlGcVL0f8fAfM01n7W0zzw9YqtRwyJDZYkoVBcozmuRUlNx1g1TfrvSciyeLHq9V0NZgrTXl X-Received: by 2002:a05:6402:40c3:b0:50d:9ba4:52dc with SMTP id z3-20020a05640240c300b0050d9ba452dcmr172891edb.0.1687966330854; Wed, 28 Jun 2023 08:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687966330; cv=none; d=google.com; s=arc-20160816; b=dwKeoej+TBHqpMLRbrOY6UNE22zhpi5+NgM9iW9QN4AMdIpvYwKe+F6Q36fnVFLJap P0E1eEJnvIx4ojviFZjkCa2GCljfFJnsg8z9LbWpaA0n6rwSFMA0gvVPFQgONbwjtfRS ObTqDV0yQoz3q2zhjYShPdQd4kWsbgz19p9vK3YElKYTvenVEq6ybORPxbOrq+mf69j/ 0+Ma7tnTMdQtGh7tNyWF6EXaou3Iwusa3qJN3jSMm3WD1XMeuzl6Oa4X9H/xamBuAh5Q QDLV0T0p8+pXEPk3hHGrb+qkyzqUxt7I27ZZp+euFYyOQ+3bmqfxmyYCI+NTZJDH8SmY SXZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=WJc1MzgYT11bWjhAZk5pZTZ+qKRLUqhEZojvJZGv2AQ=; fh=1hFOl/y8Yf4puYJGEUtFyF3ISWJIUs31OsNfiF8r3oc=; b=AZDeAkDTldMZ2wdJjcEgyBgz2dgqMuXVQ7M5iBwzdRK7+u1UBoKZkVYwTAx1+53gh+ Nqh9kHbf93LN10na8oNsYk797bD7zrOHDn6w7r2GZKqaqHO8WHdw9Qqj/f+y2VotfEBo P1PnzWIbtZYzUs2ygGhzYGjjtBSs1P1I96QN3JhLcwmVO901cZxJOPopYFZ+jU2X2vEJ 3YpcdEI1glu+d7fkJfV9c2TTZCp7XAYKU9Z+BFizUqFsqlS/UXRrpjKTHmOTRQb2w5U9 oOVVgSNw5RsqrZEeeFFid1cPuuQVD6AJGrl+OvveHDp4xG6qEB1WuNkiRATJVw5XW3qv PySg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=cXjxD4w6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=t7qZ1tqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a056402070b00b0051dd22715c4si661816edx.196.2023.06.28.08.31.43; Wed, 28 Jun 2023 08:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=cXjxD4w6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=t7qZ1tqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232062AbjF1PQh (ORCPT + 99 others); Wed, 28 Jun 2023 11:16:37 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:51912 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjF1PQ2 (ORCPT ); Wed, 28 Jun 2023 11:16:28 -0400 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 C95C321861; Wed, 28 Jun 2023 15:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687965386; 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=WJc1MzgYT11bWjhAZk5pZTZ+qKRLUqhEZojvJZGv2AQ=; b=cXjxD4w65dW3uVVIZr7GmkGskiTpPMT5ApChVNhj+US7nfGN9oBG3f/DHbXhb04g+3BUBK jeLQHxQPxDaJLnumI2IJJptdFNTVQWrN52Ulvd9SLlK7t5DrpYXidcXwbDZ/cITYWexTse gv1/R1K6iLgOLMpDUEhUtZsTWzAmr90= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687965386; 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=WJc1MzgYT11bWjhAZk5pZTZ+qKRLUqhEZojvJZGv2AQ=; b=t7qZ1tqmWmifP1TDgCoXPm5UKbU7Ezdi+aE9yh3Jwboh1P/7NokCRUGk7SosrXNmhEDeJd M7Fl60ptXX73+rBg== 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 BA696138E8; Wed, 28 Jun 2023 15:16:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vNpFLcpOnGQzOQAAMHmgww (envelope-from ); Wed, 28 Jun 2023 15:16:26 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , Hannes Reinecke , James Smart , Daniel Wagner Subject: [PATCH blktests v2 2/3] nvme/rc: Avoid triggering host nvme-cli autoconnect Date: Wed, 28 Jun 2023 17:16:22 +0200 Message-ID: <20230628151623.11340-3-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230628151623.11340-1-dwagner@suse.de> References: <20230628151623.11340-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769960982899749162?= X-GMAIL-MSGID: =?utf-8?q?1769960982899749162?= When the host has enabled the udev/systemd autoconnect services for the fc transport it interacts with blktests and make tests break. nvme-cli learned to ignore connects attemps when using the --context command line option paired with a volatile configuration. Thus we can mark all the resources created by blktests and avoid any interaction with the systemd autoconnect scripts. Only enabled this for the fc transport. Signed-off-by: Daniel Wagner --- tests/nvme/rc | 81 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 71 insertions(+), 10 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index 191f3e2e0c43..06d98f46b471 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -14,8 +14,8 @@ def_remote_wwnn="0x10001100aa000001" def_remote_wwpn="0x20001100aa000001" def_local_wwnn="0x10001100aa000002" def_local_wwpn="0x20001100aa000002" -def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" -def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" +def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:242d4a24-2484-4a80-8234-d0169409c5e8" +def_hostid="242d4a24-2484-4a80-8234-d0169409c5e8" nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} @@ -161,6 +161,57 @@ _nvme_calc_rand_io_size() { echo "${io_size_kb}k" } +_have_nvme_cli_context() { + # ignore all non-fc transports + if [[ "${nvme_trtype}" == "fc" ]] || + ! nvme connect --help 2>&1 | grep -q -- '--context=' > /dev/null; then + return 1 + fi + return 0 +} + +_setup_nvme_cli() { + local local_wwnn="${1}" + local local_wwpn="${2}" + local remote_wwnn="${3}" + local remote_wwpn="${4}" + + if ! _have_nvme_cli_context; then + return + fi + + mkdir -p /run/nvme + cat >> /run/nvme/blktests.json <<-EOF + [ + { + "hostnqn": "${def_hostnqn}", + "hostid": "${def_hostid}", + "subsystems": [ + { + "application": "blktests", + "nqn": "blktests-subsystem-1", + "ports": [ + { + "transport": "fc", + "traddr": "nn-${remote_wwnn}:pn-${remote_wwpn}", + "host_traddr": "nn-${local_wwnn}:pn-${local_wwpn}" + } + ] + } + ] + } + ] + EOF +} + +_cleanup_nvme_cli() { + if ! _have_nvme_cli_context; then + return + fi + + rm -f /run/nvme/blktests.json +} + _nvme_fcloop_add_rport() { local local_wwnn="$1" local local_wwpn="$2" @@ -193,6 +244,9 @@ _setup_fcloop() { local remote_wwnn="${3:-$def_remote_wwnn}" local remote_wwpn="${4:-$def_remote_wwpn}" + _setup_nvme_cli "${local_wwnn}" "${local_wwpn}" \ + "${remote_wwnn}" "${remote_wwpn}" + _nvme_fcloop_add_tport "${remote_wwnn}" "${remote_wwpn}" _nvme_fcloop_add_lport "${local_wwnn}" "${local_wwpn}" _nvme_fcloop_add_rport "${local_wwnn}" "${local_wwpn}" \ @@ -235,6 +289,8 @@ _cleanup_fcloop() { _nvme_fcloop_del_lport "${local_wwnn}" "${local_wwpn}" _nvme_fcloop_del_rport "${local_wwnn}" "${local_wwpn}" \ "${remote_wwnn}" "${remote_wwpn}" + + _cleanup_nvme_cli } _cleanup_nvmet() { @@ -436,18 +492,18 @@ _nvme_connect_subsys() { trtype="$1" subsysnqn="$2" - ARGS=(-t "${trtype}" -n "${subsysnqn}") + ARGS=(-t "${trtype}" + -n "${subsysnqn}" + --hostnqn="${hostnqn}" + --hostid="${hostid}") + if _have_nvme_cli_context; then + ARGS+=(--context="blktests") + fi if [[ "${trtype}" == "fc" ]] ; then ARGS+=(-a "${traddr}" -w "${host_traddr}") elif [[ "${trtype}" != "loop" ]]; then ARGS+=(-a "${traddr}" -s "${trsvcid}") fi - if [[ "${hostnqn}" != "$def_hostnqn" ]]; then - ARGS+=(--hostnqn="${hostnqn}") - fi - if [[ "${hostid}" != "$def_hostid" ]]; then - ARGS+=(--hostid="${hostid}") - fi if [[ -n "${hostkey}" ]]; then ARGS+=(--dhchap-secret="${hostkey}") fi @@ -482,7 +538,12 @@ _nvme_discover() { local host_traddr="${3:-$def_host_traddr}" local trsvcid="${3:-$def_trsvcid}" - ARGS=(-t "${trtype}") + ARGS=(-t "${trtype}" + --hostnqn="${def_hostnqn}" + --hostid="${def_hostid}") + if _have_nvme_cli_context; then + ARGS+=(--context="blktests") + fi if [[ "${trtype}" = "fc" ]]; then ARGS+=(-a "${traddr}" -w "${host_traddr}") elif [[ "${trtype}" != "loop" ]]; then From patchwork Wed Jun 28 15:16:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 113961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9023478vqr; Wed, 28 Jun 2023 08:46:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WnMaHizt/+xUXvTo0EDwHMDGvY97X4+/J21NXiFb+sZZLsqq5+mTT1rnuyugi+HNfY0W7 X-Received: by 2002:a05:6402:5202:b0:51d:ab6c:c2b4 with SMTP id s2-20020a056402520200b0051dab6cc2b4mr4976834edd.0.1687967205311; Wed, 28 Jun 2023 08:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687967205; cv=none; d=google.com; s=arc-20160816; b=mbGBPludQ97p0gVqIIkqGHy9C9Lr1lH9mkjYfw3poOhGxP9bSSU9ZFxOwzXqDmS9qE 0Of/0DgVS4Fvf6Fq1xTQA3yPcq9ZDC+cBXyRJBcCJcTxbYHnQPheCXScuqwC1Lo6tuZM Od2nAs2QoX+bgk9hmZhRaNj+vcs/cNyasaG+l1W/GRSZNJXvTYLyiWZHU/Gv8V4T3b/r cRwrS4ygDrkZK0bD8lHzFUbdZ05J/Jw3c7XoBtdD7srpznFPohC29TWOMD7+MEQL4BQi 7zACL6I5fKFBCxA+IbIOyNwGpbA5J1YmVrPBA9T/nFvoDmAVgLuwjywg/ubcPsR9cdrL nBHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=jEElvZ5EVshNboB17NtTW6FvyyqnkrFkpvjBte9fm+o=; fh=1hFOl/y8Yf4puYJGEUtFyF3ISWJIUs31OsNfiF8r3oc=; b=Rx6sSzQY+91ilZg5BzEdogFEl0ufaKuhHecsM+kevLStBOXJVryf9OjR3wJN+rvB/q /n/tVsY8+7VNAcINQKLwQmYYs5vfN7dMClVmhgCtmEeNGBKilqn7qjg50az5bT0jbQCs V4ywuPemSrbRY1DFbNVfQ/haddws6nMeFzvOy1TBSsJy9SUk5gsmjQKdrzcMNuoaBGfN Y1uvkWQ1TlKmDja/aqQIfRd/w9y3/bnJdVpKt9paYyR+XecZ42D7UNRG0OcTX9wd3I5T 9xsCEhp58LzzsGOWQKF+wBZSZV5fziBSnzMc5ODvqju0L8FbumPtsnZ9ihuLbHWAso83 G7Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AmH4QupU; dkim=neutral (no key) header.i=@suse.de header.b=LoXd7V0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020aa7de0f000000b0051dd4c0b740si267568edv.66.2023.06.28.08.46.15; Wed, 28 Jun 2023 08:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AmH4QupU; dkim=neutral (no key) header.i=@suse.de header.b=LoXd7V0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232102AbjF1PQk (ORCPT + 99 others); Wed, 28 Jun 2023 11:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbjF1PQa (ORCPT ); Wed, 28 Jun 2023 11:16:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B97A1A1; Wed, 28 Jun 2023 08:16:28 -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 5F8B82186F; Wed, 28 Jun 2023 15:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687965387; 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=jEElvZ5EVshNboB17NtTW6FvyyqnkrFkpvjBte9fm+o=; b=AmH4QupUx36ENjL2dvB+y43uaHlXnS3GcLY11OPgVkYb8mgU0CcTMC08vPZR8UnBcE59Ke IMqlQpssxMBbrmikIhFPQJ2R1pqVg0be5scp8U0Wx8X/rGRwPajbzaat+RWq8XPERmC59v 4G8wq9mXUL2D78EzryeBEtBtTK5XgbQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687965387; 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=jEElvZ5EVshNboB17NtTW6FvyyqnkrFkpvjBte9fm+o=; b=LoXd7V0qhpKEmQW06mKx/FdlAMNJeYTKkkPwp/n+m9jwUrAGOC0/HMLQO928rFbH036r8m Asyz53I9Xl2+45CQ== 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 50C9A138E8; Wed, 28 Jun 2023 15:16:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id g1psE8tOnGQ1OQAAMHmgww (envelope-from ); Wed, 28 Jun 2023 15:16:27 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , Hannes Reinecke , James Smart , Daniel Wagner Subject: [PATCH blktests v2 3/3] nvme/{041,042,043,044,045,048}: Use default hostnqn and hostid Date: Wed, 28 Jun 2023 17:16:23 +0200 Message-ID: <20230628151623.11340-4-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230628151623.11340-1-dwagner@suse.de> References: <20230628151623.11340-1-dwagner@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769961900033066584?= X-GMAIL-MSGID: =?utf-8?q?1769961900033066584?= The host might have enabled the udev/systemd auto connect feature. This disturbs the blktests for the fc transport. nvme-cli is able to distinguish between the different invocations via the --context option. In order to get this working we have to use the default hostnqn and hostid and not random generated IDs for every single run. Signed-off-by: Daniel Wagner --- tests/nvme/041 | 8 ++------ tests/nvme/042 | 8 ++------ tests/nvme/043 | 8 ++------ tests/nvme/044 | 8 ++------ tests/nvme/045 | 8 ++------ tests/nvme/048 | 8 ++------ 6 files changed, 12 insertions(+), 36 deletions(-) diff --git a/tests/nvme/041 b/tests/nvme/041 index 308655dd6090..5b04b99b128e 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -30,12 +30,8 @@ test() { echo "Running ${TEST_NAME}" - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)" if [ -z "$hostkey" ] ; then echo "nvme gen-dhchap-key failed" diff --git a/tests/nvme/042 b/tests/nvme/042 index fed2efead013..8df5ed37aacc 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -32,12 +32,8 @@ test() { echo "Running ${TEST_NAME}" - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" _setup_nvmet diff --git a/tests/nvme/043 b/tests/nvme/043 index a030884aa4ed..b591e39d0706 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -33,12 +33,8 @@ test() { echo "Running ${TEST_NAME}" - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" _setup_nvmet diff --git a/tests/nvme/044 b/tests/nvme/044 index 9928bcc55397..fca0897af27b 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -32,12 +32,8 @@ test() { echo "Running ${TEST_NAME}" - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)" if [ -z "$hostkey" ] ; then diff --git a/tests/nvme/045 b/tests/nvme/045 index 26a55335a92c..eca629a18691 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -36,12 +36,8 @@ test() { echo "Running ${TEST_NAME}" - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)" if [ -z "$hostkey" ] ; then diff --git a/tests/nvme/048 b/tests/nvme/048 index bbfb9873b5e8..a6ebb8927865 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -93,12 +93,8 @@ test() { _setup_nvmet - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" truncate -s "${nvme_img_size}" "${file_path}"