Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp892083rdg; Fri, 11 Aug 2023 03:26:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYpnd8ZvVM8qweOxv3/83LW0wzo0GcOmMFFelozCTqJ0rU+/T7wUw3xHKJ/6gCaMSFALr9 X-Received: by 2002:aa7:c14f:0:b0:522:6e3f:b65 with SMTP id r15-20020aa7c14f000000b005226e3f0b65mr1263985edp.33.1691749597912; Fri, 11 Aug 2023 03:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691749597; cv=none; d=google.com; s=arc-20160816; b=qum60/TVqMQvP+Dn04VRL+KRz4LuX4mEjoDvSK4q4clzjEtWU+rNbh/75xoSNjeilz /L5orhfzjFvKPJ2Ce9m4BntZ4Ha8/OOwVMHbcZ9fNSn9y6PeKgkYSoCptfiypggekWXp 4k7PFFbSDk+V3lxLqz8M2qjYTsHnmB6Ac0tHkH43rLBmJwvTpHm32geHMkALHso8lRDw WgraXGPmeCNGELa8bf9rPraX3aROZljG4MaJKTXBYeFqlnTK8pz7fI0GH6AQMZsGiUqs LeC4FEWUWDjo1YPik721xyVnvPdsfQSpigAgRg4use8A4KWuFbAd3Ewg56j/mf+W3O4R eh1g== 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=wbSYEnKkGXGqX18jnJi5i9S+f6p5r42QmN0Vp86bh/4=; fh=bV6KfuSN3hKC74ZszsAG29NNR6004wMeMm9n9bF0ols=; b=YrkLH5x8lmDfpFjYdo1A4yeVAO5M9dkQTN0R6j0v8yX9tjcFDQ7AizwYGOMC/SL2Ss hqY0gO2Qmnt8RB962KZkXCWx55bBXLaLPlYfUXeVWbvKmhwZVGizdOG7Cobvbj4w6LMl Xe+ALK7F2EBLaethuguLLmLVopL/D0BNKsfYCutRqhq6XPKCRWSbpRXtikQj2B5Ge0CA LzYGB11iHpdjaSJAEiIx9cCdjbbXLbQ7fb8EsxiL28oulgKjk1Z9kwIkEau+loNKLJEd U5fFfkdvdEaCWPMdoyp5n8K4ZW2UvOjvbYcjvus0263vety/1E02mKkKTKaI1Aht5QPg H8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=RYBQEyNg; 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 u19-20020a056402111300b005223aaec697si2951737edv.576.2023.08.11.03.26.13; Fri, 11 Aug 2023 03:26:37 -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=RYBQEyNg; 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 S235234AbjHKJgz (ORCPT + 99 others); Fri, 11 Aug 2023 05:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235224AbjHKJgl (ORCPT ); Fri, 11 Aug 2023 05:36:41 -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 935E02709; Fri, 11 Aug 2023 02:36:33 -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 05B7D1F88C; Fri, 11 Aug 2023 09:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691746592; 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=wbSYEnKkGXGqX18jnJi5i9S+f6p5r42QmN0Vp86bh/4=; b=RYBQEyNgCrhzij6lDPRssP1C6WIAgjSE6bmHtclOkprByr+9vEk6c8FN0EoiQGRUTASScw dcit+8cOD2vwMV/LiGqUiinohtNTe8NXc1V/x+WxuPwv09bd7hoKipL757oeLdJYXXZMWK tr36vaAeHnQHhO0aOzpVGV7oBxT8u84= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691746592; 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=wbSYEnKkGXGqX18jnJi5i9S+f6p5r42QmN0Vp86bh/4=; b=AY+JD2RTmI1tK6HOI6gJ2AcnPXMjJRWZR71pUaKZgCpFYfH4hobCpNVsgAYy49tRCOPQQW Ax32e1nQBWLL2EBQ== 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 DDEAA138E2; Fri, 11 Aug 2023 09:36:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id e/YtNR8B1mS+HwAAMHmgww (envelope-from ); Fri, 11 Aug 2023 09:36:31 +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 , Max Gurtovoy , Hannes Reinecke , Sagi Grimberg , James Smart , Bart Van Assche , Daniel Wagner Subject: [PATCH blktests v3 06/13] nvme/{041,042,043,044,045,048}: Remove local variable hostnqn and hostid Date: Fri, 11 Aug 2023 11:36:07 +0200 Message-ID: <20230811093614.28005-7-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230811093614.28005-1-dwagner@suse.de> References: <20230811093614.28005-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,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 Commit acc408477e85 ("nvme/{041,042,043,044,045,048}: Use default hostnqn and hostid") switched the test over to use the default hostnqn. It missed the change to remove the local variable and use the def_hostnqn/def_hostid directly. Signed-off-by: Daniel Wagner --- tests/nvme/041 | 16 ++++++---------- tests/nvme/042 | 21 ++++++++------------- tests/nvme/043 | 23 +++++++++-------------- tests/nvme/044 | 27 +++++++++++---------------- tests/nvme/045 | 23 +++++++++-------------- tests/nvme/048 | 12 ++++-------- 6 files changed, 47 insertions(+), 75 deletions(-) diff --git a/tests/nvme/041 b/tests/nvme/041 index fbceaa1cb2d5..4c553251f379 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -25,14 +25,10 @@ test() { _setup_nvmet local port - local hostid - local hostnqn local file_path="${TMPDIR}/img" local hostkey local ctrldev - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" hostkey="$(nvme gen-dhchap-key -n ${def_subsysnqn} 2> /dev/null)" if [ -z "$hostkey" ] ; then echo "nvme gen-dhchap-key failed" @@ -45,21 +41,21 @@ test() { "b92842df-a394-44b1-84a4-92ae7d112861" port="$(_create_nvmet_port "${nvme_trtype}")" _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" - _create_nvmet_host "${def_subsysnqn}" "${hostnqn}" "${hostkey}" + _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" "${hostkey}" # Test unauthenticated connection (should fail) echo "Test unauthenticated connection (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" _nvme_disconnect_subsys "${def_subsysnqn}" # Test authenticated connection echo "Test authenticated connection" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -71,7 +67,7 @@ test() { _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" diff --git a/tests/nvme/042 b/tests/nvme/042 index 28d712e835df..866249ed598c 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -25,23 +25,18 @@ test() { _setup_nvmet local port - local hostid - local hostnqn local file_path="${TMPDIR}/img" local hmac local key_len local hostkey local ctrldev - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" - truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${def_subsysnqn}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")" _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" - _create_nvmet_host "${def_subsysnqn}" "${hostnqn}" + _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" for hmac in 0 1 2 3; do echo "Testing hmac ${hmac}" @@ -50,11 +45,11 @@ test() { echo "couldn't generate host key for hmac ${hmac}" return 1 fi - _set_nvmet_hostkey "${hostnqn}" "${hostkey}" + _set_nvmet_hostkey "${def_hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -68,11 +63,11 @@ test() { echo "couldn't generate host key for length ${key_len}" return 1 fi - _set_nvmet_hostkey "${hostnqn}" "${hostkey}" + _set_nvmet_hostkey "${def_hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -85,7 +80,7 @@ test() { _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" diff --git a/tests/nvme/043 b/tests/nvme/043 index 184b1254a383..5569a7a58ad5 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -26,18 +26,13 @@ test() { _setup_nvmet local port - local subsys_name="blktests-subsystem-1" - local hostid - local hostnqn local file_path="${TMPDIR}/img" local hash local dhgroup local hostkey local ctrldev - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" - hostkey="$(nvme gen-dhchap-key -n ${hostnqn} 2> /dev/null)" + hostkey="$(nvme gen-dhchap-key -n ${def_hostnqn} 2> /dev/null)" if [ -z "$hostkey" ] ; then echo "nvme gen-dhchap-key failed" return 1 @@ -48,17 +43,17 @@ test() { _create_nvmet_subsystem "${def_subsysnqn}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")" _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" - _create_nvmet_host "${def_subsysnqn}" "${hostnqn}" "${hostkey}" + _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" "${hostkey}" for hash in "hmac(sha256)" "hmac(sha384)" "hmac(sha512)" ; do echo "Testing hash ${hash}" - _set_nvmet_hash "${hostnqn}" "${hash}" + _set_nvmet_hash "${def_hostnqn}" "${hash}" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -70,11 +65,11 @@ test() { echo "Testing DH group ${dhgroup}" - _set_nvmet_dhgroup "${hostnqn}" "${dhgroup}" + _set_nvmet_dhgroup "${def_hostnqn}" "${dhgroup}" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -87,7 +82,7 @@ test() { _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" diff --git a/tests/nvme/044 b/tests/nvme/044 index 608a086a0864..6c2cb602313c 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -26,16 +26,11 @@ test() { _setup_nvmet local port - local hostid - local hostnqn local file_path="${TMPDIR}/img" local hostkey local ctrlkey local ctrldev - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" - hostkey="$(nvme gen-dhchap-key -n ${def_subsysnqn} 2> /dev/null)" if [ -z "$hostkey" ] ; then echo "failed to generate host key" @@ -53,16 +48,16 @@ test() { _create_nvmet_subsystem "${def_subsysnqn}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")" _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" - _create_nvmet_host "${def_subsysnqn}" "${hostnqn}" \ + _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" \ "${hostkey}" "${ctrlkey}" - _set_nvmet_dhgroup "${hostnqn}" "ffdhe2048" + _set_nvmet_dhgroup "${def_hostnqn}" "ffdhe2048" # Step 1: Connect with host authentication only echo "Test host authentication" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" udevadm settle @@ -73,8 +68,8 @@ test() { # and invalid ctrl authentication echo "Test invalid ctrl authentication (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" \ --dhchap-ctrl-secret "${hostkey}" @@ -86,8 +81,8 @@ test() { # and valid ctrl authentication echo "Test valid ctrl authentication" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" \ --dhchap-ctrl-secret "${ctrlkey}" @@ -100,8 +95,8 @@ test() { echo "Test invalid ctrl key (should fail)" invkey="DHHC-1:00:Jc/My1o0qtLCWRp+sHhAVafdfaS7YQOMYhk9zSmlatobqB8C:" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" \ --dhchap-ctrl-secret "${invkey}" @@ -114,7 +109,7 @@ test() { _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" diff --git a/tests/nvme/045 b/tests/nvme/045 index b8d886aaf9e8..a936e7fb661f 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -27,8 +27,6 @@ test() { _setup_nvmet local port - local hostid - local hostnqn local file_path="${TMPDIR}/img" local hostkey local new_hostkey @@ -37,9 +35,6 @@ test() { local ctrldev local rand_io_size - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" - hostkey="$(nvme gen-dhchap-key -n ${def_subsysnqn} 2> /dev/null)" if [ -z "$hostkey" ] ; then echo "failed to generate host key" @@ -57,13 +52,13 @@ test() { _create_nvmet_subsystem "${def_subsysnqn}" "${file_path}" port="$(_create_nvmet_port "${nvme_trtype}")" _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" - _create_nvmet_host "${def_subsysnqn}" "${hostnqn}" "${hostkey}" "${ctrlkey}" + _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" "${hostkey}" "${ctrlkey}" - _set_nvmet_dhgroup "${hostnqn}" "ffdhe2048" + _set_nvmet_dhgroup "${def_hostnqn}" "ffdhe2048" _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --dhchap-secret "${hostkey}" \ --dhchap-ctrl-secret "${ctrlkey}" @@ -82,7 +77,7 @@ test() { new_hostkey="$(nvme gen-dhchap-key -n ${def_subsysnqn} 2> /dev/null)" - _set_nvmet_hostkey "${hostnqn}" "${new_hostkey}" + _set_nvmet_hostkey "${def_hostnqn}" "${new_hostkey}" echo "Re-authenticate with new host key" @@ -92,7 +87,7 @@ test() { new_ctrlkey="$(nvme gen-dhchap-key -n ${def_subsysnqn} 2> /dev/null)" - _set_nvmet_ctrlkey "${hostnqn}" "${new_ctrlkey}" + _set_nvmet_ctrlkey "${def_hostnqn}" "${new_ctrlkey}" echo "Re-authenticate with new ctrl key" @@ -101,7 +96,7 @@ test() { echo "Change DH group to ffdhe8192" - _set_nvmet_dhgroup "${hostnqn}" "ffdhe8192" + _set_nvmet_dhgroup "${def_hostnqn}" "ffdhe8192" echo "Re-authenticate with changed DH group" @@ -109,7 +104,7 @@ test() { echo "Change hash to hmac(sha512)" - _set_nvmet_hash "${hostnqn}" "hmac(sha512)" + _set_nvmet_hash "${def_hostnqn}" "hmac(sha512)" echo "Re-authenticate with changed hash" @@ -127,7 +122,7 @@ test() { _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" diff --git a/tests/nvme/048 b/tests/nvme/048 index 20d234e72621..f9a19b1e655e 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -88,25 +88,21 @@ test() { local cfs_path="${NVMET_CFS}/subsystems/${def_subsysnqn}" local file_path="${TMPDIR}/img" local skipped=false - local hostnqn - local hostid local port - hostid="${def_hostid}" - hostnqn="${def_hostnqn}" - truncate -s "${nvme_img_size}" "${file_path}" _create_nvmet_subsystem "${def_subsysnqn}" "${file_path}" \ "b92842df-a394-44b1-84a4-92ae7d112861" port="$(_create_nvmet_port "${nvme_trtype}")" + _add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}" _create_nvmet_host "${def_subsysnqn}" "${def_hostnqn}" if [[ -f "${cfs_path}/attr_qid_max" ]] ; then _nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}" \ - --hostnqn "${hostnqn}" \ - --hostid "${hostid}" \ + --hostnqn "${def_hostnqn}" \ + --hostid "${def_hostid}" \ --keep-alive-tmo 1 \ --reconnect-delay 2 @@ -126,7 +122,7 @@ test() { _remove_nvmet_subsystem_from_port "${port}" "${def_subsysnqn}" _remove_nvmet_subsystem "${def_subsysnqn}" _remove_nvmet_port "${port}" - _remove_nvmet_host "${hostnqn}" + _remove_nvmet_host "${def_hostnqn}" rm "${file_path}" -- 2.41.0