From patchwork Tue Apr 2 10:03:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13613643 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C829559162 for ; Tue, 2 Apr 2024 10:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052210; cv=none; b=r9CIay04JBBjafcYs4wcAwjj8H2Mm8rFUgDkVGM+iFIue5EnZ/EUc7U5jCvnVoAiMzoL1M3iX0SKBjbOAVcCWEvYGePzSKFwXWw7cWite0VjUHCJoobUwMay+ShZYBMV7/ThWTgLDlJlfTih6IMCMLmof1l1V8ZZTUHy+ZjcQ78= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052210; c=relaxed/simple; bh=gUN8Kn9VAJV4tgZRpH3mIEyo87ak8PtFj4iAiqRh8ms=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ijogo+9f7Q+4qqatSg3OvP7IqyVh3qjn35trUo44UYYTRVw1zOaWzORJCUO1WHPQsuzPoZeYkzeROHA/aIfe4zSC6ko35C+/Q01cB4DKx7HEJYlL/4C7/FaBsrz7J1bpeoDqn/2xDq/TLNky9KkygB4j97zq+aUZEjYPV845dhY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=S2YZKXD+; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=YtEhXuyf; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="S2YZKXD+"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="YtEhXuyf" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 18ECF3452D; Tue, 2 Apr 2024 10:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712052205; 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=0Mj2NWuR7dc4q1preQthCCIAcIisu/i5K+dIUxhLJoY=; b=S2YZKXD+Cnvwxyt3yDtQO6XVtAKhNLOc8yl1WZ95Csh0gqPglf/SjMryrxPutmYq5c1J6G 77UegE5Z0J0A4E2LBN8MNMUxO+lk33AY7sSifxgC9baBEICS6EwNpgQTCqHn1RfT2FWM1B PTTWlTqJl1lnp7djxFT15Yx47ix0jCk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712052205; 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=0Mj2NWuR7dc4q1preQthCCIAcIisu/i5K+dIUxhLJoY=; b=YtEhXuyfqxT0sCaF7oM4ckNTzLT8fWDmwWEecyWYEPMso5iQN1emkFm3igU+6Mf9PqSHt/ GwzCSG7BCSQ29IDw== Authentication-Results: smtp-out1.suse.de; dkim=none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 04D7F13A90; Tue, 2 Apr 2024 10:03:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id TltTO+zXC2b0CQAAn2gu4w (envelope-from ); Tue, 02 Apr 2024 10:03:24 +0000 From: Daniel Wagner To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v1 1/3] nvme/rc: add blkdev type environment variable Date: Tue, 2 Apr 2024 12:03:20 +0200 Message-ID: <20240402100322.17673-2-dwagner@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402100322.17673-1-dwagner@suse.de> References: <20240402100322.17673-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Score: 5.90 X-Spam-Flag: NO X-Spamd-Bar: +++++ X-Spamd-Result: default: False [5.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.98)[-0.985]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[37.34%]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:98:from] X-Spam-Level: ***** X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 18ECF3452D Introduce nvmet_blkdev_type environment variable which allows to control the target setup. This allows us to drop duplicate tests which just differ how the target is setup. Signed-off-by: Daniel Wagner --- Documentation/running-tests.md | 2 ++ tests/nvme/rc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index ae80860c917a..9cc53cb8d147 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -109,6 +109,8 @@ The NVMe tests can be additionally parameterized via environment variables. and 'G' postfix are supported. - nvme_num_iter: 1000 (default) The number of iterations a test should do. +- nvmet_blkdev_type: 'device' (default), 'file' + Select different target block device type backends. ### Running nvme-rdma and SRP tests diff --git a/tests/nvme/rc b/tests/nvme/rc index 203cf0c7903b..5fa1871f7fd8 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -21,6 +21,7 @@ export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} # TMPDIR can not be referred out of test() or test_device() context. Instead of # global variable def_flie_path, use this getter function. @@ -826,7 +827,7 @@ _find_nvme_passthru_loop_dev() { } _nvmet_target_setup() { - local blkdev_type="device" + local blkdev_type="${nvmet_blkdev_type}" local blkdev local ctrlkey="" local hostkey="" From patchwork Tue Apr 2 10:03:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13613644 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C82DB59165 for ; Tue, 2 Apr 2024 10:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052211; cv=none; b=cLpB2jfqeWX5FoDsqyovAREJfwd21ZNYFmHDEFhU3Bv7cCZwS9X6AsXULvWn/AAz8bb3tGfHQLIopvv8r1G0CHLO4s7XF4RwJXN25K0liHMkTvX7jmLqhAtpG/iDBJnOWR0Wak0djoxYlOB35OLQrXpq2RLNQBq48LVSXZiqxrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052211; c=relaxed/simple; bh=WMDexKZxw64TWHIpWGwNzMNgybYrrCS8MDMjHjhukOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UFa1a8uKr0wQ4Jp2AxcmmsVRFW7zww0M8/+olk29VpnhBIxoTm/ot2fGntEvM1wZdc8araorUb3QHagRr6YCCcf0kR3QVJucdT09+/uVWOXRvGzN44m0TwPq2MQwgOXef9R6tLs8sAXnNI0QirOd1mmjsv+r5NQtakmphWlDLjs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=BW/U5HZ9; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=gvt3TdKo; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="BW/U5HZ9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gvt3TdKo" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B40623452F; Tue, 2 Apr 2024 10:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712052205; 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=WFW7TuTe5SifRyEKLDvB5tEi/Qp3PdjCqIpBcfxajyQ=; b=BW/U5HZ9xEXnhyG19IcwPyOXqqqBpSPe2HuGURv4ScqNSV7cK/G4X37ZeSYtnwF1nDi7n3 ncOfJq+BwXZbTovvMpRlmhdxcS4q2mC51WGuPfKE4NWtLVVLfo3a7mveVdGSPeMatn0/TU touPoR1fWh3XAPZZZrIuSxiStTGRWoQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712052205; 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=WFW7TuTe5SifRyEKLDvB5tEi/Qp3PdjCqIpBcfxajyQ=; b=gvt3TdKokxpRhpQ27jHoMndhKbEhscBnX/xG+YiHLh7fS8TNKtCMocgDVUoYcARlPZ3fti GB83sYyKuiq/i9Ag== Authentication-Results: smtp-out1.suse.de; none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A1D5913A90; Tue, 2 Apr 2024 10:03:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id 9DP+Je3XC2b3CQAAn2gu4w (envelope-from ); Tue, 02 Apr 2024 10:03:25 +0000 From: Daniel Wagner To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v1 2/3] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Date: Tue, 2 Apr 2024 12:03:21 +0200 Message-ID: <20240402100322.17673-3-dwagner@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402100322.17673-1-dwagner@suse.de> References: <20240402100322.17673-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap2.dmz-prg2.suse.org:rdns,imap2.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -1.80 X-Spam-Level: X-Spam-Flag: NO There are various tests which only differ on the blkdev type of the target. With the newly added feature which allows to control the target blkdev type via the environment, these duplicate tests are not necessary anymore and reduces the maintenance overhead. Signed-off-by: Daniel Wagner --- tests/nvme/006 | 5 ++--- tests/nvme/007 | 28 --------------------------- tests/nvme/007.out | 2 -- tests/nvme/008 | 4 ++-- tests/nvme/009 | 36 ---------------------------------- tests/nvme/009.out | 3 --- tests/nvme/010 | 4 ++-- tests/nvme/011 | 39 ------------------------------------- tests/nvme/011.out | 3 --- tests/nvme/012 | 4 ++-- tests/nvme/013 | 43 ----------------------------------------- tests/nvme/013.out | 3 --- tests/nvme/014 | 4 ++-- tests/nvme/015 | 48 ---------------------------------------------- tests/nvme/015.out | 4 ---- tests/nvme/019 | 4 ++-- tests/nvme/020 | 40 -------------------------------------- tests/nvme/020.out | 4 ---- tests/nvme/023 | 4 ++-- tests/nvme/024 | 40 -------------------------------------- tests/nvme/024.out | 2 -- 21 files changed, 14 insertions(+), 310 deletions(-) delete mode 100755 tests/nvme/007 delete mode 100644 tests/nvme/007.out delete mode 100755 tests/nvme/009 delete mode 100644 tests/nvme/009.out delete mode 100755 tests/nvme/011 delete mode 100644 tests/nvme/011.out delete mode 100755 tests/nvme/013 delete mode 100644 tests/nvme/013.out delete mode 100755 tests/nvme/015 delete mode 100644 tests/nvme/015.out delete mode 100755 tests/nvme/020 delete mode 100644 tests/nvme/020.out delete mode 100755 tests/nvme/024 delete mode 100644 tests/nvme/024.out diff --git a/tests/nvme/006 b/tests/nvme/006 index d85f64b702eb..65f2a0da0441 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF target creation with a block device backed ns. +# Test NVMeOF target creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF target with a block device-backed ns" +DESCRIPTION="create an NVMeOF target" QUICK=1 requires() { @@ -20,7 +20,6 @@ test() { _setup_nvmet - _nvmet_target_setup _nvmet_target_cleanup diff --git a/tests/nvme/007 b/tests/nvme/007 deleted file mode 100755 index b14243576d32..000000000000 --- a/tests/nvme/007 +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF target creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF target with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - - _nvmet_target_setup --blkdev file - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/007.out b/tests/nvme/007.out deleted file mode 100644 index fdb347204ea8..000000000000 --- a/tests/nvme/007.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/007 -Test complete diff --git a/tests/nvme/008 b/tests/nvme/008 index a5d06818c6e4..420f9c0b1789 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF host creation with a block device backed ns. +# Test NVMeOF host creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF host with a block device-backed ns" +DESCRIPTION="create an NVMeOF host" QUICK=1 requires() { diff --git a/tests/nvme/009 b/tests/nvme/009 deleted file mode 100755 index a1655d43e56f..000000000000 --- a/tests/nvme/009 +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF host creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF host with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local nvmedev - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - nvmedev=$(_find_nvme_dev "${def_subsysnqn}") - _check_uuid "${nvmedev}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/009.out b/tests/nvme/009.out deleted file mode 100644 index 4d53a8e8ab19..000000000000 --- a/tests/nvme/009.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/009 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/010 b/tests/nvme/010 index 6feb39153e99..a3b6b2dd1478 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# This is a data verification test for block device backed ns. +# This is a data verification test. . tests/nvme/rc -DESCRIPTION="run data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run data verification fio job" TIMED=1 requires() { diff --git a/tests/nvme/011 b/tests/nvme/011 deleted file mode 100755 index eee044cbb4f8..000000000000 --- a/tests/nvme/011 +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# This is a data verification test for file backed ns. - -. tests/nvme/rc - -DESCRIPTION="run data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_fio - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - _run_fio_verify_io --size="${nvme_img_size}" \ - --filename="$/dev/{ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/011.out b/tests/nvme/011.out deleted file mode 100644 index ebbb4f7c65bf..000000000000 --- a/tests/nvme/011.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/011 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/012 b/tests/nvme/012 index 64cb6ecf0191..b09a55c63e1f 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -2,12 +2,12 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test mkfs with data verification for block device backed ns. +# Test mkfs with data verification. . tests/nvme/rc . common/xfs -DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run mkfs and data verification fio" TIMED=1 requires() { diff --git a/tests/nvme/013 b/tests/nvme/013 deleted file mode 100755 index 68d07cbc4afa..000000000000 --- a/tests/nvme/013 +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test mkfs with data verification for file backed ns. - -. tests/nvme/rc -. common/xfs - -DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_xfs - _have_fio - _require_nvme_trtype_is_fabrics - _require_nvme_test_img_size 350m -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - if ! _xfs_run_fio_verify_io "$/dev/{ns}"; then - echo "FAIL: fio verify failed" - fi - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/013.out b/tests/nvme/013.out deleted file mode 100644 index a7271700adfe..000000000000 --- a/tests/nvme/013.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/013 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/014 b/tests/nvme/014 index e56e3212cf28..2c855c89f0b7 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF flush command from host with a block device backed ns. +# Test NVMeOF flush command from host. . tests/nvme/rc -DESCRIPTION="flush a NVMeOF block device-backed ns" +DESCRIPTION="flush a command from host" QUICK=1 requires() { diff --git a/tests/nvme/015 b/tests/nvme/015 deleted file mode 100755 index f0621dab681b..000000000000 --- a/tests/nvme/015 +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF flush command from host with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="unit test for NVMe flush for file backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - local size - local bs - local count - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - size="$(blockdev --getsize64 "/dev/${ns}")" - bs="$(blockdev --getbsz "/dev/${ns}")" - count=$((size / bs)) - - dd if=/dev/urandom of="/dev/${ns}" \ - count="${count}" bs="${bs}" status=none - - nvme flush "/dev/${ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/015.out b/tests/nvme/015.out deleted file mode 100644 index f854f0b52dc0..000000000000 --- a/tests/nvme/015.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/015 -NVMe Flush: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/019 b/tests/nvme/019 index 1cd5378e9dd4..d86ca6daed31 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe DSM Discard command on NVMeOF with a block-device ns. +# Test NVMe DSM Discard command. . tests/nvme/rc -DESCRIPTION="test NVMe DSM Discard command on NVMeOF block-device ns" +DESCRIPTION="test NVMe DSM Discard command" QUICK=1 requires() { diff --git a/tests/nvme/020 b/tests/nvme/020 deleted file mode 100755 index 0364c4e0dd4f..000000000000 --- a/tests/nvme/020 +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe DSM Discard command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe DSM Discard command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - local nblk_range="10,10,10,10,10,10,10,10,10,10" - local sblk_range="100,200,300,400,500,600,700,800,900,1000" - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - nvme dsm "/dev/${ns}" --ad \ - --slbs "${sblk_range}" --blocks "${nblk_range}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/020.out b/tests/nvme/020.out deleted file mode 100644 index 61be280a64cc..000000000000 --- a/tests/nvme/020.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/020 -NVMe DSM: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/023 b/tests/nvme/023 index d8f17ae7a8ea..d6713fb30b0d 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe smart-log command on NVMeOF with a block-device ns. +# Test NVMe smart-log command. . tests/nvme/rc -DESCRIPTION="test NVMe smart-log command on NVMeOF block-device ns" +DESCRIPTION="test NVMe smart-log command" QUICK=1 requires() { diff --git a/tests/nvme/024 b/tests/nvme/024 deleted file mode 100755 index a5121940a543..000000000000 --- a/tests/nvme/024 +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe smart-log command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe smart-log command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns ${def_subsys_uuid}) - - if ! nvme smart-log "/dev/${ns}" >> "$FULL" 2>&1; then - echo "ERROR: smart-log file-ns failed" - fi - - _nvme_disconnect_subsys >> "$FULL" 2>&1 - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/024.out b/tests/nvme/024.out deleted file mode 100644 index 76c3e2931686..000000000000 --- a/tests/nvme/024.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/024 -Test complete From patchwork Tue Apr 2 10:03:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13613642 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22FDE5914E for ; Tue, 2 Apr 2024 10:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052209; cv=none; b=KoEHa51O5BFvYUk/vb8Ydca2nep2DjXdtfpMvprAOWMRo3rmycrTC8nhkOuLc6+yRTu918l/BPrWHP1EsteuLDYPMKp32XbBFhzjG99GIlacp1QOBoIKJa1uBwiSiG4nIgOmKaMFbUK9gyAbqhALyUvUrAch/8grBlfCLyB3Et8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712052209; c=relaxed/simple; bh=FZpDqaOQHNB26qEmrZo9nICzbGPtcddKw7R5aX43Lg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EEFIRFAxHkXhs4tHDztort/9cBrvh/3iHZft0Od9sSdjsdf14omHqG7Ed2s6d9FZzqw19fSlMmJcs51USgy7nVAljrUBV9By2hBIqiFCw8PJAm0ARMIR59eb00egClZVNSteQT0xP+tDJNom7Z3vWGwY0jt9p3i1fP3TljZU4xU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=PF2p1d3M; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ikVzj6bJ; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="PF2p1d3M"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ikVzj6bJ" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5B01D20F28; Tue, 2 Apr 2024 10:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712052206; 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=s1syw/qmYJOfWw4/D8WnhrMsZStryknrTjkwLRnXCC4=; b=PF2p1d3MmFueYgwJ4GM7otyo0tMSuAjKS4tsVICq7JrX27GURWDMq9dIhL/jz9St3TIScb iZr58sFFPqqIQwfAqYQLaPswBfooc0fobDB4y1fBvZbrEWNVpbN8lJU4rxoaqzGjoTfYPr js243XPaC/v1dSsUT4iXewqGWZVeVAE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712052206; 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=s1syw/qmYJOfWw4/D8WnhrMsZStryknrTjkwLRnXCC4=; b=ikVzj6bJxK7IQ1hrx7fOJBKQrVFtVM4XhMMpGoM9Q7pm7ZXpYSSWjQ6YsPLN09k9tdtObO 7YuCjxbT2CuMaPDQ== Authentication-Results: smtp-out2.suse.de; none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 480C613A90; Tue, 2 Apr 2024 10:03:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id PUghEO7XC2b9CQAAn2gu4w (envelope-from ); Tue, 02 Apr 2024 10:03:26 +0000 From: Daniel Wagner To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v1 3/3] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Date: Tue, 2 Apr 2024 12:03:22 +0200 Message-ID: <20240402100322.17673-4-dwagner@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402100322.17673-1-dwagner@suse.de> References: <20240402100322.17673-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap2.dmz-prg2.suse.org:rdns,imap2.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -1.80 X-Spam-Level: X-Spam-Flag: NO There is no need to hardcode the target blkdev type. This allows the user to select different blkdev types via the nvmet_blkdev_type environment variable. Signed-off-by: Daniel Wagner --- tests/nvme/021 | 6 +++--- tests/nvme/022 | 6 +++--- tests/nvme/025 | 6 +++--- tests/nvme/026 | 6 +++--- tests/nvme/027 | 6 +++--- tests/nvme/028 | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/nvme/021 b/tests/nvme/021 index 7ee1f078cd60..0cd6b2b4fd67 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list command on NVMeOF with a file-backed ns. +# Test NVMe list command. . tests/nvme/rc -DESCRIPTION="test NVMe list command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list command" QUICK=1 requires() { @@ -22,7 +22,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/022 b/tests/nvme/022 index 7ce33ddbf006..41dca1497a91 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe reset command on NVMeOF with a file-backed ns. +# Test NVMe reset command. . tests/nvme/rc -DESCRIPTION="test NVMe reset command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe reset command" QUICK=1 requires() { @@ -22,7 +22,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/025 b/tests/nvme/025 index 3f9a615e542e..603dc793f6a4 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe effects-log command on NVMeOF with a file-backed ns. +# Test NVMe effects-log command. . tests/nvme/rc -DESCRIPTION="test NVMe effects-log command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe effects-log" QUICK=1 requires() { @@ -22,7 +22,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/026 b/tests/nvme/026 index 28fd151d9a77..a96b40ce9cc1 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-descs command on NVMeOF with a file-backed ns. +# Test NVMe ns-descs command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-descs command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-descs" QUICK=1 requires() { @@ -22,7 +22,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/027 b/tests/nvme/027 index 053fd58f9369..9eb8f244097b 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-rescan command on NVMeOF with a file-backed ns. +# Test NVMe ns-rescan command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-rescan command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-rescan command" QUICK=1 requires() { @@ -22,7 +22,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/028 b/tests/nvme/028 index 9f4a90581984..8754bc7e8805 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list-subsys command on NVMeOF with a file-backed ns. +# Test NVMe list-subsys command. . tests/nvme/rc -DESCRIPTION="test NVMe list-subsys command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list-subsys" QUICK=1 requires() { @@ -20,7 +20,7 @@ test() { _setup_nvmet - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys