Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25886048rwd; Mon, 3 Jul 2023 02:21:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oIWQzcRQomF9c0AnboSvmo0bbGQUnN53SlpFbAJ2rSpgB0PK1gGsti+5xlD3g5Vwx5E// X-Received: by 2002:a05:6a21:9983:b0:12d:2b4f:88f5 with SMTP id ve3-20020a056a21998300b0012d2b4f88f5mr11029767pzb.42.1688376110453; Mon, 03 Jul 2023 02:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688376110; cv=none; d=google.com; s=arc-20160816; b=aPttI/b6mnzVq18x+F6FDiW8MjAiFdI47kYJeSDKmarOzvYDkh3pSup/DYIm7YUtPz aXBPlBgTSzulhkKXb2ecz3fiYBnKzevgLXBPJwKy9Fkz+Bf4Vq8F1YJYxy+6z1YVvKVn TSGBvJm5YrJJFvWFOWiz3J+mwfUFTjxJ62jnVofl/ZUp+iyohlY9XqwzAc//ZLU0sQtU cbgkkssHxgLNnqYjtcsbIgwOoKUNKMXZlqnxPzc2BLSl2WXqtj96IP0DgEU8nQ+Pa7O2 F0jf7d9WkLFqX6gmWiJE7JkIXrEwlkLJ4/r+sfX12N/IAOBC/0DGOqFWFsqZbFNhdquR s9AA== 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=lwQ11ZCMfUbee76s3nRrSEKyCvgmp2Gel3xnxd/kPGE=; fh=8iYjC+LeMO0aYseTRhkFIffYD3bgeSdBPaCkXZFvDc0=; b=x/cGNRvMn8VtmARjU7NjtDjHygZZxD/84EgioTSgLO98I79oQ1QhLrfvTsvcyHDKUs wRWpQdhjZu1X1sv7aoyZsL9XggtveHhF8CXaHoCya0+JS8CK5gqYqf6gQETBfiVggcvU bNofT9znByakjtU/16L3Nnuls8QlL0DqQsv7H5Ml7JBI6pFtDT+8q//x4Z99AoBCyYrg AMm6M9B1kjO/9Zzp+2XyKf6c0kR9QjJmqe8HODOvmiuhviBAWdyUKRJNHsk7DmTzt/rc o9UaA6pQuDzrIBWaK///cSAtEQA13KxrgYlL7b1algRk0cjA9W+l4cUy9GyW3WiS1Pju eJzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=YbvAdaHs; dkim=neutral (no key) header.i=@suse.de; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a170902988700b001b5afcfa180si18104572plp.213.2023.07.03.02.21.36; Mon, 03 Jul 2023 02:21:50 -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=YbvAdaHs; dkim=neutral (no key) header.i=@suse.de; 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 S231139AbjGCJRE (ORCPT + 99 others); Mon, 3 Jul 2023 05:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbjGCJQ6 (ORCPT ); Mon, 3 Jul 2023 05:16:58 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA264191; Mon, 3 Jul 2023 02:16:57 -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 A8DF11FD76; Mon, 3 Jul 2023 09:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688375816; 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=lwQ11ZCMfUbee76s3nRrSEKyCvgmp2Gel3xnxd/kPGE=; b=YbvAdaHs2zQbMAkwg2aFEvUVKke4jx1axyARonpkBkIYq1qZ4JqWQCAMNQmw9l2qq8tATv DSKtOuZ15kVDXqJm4Yfhn6hwwK0ctT7Dd/3nyJsdhJYQq0tdhBQrKsocY5/pM+RUv31VFf bf+veDj8jnaslQsoENzloT3nPW06X0E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688375816; 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=lwQ11ZCMfUbee76s3nRrSEKyCvgmp2Gel3xnxd/kPGE=; b=Us5QDSYjGJVTs39nuAyJdKx0428NkKHgJtr73DJDkahqT/agx5kzixI9qR/68S0tuftrZZ LnufDr/rT7avDVBw== 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 9482613276; Mon, 3 Jul 2023 09:16:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zYFoJAiSomSNDgAAMHmgww (envelope-from ); Mon, 03 Jul 2023 09:16:56 +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 v3 3/3] nvme/{041,042,043,044,045,048}: Use default hostnqn and hostid Date: Mon, 3 Jul 2023 11:16:47 +0200 Message-ID: <20230703091647.800-4-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703091647.800-1-dwagner@suse.de> References: <20230703091647.800-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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. Instead creating random generated IDs or reuse the hostnqn, it's safer to always use the same hostnqn to reduce the risk that the matching logic doesn't work. 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 ++------ tests/nvme/rc | 19 ++----------------- 7 files changed, 14 insertions(+), 53 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}" diff --git a/tests/nvme/rc b/tests/nvme/rc index 9b5442b2c07b..4f3a994d75ce 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -14,23 +14,8 @@ def_remote_wwnn="0x10001100aa000001" def_remote_wwpn="0x20001100aa000001" def_local_wwnn="0x10001100aa000002" def_local_wwpn="0x20001100aa000002" - -if [ -f "/etc/nvme/hostid" ]; then - def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)" -else - def_hostid="$(uuidgen)" -fi -if [ -z "$def_hostid" ] ; then - def_hostid="0f01fb42-9f7f-4856-b0b3-51e60b8de349" -fi - -if [ -f "/etc/nvme/hostnqn" ]; then - def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)" -fi -if [ -z "$def_hostnqn" ] ; then - def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:${def_hostid}" -fi - +def_hostid="0f01fb42-9f7f-4856-b0b3-51e60b8de349" +def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:${def_hostid}" nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} -- 2.41.0