From patchwork Tue Jan 7 06:19:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13928281 Received: from esa8.hc1455-7.c3s2.iphmx.com (esa8.hc1455-7.c3s2.iphmx.com [139.138.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79213186E40; Tue, 7 Jan 2025 06:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=139.138.61.253 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230775; cv=none; b=tWSotqAL6sEN8oupN8xrPcEQHm4XRIdv2017jhKFi5L4bTo+lBQA+3lv0LCuDIVwOJ5qfDmtzY05MswRTRHp114TC1IJU+jXTMmjNWhGcfdQs1Ey6ExpEDz4rIk9EXREn7r3zNO8a2KpAUABvvFfx6st/+Gg7eXqopFIYsMqhmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230775; c=relaxed/simple; bh=I1APVWtTjKQJ8fkvveWJE7WhKutYXPH1fpvfh1MPryE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jAzQaMOCNhVL1+h2QIfDhM37/5Gb37hLLyrYdq/zlOikUU9ZQoqQvg1j8X5pvnheg7ifX4r3LCrhlB5C+YmggVK8tZQHZ60czwall/ReVpOwJKCkQijKp16CGiDnHtVusCdF8YTaQZ2l5lIhg8vzw/g1exl5OsynVle8qhrmrm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=tn2eIAl/; arc=none smtp.client-ip=139.138.61.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="tn2eIAl/" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736230772; x=1767766772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I1APVWtTjKQJ8fkvveWJE7WhKutYXPH1fpvfh1MPryE=; b=tn2eIAl/rKvvq4OO5BQcyi8EqhzX4MVgIsBs081KLmdARAxCOo1UecON LBi1pWZmqzMilPHx5OwVsxDspI1BkhB/gYVyg7iETpS1wQWATD6r+CKw+ Xi9whDZytBgwf0IbGjCxC6xUN4hOTx2zgtkj2+Gw8ubvyfH49bcDh6E63 8twKVPsycZJ1geqhAwbYX7ZHzlM55mPXAyO00S+Iy6hdZjJWetcKSlg6i RdPFdeFEojBbuzGn48pIxHbW4NJxii0gbdfUG9u747FGG13hOkQ4T1WEG IFINEc7c9TQIoEgm00VwLb6V9mZ660LNkN4NrIHTQ1RyG2qFpsrqZfXMl Q==; X-CSE-ConnectionGUID: +z+iyNoRQCiFZkXSY9R/KQ== X-CSE-MsgGUID: jozPsXgzQJCD8RFNgAPmQQ== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="173787438" X-IronPort-AV: E=Sophos;i="6.12,294,1728918000"; d="scan'208";a="173787438" Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa8.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2025 15:19:23 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id B6AA5DBB81; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 8C521D4BCD; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 309C9200930D0; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from iaas-rpma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id A87381A0071; Tue, 7 Jan 2025 14:19:20 +0800 (CST) From: Li Zhijian To: linux-block@vger.kernel.org Cc: shinichiro.kawasaki@wdc.com, linux-rdma@vger.kernel.org, Li Zhijian Subject: [PATCH blktests 1/4] common/rc: test have_driver before check its driver parameter Date: Tue, 7 Jan 2025 14:19:02 +0800 Message-Id: <20250107061905.91316-2-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250107061905.91316-1-lizhijian@fujitsu.com> References: <20250107061905.91316-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28908.002 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28908.002 X-TMASE-Result: 10--5.293100-10.000000 X-TMASE-MatchedRID: JJf+xfeHh42lBA8TvXlsKoqCtN91iZAp7G01sD+Ygcw7TItwyO7eH1UV Lgjd3EiYOxmmd++ze7DWvPxiCkmZqKZY4PxfRMWEEVuC0eNRYvIBwaT6rjQidMwHSQ+yXjTDm3P fEX0yKHEi+t+0AiFaYvL3NxFKQpq1hGI7PKfQLviVF2HD8EHNp30tCKdnhB58I/9UW5M5dRNp7q EhmmPgy/cUt5lc1lLgOMB0shqXhHojxLihx43ziKaEze5aQJsciPszC5ncNk+pZmZzTVBCdfcsE I/m2fBH X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Similar to previous _have_module_param_value() and to improve efficiency and avoid unnecessary error messages, _have_module_param() should first verify the presence of the driver using _have_driver(). This change prevents redundant checks if the driver is not available. Previously, an unintended error message 'modinfo: ERROR: Module scsi_debug not found' was displayed before the test execution. For example: # ./check scsi/005 modinfo: ERROR: Module scsi_debug not found. scsi/005 (test SCSI device blacklisting) [not run] driver scsi_debug is not available module scsi_debug does not have parameter inq_vendor Signed-off-by: Li Zhijian --- common/rc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/rc b/common/rc index 0c8b51f64291..7fd178b01989 100644 --- a/common/rc +++ b/common/rc @@ -77,6 +77,8 @@ _have_module() { } _have_module_param() { + _have_driver "$1" || return + if [ -d "/sys/module/$1" ]; then if [ -e "/sys/module/$1/parameters/$2" ]; then return 0 @@ -96,10 +98,6 @@ _have_module_param_value() { local expected_value="$3" local value - if ! _have_driver "$modname"; then - return 1; - fi - if ! _have_module_param "$modname" "$param"; then return 1 fi From patchwork Tue Jan 7 06:19:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13928283 Received: from esa10.hc1455-7.c3s2.iphmx.com (esa10.hc1455-7.c3s2.iphmx.com [139.138.36.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33E9386329; Tue, 7 Jan 2025 06:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=139.138.36.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230839; cv=none; b=gjUv8R1vwWDwovM2hY6DO06AHOqoolux7p7NRND1DV003Q6Lhumou7vhSMNpeNnZg4e+DZRD8Zg26IuUt/viZ12AHB4ICjhz/pXEC1o1Qvv6NAK0Dukp6h+xhz5mH8Pj29YcQ80hTqbWYy0nVO+4y9SEgOa+la8nt7yP+eg7l3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230839; c=relaxed/simple; bh=e2Rj+DQG/pBTm9D3jPt/irqJ5vne+xaM8vK+c6hIKL8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Olgb7unjMFBNYzWiWj67SVcrrznGlpAPvtHg9RSrCgtAqwZ0imsGNCY/FhVHJ1OVVoflm04EwYv1ut3jRo6nNDbrRou/KIjYml4yHsDeyj9YWsewMLUAvH8oQzNob/lfIRdr4l/gkhoFqzg1wS0jvo0BKpK8nQ1/8+zhr2ribB8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=q2UYDZXD; arc=none smtp.client-ip=139.138.36.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="q2UYDZXD" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736230836; x=1767766836; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e2Rj+DQG/pBTm9D3jPt/irqJ5vne+xaM8vK+c6hIKL8=; b=q2UYDZXD5yKHsmJfj+CtEYJ4KU36LRwdR8zdNsH2gsWq1s0F+gG8RJZP ZRA7waZJR3VbKP5uLVbcCdvjhsjTAJwzkAeVzH02wce5B1I5MfKB2rw0h cbSGFuuIeQfnOJw/Gu238TY+lbgSrHW/PdJdwXc1NU+lTkiXfejV6+3ts NcF4FgOWub5gB+EpfoplivFFpWhdTz7OHLjSJB6bF0oBqqeSe5cETynzE FhI+kqZYGvR33UvfZkHJCpBhBNFiJTFDf2ROI64oRy6FgFkXp8FQcBkT7 SzzwcO4hQotRXltLgbNCc4vHcgKIHFkNuXqP/e+TomfGiAeEBHSeuAWjs Q==; X-CSE-ConnectionGUID: ZmUt9ss9Tv6yxw3MAuRzpw== X-CSE-MsgGUID: Fc4SeRyfSrW1KVyFC9nIWQ== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="173126636" X-IronPort-AV: E=Sophos;i="6.12,294,1728918000"; d="scan'208";a="173126636" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa10.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2025 15:19:24 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 1ABBAD4809; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id E70DBD4BCD; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 7FBD4200930D0; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from iaas-rpma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 1221A1A006C; Tue, 7 Jan 2025 14:19:21 +0800 (CST) From: Li Zhijian To: linux-block@vger.kernel.org Cc: shinichiro.kawasaki@wdc.com, linux-rdma@vger.kernel.org, Li Zhijian Subject: [PATCH blktests 2/4] tests, common: Get rid of _have_null_blk Date: Tue, 7 Jan 2025 14:19:03 +0800 Message-Id: <20250107061905.91316-3-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250107061905.91316-1-lizhijian@fujitsu.com> References: <20250107061905.91316-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28908.002 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28908.002 X-TMASE-Result: 10--7.091600-10.000000 X-TMASE-MatchedRID: JSyNGQLhEAZyeiFPOFIChErOO5m0+0gEZR+OFNkbtdotferJ/d7Ab4dY wzPgNbi6WRXM1BNPHVMl9+c89RK6DYAiks/+pdsZuce7gFxhKa3BOVz0Jwcxl6vCrG0TnfVU2d8 mtRIRsUOV1ZW035iRJPkLBfx1t6AMJnckDi37jO4gaafg6U60IwkhiZGnJS0/33Nl3elSfsoRSW zkeVnBm7lMXBKuvIsD2w7R+xUnlM5oSyaikAlECRmCYUYerLHrfS0Ip2eEHnz3IzXlXlpamPoLR 4+zsDTtGM6W3U+LnncAN/AD9AMFlpn/OQV3eSN/lKM57Su5PQ12IEuUjPaWsQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 - _have_null_blk is same with _have_driver null_blk, it seems there is no a strong opinion to keep it. - In addition, '_have_module_param null_blk' will test _have_driver first, that means it's safe to remove its former _have_driver in require() Signed-off-by: Li Zhijian --- common/null_blk | 4 ---- tests/block/006 | 2 +- tests/block/010 | 2 +- tests/block/014 | 2 +- tests/block/015 | 2 +- tests/block/016 | 2 +- tests/block/017 | 2 +- tests/block/018 | 2 +- tests/block/020 | 2 +- tests/block/021 | 2 +- tests/block/022 | 2 +- tests/block/023 | 2 +- tests/block/024 | 2 +- tests/block/029 | 2 +- tests/block/030 | 2 +- tests/block/031 | 2 +- tests/block/038 | 2 +- tests/throtl/rc | 2 +- tests/zbd/rc | 2 +- 19 files changed, 18 insertions(+), 22 deletions(-) diff --git a/common/null_blk b/common/null_blk index 164125df562d..2b5f57721c25 100644 --- a/common/null_blk +++ b/common/null_blk @@ -6,10 +6,6 @@ . common/shellcheck -_have_null_blk() { - _have_driver null_blk -} - _have_null_blk_feature() { # Ensure that null_blk driver is built-in or loaded if ! [[ -d /sys/module/null_blk ]]; then diff --git a/tests/block/006 b/tests/block/006 index 7d05b1113fb9..da909c2a0dca 100755 --- a/tests/block/006 +++ b/tests/block/006 @@ -15,7 +15,7 @@ TIMED=1 CAN_BE_ZONED=1 requires() { - _have_null_blk && _have_module_param null_blk blocking && _have_fio + _have_module_param null_blk blocking && _have_fio } test() { diff --git a/tests/block/010 b/tests/block/010 index ed5613525255..4214c17e83a5 100755 --- a/tests/block/010 +++ b/tests/block/010 @@ -15,7 +15,7 @@ TIMED=1 CAN_BE_ZONED=1 requires() { - _have_null_blk && _have_module_param null_blk shared_tags && _have_fio + _have_module_param null_blk shared_tags && _have_fio } run_fio_job() { diff --git a/tests/block/014 b/tests/block/014 index cac779b5e0f2..b118dce8f6f4 100755 --- a/tests/block/014 +++ b/tests/block/014 @@ -10,7 +10,7 @@ DESCRIPTION="run null-blk with blk-mq and timeout injection configured" requires() { - _have_null_blk && _have_module_param null_blk timeout + _have_module_param null_blk timeout } test() { diff --git a/tests/block/015 b/tests/block/015 index afb4b82ccb5b..f5b2592542e4 100755 --- a/tests/block/015 +++ b/tests/block/015 @@ -12,7 +12,7 @@ DESCRIPTION="run null-blk on different schedulers with requeue injection configu QUICK=1 requires() { - _have_null_blk && _have_module_param null_blk requeue + _have_module_param null_blk requeue } test() { diff --git a/tests/block/016 b/tests/block/016 index 775069c386bf..4a66218de42b 100755 --- a/tests/block/016 +++ b/tests/block/016 @@ -14,7 +14,7 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_null_blk + _have_driver null_blk } test() { diff --git a/tests/block/017 b/tests/block/017 index 59429b0f1359..52ed0056e37c 100755 --- a/tests/block/017 +++ b/tests/block/017 @@ -14,7 +14,7 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_null_blk + _have_driver null_blk } show_inflight() { diff --git a/tests/block/018 b/tests/block/018 index e7ac44521cae..e076714d76e0 100755 --- a/tests/block/018 +++ b/tests/block/018 @@ -11,7 +11,7 @@ DESCRIPTION="do I/O and check iostats times" QUICK=1 requires() { - _have_null_blk + _have_driver null_blk } init_times() { diff --git a/tests/block/020 b/tests/block/020 index 5ffa23248804..a59e73bdffb8 100755 --- a/tests/block/020 +++ b/tests/block/020 @@ -14,7 +14,7 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_null_blk && _have_fio + _have_driver null_blk && _have_fio } test() { diff --git a/tests/block/021 b/tests/block/021 index 525d707bce8a..b5b0ee82cbfc 100755 --- a/tests/block/021 +++ b/tests/block/021 @@ -14,7 +14,7 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_null_blk + _have_driver null_blk } test() { diff --git a/tests/block/022 b/tests/block/022 index 10851ff06ac1..42032c6c1ce0 100755 --- a/tests/block/022 +++ b/tests/block/022 @@ -12,7 +12,7 @@ DESCRIPTION="Test hang caused by freeze/unfreeze sequence" TIMED=1 requires() { - _have_null_blk && _have_module_param null_blk shared_tags + _have_module_param null_blk shared_tags _require_min_cpus 2 } diff --git a/tests/block/023 b/tests/block/023 index db1cbe04d5d8..ef48a7a77ed5 100755 --- a/tests/block/023 +++ b/tests/block/023 @@ -13,7 +13,7 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_null_blk + _have_driver null_blk } test() { diff --git a/tests/block/024 b/tests/block/024 index 2a7c934a42ca..8a303e24b6d6 100755 --- a/tests/block/024 +++ b/tests/block/024 @@ -13,7 +13,7 @@ DESCRIPTION="do I/O faster than a jiffy and check iostats times" QUICK=1 requires() { - _have_null_blk + _have_driver null_blk } init_times() { diff --git a/tests/block/029 b/tests/block/029 index b9a897dbf830..487ebc9ec326 100755 --- a/tests/block/029 +++ b/tests/block/029 @@ -11,7 +11,7 @@ DESCRIPTION="trigger blk_mq_update_nr_hw_queues()" QUICK=1 requires() { - _have_fio && _have_null_blk + _have_fio && _have_driver null_blk } modify_nr_hw_queues() { diff --git a/tests/block/030 b/tests/block/030 index 82330c2736b2..b9974b5d18e4 100755 --- a/tests/block/030 +++ b/tests/block/030 @@ -13,7 +13,7 @@ DESCRIPTION="trigger the blk_mq_realloc_hw_ctxs() error path" QUICK=1 requires() { - _have_null_blk && _have_module_param null_blk init_hctx + _have_module_param null_blk init_hctx } test() { diff --git a/tests/block/031 b/tests/block/031 index 99615ec12c34..58503e6db905 100755 --- a/tests/block/031 +++ b/tests/block/031 @@ -12,7 +12,7 @@ TIMED=1 requires() { _have_fio - _have_null_blk + _have_driver null_blk if ! _have_null_blk_feature shared_tag_bitmap; then _have_module_param null_blk shared_tag_bitmap fi diff --git a/tests/block/038 b/tests/block/038 index 56272bebb14c..fbe240c89429 100755 --- a/tests/block/038 +++ b/tests/block/038 @@ -12,7 +12,7 @@ DESCRIPTION="Test null-blk concurrent power/submit_queues operations" QUICK=1 requires() { - _have_null_blk + _have_driver null_blk if ! _have_null_blk_feature submit_queues; then SKIP_REASONS+=("null_blk does not support submit_queues") fi diff --git a/tests/throtl/rc b/tests/throtl/rc index 9c264bd39f07..4cf275216cc2 100644 --- a/tests/throtl/rc +++ b/tests/throtl/rc @@ -15,7 +15,7 @@ declare THROTL_CLEAR_CGROUP2_DIR_CONTROL_IO group_requires() { _have_root - _have_null_blk + _have_driver null_blk _have_kernel_option BLK_DEV_THROTTLING _have_cgroup2_controller io _have_program bc diff --git a/tests/zbd/rc b/tests/zbd/rc index 570928b37c88..b748d55da2c1 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -14,7 +14,7 @@ group_requires() { _have_root && _have_program blkzone && _have_program dd && - _have_kernel_option BLK_DEV_ZONED && _have_null_blk && + _have_kernel_option BLK_DEV_ZONED && _have_driver null_blk && _have_module_param null_blk zoned } From patchwork Tue Jan 7 06:19:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13928284 Received: from esa10.hc1455-7.c3s2.iphmx.com (esa10.hc1455-7.c3s2.iphmx.com [139.138.36.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C6AA1DE4CC; Tue, 7 Jan 2025 06:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=139.138.36.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230843; cv=none; b=W8HsQeReyHJl2+kj5DLPKEbs7RfzqqMscZxB2OyghrN3CfjMZgzsADEhWDp5chbt7LaeLzh+mrHl2+at6UghU1zIMpIc6RxzJfvxNOwGq+8rg0Nd49okCn6xVxuMCth2HQQfiSXeAq3nukXjm+g2qvtwqkl+KFVeuWGn7uHzQ/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230843; c=relaxed/simple; bh=ZgUPLUm6NtAJ7G1MkU1q5K8vw4t1y80egxcgYXDWINc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hnshkTyZHefZ8IVN+Z5P3T7phzzPRYAIrZUpnk3g9oFssEbJuJokAbYNiTyVxYmu78TW6D6mLLMKcRpT+H5OdRCfZZuwRi3R0h2ogy/s6Y/JrQm2mJxfMjlKqadtkdkuLN7gYIacosqOlTsJl6+sKkNYxSM9NtSWZcqXpbTSJTg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=l74CRL8z; arc=none smtp.client-ip=139.138.36.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="l74CRL8z" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736230840; x=1767766840; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZgUPLUm6NtAJ7G1MkU1q5K8vw4t1y80egxcgYXDWINc=; b=l74CRL8zsP45gbNamjJSmBVR0diqocBHfPj+jykPt0cspK3oAdf5mRkK 2atfwoirklzY389g5AfJFMw2kemKR/vkUPN7cwnynIQ+f5Hat5pS/8NKD N4Ny9bIQCrxqCHif5jAAWgIgVCqaMUfkt2AVUK88qLUAiNU6unVQFX7/A EEN9P3ES6XSPr0494E/G2hQ1WcpTF8PJWXVMDyMQfYFKlXhgzSx+923kI PBzjPkyV5XEExN7VRTOH+srSLlQ0xZd8sVF0vOnLEL9Xb/rOZ0PnKhqge GFqOprWPj6USjNGM41CiKZQOsozPbgVclywZsb+La1kCJpUvH9GVQbOLi Q==; X-CSE-ConnectionGUID: hIj0CKxETrmNgqDW/Gsd3g== X-CSE-MsgGUID: +CMN7YNJQHmlBeXMyDaz9g== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="173126637" X-IronPort-AV: E=Sophos;i="6.12,294,1728918000"; d="scan'208";a="173126637" Received: from unknown (HELO oym-r2.gw.nic.fujitsu.com) ([210.162.30.90]) by esa10.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2025 15:19:24 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id 67602D4C39; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 40C09BF4AB; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id D24F1200930D0; Tue, 7 Jan 2025 15:19:21 +0900 (JST) Received: from iaas-rpma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 6427B1A0071; Tue, 7 Jan 2025 14:19:21 +0800 (CST) From: Li Zhijian To: linux-block@vger.kernel.org Cc: shinichiro.kawasaki@wdc.com, linux-rdma@vger.kernel.org, Li Zhijian Subject: [PATCH blktests 3/4] common, new, tests: Get rid of _have_scsi_debug Date: Tue, 7 Jan 2025 14:19:04 +0800 Message-Id: <20250107061905.91316-4-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250107061905.91316-1-lizhijian@fujitsu.com> References: <20250107061905.91316-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28908.002 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28908.002 X-TMASE-Result: 10--10.855800-10.000000 X-TMASE-MatchedRID: i9okT3N59sRyeiFPOFIChAKDWtq/hHcNZR+OFNkbtdotferJ/d7Ab4dY wzPgNbi6WRXM1BNPHVMl9+c89RK6DT4xnGicftABPKN38CLPK0EJlr1xKkE5ucC5DTEMxpeQfiq 1gj2xET9lzP9S78W1g/LrCuvw7b1ajFPmi+lHwssM6z3iDvziB1G+BHSGRsbgrSvLRRRfRG3ynQ xWKo+F0WLmeWLY1Nl9VIzQ5SmwuhfNR0Df05Sd2azGfgakLdjaWfgivgcUPZO4GyTmeN+AbBy7M kaYvOFgIqkJ48VX5FCnyJ66hArF5gzyMxeMEX6wFEUknJ/kEl7dB/CxWTRRu25FeHtsUoHukA8s tzMxEw20lv6gyFgQgophNKO2oMBJCLN8McZaXwJLDBwYotNgRw== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 - _have_scsi_debug is same with _have_driver scsi_debug, it seems there is no a strong opinion to keep it. - In addition, '_have_module_param scsi_debug' will test _have_driver first, that means it's safe to remove its former _have_driver in requires() Signed-off-by: Li Zhijian --- common/scsi_debug | 4 ---- new | 2 +- tests/block/001 | 2 +- tests/block/002 | 2 +- tests/block/027 | 2 +- tests/block/037 | 2 +- tests/scsi/004 | 2 +- tests/scsi/005 | 1 - 8 files changed, 6 insertions(+), 11 deletions(-) diff --git a/common/scsi_debug b/common/scsi_debug index 594883c95713..9997afa0154c 100644 --- a/common/scsi_debug +++ b/common/scsi_debug @@ -4,10 +4,6 @@ # # scsi_debug helper functions. -_have_scsi_debug() { - _have_driver scsi_debug -} - SD_PARAM_PATH=/sys/module/scsi_debug/parameters SD_PSEUDO_PATH=/sys/bus/pseudo/drivers/scsi_debug diff --git a/new b/new index d84f01d62e30..fe2cb6a12242 100755 --- a/new +++ b/new @@ -261,7 +261,7 @@ test() { # E.g., TEST_NAME and GROUPS. Variables local to the test are lowercase # with underscores. # - Functions defined by the testing framework or group scripts, including -# helpers, have a leading underscore. E.g., _have_scsi_debug. Functions local +# helpers, have a leading underscore. E.g., _have_driver. Functions local # to the test should not have a leading underscore. # - Both [[ ]] form and [ ] form are fine for tests. [[ ]] is preferred. # - Always quote variable expansions unless the variable is a number or inside of diff --git a/tests/block/001 b/tests/block/001 index 32dd22f8481a..3f576fa0e1b5 100755 --- a/tests/block/001 +++ b/tests/block/001 @@ -13,7 +13,7 @@ DESCRIPTION="stress device hotplugging" TIMED=1 requires() { - _have_scsi_debug + _have_driver scsi_debug _have_kernel_option BLK_DEV_SD _have_driver sr_mod } diff --git a/tests/block/002 b/tests/block/002 index 65b0fbdd9800..c57e27dee30d 100755 --- a/tests/block/002 +++ b/tests/block/002 @@ -13,7 +13,7 @@ QUICK=1 requires() { _have_blktrace - _have_scsi_debug + _have_driver scsi_debug } test() { diff --git a/tests/block/027 b/tests/block/027 index f59dad2f231c..317c06db0fa9 100755 --- a/tests/block/027 +++ b/tests/block/027 @@ -20,7 +20,7 @@ CAN_BE_ZONED=1 requires() { _have_cgroup2_controller io - _have_scsi_debug + _have_driver scsi_debug _have_fio } diff --git a/tests/block/037 b/tests/block/037 index 6ecbe3731194..bdffcae13a9a 100755 --- a/tests/block/037 +++ b/tests/block/037 @@ -19,7 +19,7 @@ QUICK=1 requires() { _have_cgroup2_controller io - _have_scsi_debug + _have_driver scsi_debug } scsi_debug_rebind() { diff --git a/tests/scsi/004 b/tests/scsi/004 index 7d0af54415de..4fe48182425a 100755 --- a/tests/scsi/004 +++ b/tests/scsi/004 @@ -18,7 +18,7 @@ DESCRIPTION="ensure repeated TASK SET FULL results in EIO on timing out command" CAN_BE_ZONED=1 requires() { - _have_scsi_debug + _have_driver scsi_debug } test() { diff --git a/tests/scsi/005 b/tests/scsi/005 index bfa1014d4ea3..f8d9b30c6894 100755 --- a/tests/scsi/005 +++ b/tests/scsi/005 @@ -11,7 +11,6 @@ DESCRIPTION="test SCSI device blacklisting" QUICK=1 requires() { - _have_scsi_debug _have_module_param scsi_debug inq_vendor } From patchwork Tue Jan 7 06:19:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13928280 Received: from esa11.hc1455-7.c3s2.iphmx.com (esa11.hc1455-7.c3s2.iphmx.com [207.54.90.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D815ECC; Tue, 7 Jan 2025 06:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.54.90.137 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230771; cv=none; b=sI5oazhqZhy5TNPTnozIEcQHpPKkE57nFbpFDXKn1oRHCps2kZmG/iSbdgMQ0BfPCA1TTjRe4acoXkyDtVHdCcbBryEgVyvpaHQLOh+YgcaQXoEalL3XYJrqsPI9ovfaofimXjXWwuBG00HVAjGfIjXbSbh3e/v5DfL3AXLjrrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736230771; c=relaxed/simple; bh=NI6JH9iT5qHVXHDP/LOTawpHG9ll45C7goXtbBd1IFY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IzSr5UIyyyLgU1hjYmWT0m0EI8TWUABeYUIsEAoGG03C4zTM1ngnGZb1zQqLtEQxhIpaER/DMqQa19zH5oCh3bibxS/nfrgV2be90GGPYwTSH6626jCe9UAWrzBCXZ+Ss0ihUR5+wjcRuc64EfxIqix+Am8dVs4PY7YBvq4Fgcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=boOwIFwv; arc=none smtp.client-ip=207.54.90.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="boOwIFwv" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1736230769; x=1767766769; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NI6JH9iT5qHVXHDP/LOTawpHG9ll45C7goXtbBd1IFY=; b=boOwIFwvKyH/BLAsQ/8/3ltZzTziZ//38a0vthMFrMQNvjndDKjoPipp LTSEYQzeOuLxL2GNIB1IC9f3ffiGLsRBLTfkdRG0xOHHr8QpQOxmLiS2M Zl4Lvfn62rFXQqkzPq+wRuluAVlI1bqrTyRNtb9uAD5B6B6b/rkrEDOJR 0Rs5A7KTIDZqHZACc03PsQcC7WjMMAoQFJ78WnSs0pXdHd/EGjuYm/dpa HeAb+BA+Z0F7IVoE9ATfjbhRp03pduPjQiBHOddjhyGqC78D3FHR+7Chl BhhQjTRO93hec4jz+qBMqxZMZWYFdr87raop/AXDcBUXXBaHU2i3HnH5e Q==; X-CSE-ConnectionGUID: 4TQ4CIkeQFOawhOeaczQqA== X-CSE-MsgGUID: q8zN211AR8WBQ2M4jwsxlA== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="165252572" X-IronPort-AV: E=Sophos;i="6.12,294,1728918000"; d="scan'208";a="165252572" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2025 15:19:25 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id CAA2EC2264; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 9F133D4BC0; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab4.gw.nic.fujitsu.com (Postfix) with ESMTP id 30745216F79; Tue, 7 Jan 2025 15:19:22 +0900 (JST) Received: from iaas-rpma.. (unknown [10.167.135.44]) by edo.cn.fujitsu.com (Postfix) with ESMTP id B7C451A006C; Tue, 7 Jan 2025 14:19:21 +0800 (CST) From: Li Zhijian To: linux-block@vger.kernel.org Cc: shinichiro.kawasaki@wdc.com, linux-rdma@vger.kernel.org, Li Zhijian Subject: [PATCH blktests 4/4] tests: Remove unnecessary '&&' in requires() functions Date: Tue, 7 Jan 2025 14:19:05 +0800 Message-Id: <20250107061905.91316-5-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250107061905.91316-1-lizhijian@fujitsu.com> References: <20250107061905.91316-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28908.002 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28908.002 X-TMASE-Result: 10--11.205000-10.000000 X-TMASE-MatchedRID: RKkR8WK0E1pzKOD0ULzeCUocPLxXXRnc2FA7wK9mP9fVjNsehGf0vYCM NBUmTo/EbHP8nE7bb5lqbopjo8dma4grKnsJ1GRgTuctSpiuWyUUi4Ehat05499RlPzeVuQQhFA nTzcsrmXg8q4Y37zKTYU/92886D4nfDPEC/yQgPTX3j/lf1V8LI5UafLmrvaGWH7Bxw4ADCMteS BVDS/hE/4d9MHlVjaYI+TRxIThX/6TPnkx1lLj8iZm6wdY+F8KWQ3R4k5PTnDkHRyu9DvWvaPFj JEFr+olwXCBO/GKkVqOhzOa6g8KrRnOS8UsoNM+oThT7rELRkxVf8g5JXXW7OPezYdPWyvXtNUO mYw1+Do= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 The '&&' operator should only be used when the second operand is dependent on the first. In the context of requires() functions, we prefer to evaluate all conditions independently to display all SKIP_REASONS at once. This change separates the conditions into individual lines to ensure each condition is evaluated regardless of the others. After this patch, only 2 '&&' remain $ git grep -wl 'requires()' | xargs -I {} sed -n '/^requires() *{/,/}/p' {} | grep '&&' _have_module nvme_tcp && _have_module_param nvme_tcp ddp_offload _have_program mkfs.btrfs && have_good_mkfs_btrfs Signed-off-by: Li Zhijian --- tests/block/006 | 3 ++- tests/block/008 | 3 ++- tests/block/010 | 3 ++- tests/block/011 | 3 ++- tests/block/019 | 3 ++- tests/block/020 | 3 ++- tests/block/029 | 3 ++- tests/loop/002 | 4 +++- tests/nbd/001 | 4 +++- tests/nbd/002 | 3 ++- tests/nbd/003 | 3 ++- tests/nvme/005 | 3 ++- tests/nvme/010 | 3 ++- tests/nvme/039 | 4 ++-- tests/nvme/056 | 4 +++- tests/scsi/001 | 3 ++- tests/scsi/002 | 3 ++- 17 files changed, 37 insertions(+), 18 deletions(-) diff --git a/tests/block/006 b/tests/block/006 index da909c2a0dca..d7b295938301 100755 --- a/tests/block/006 +++ b/tests/block/006 @@ -15,7 +15,8 @@ TIMED=1 CAN_BE_ZONED=1 requires() { - _have_module_param null_blk blocking && _have_fio + _have_module_param null_blk blocking + _have_fio } test() { diff --git a/tests/block/008 b/tests/block/008 index cd0935259157..859c0fe7d85e 100755 --- a/tests/block/008 +++ b/tests/block/008 @@ -12,7 +12,8 @@ TIMED=1 CAN_BE_ZONED=1 requires() { - _have_cpu_hotplug && _have_fio + _have_cpu_hotplug + _have_fio } test_device() { diff --git a/tests/block/010 b/tests/block/010 index 4214c17e83a5..a85b138d6912 100755 --- a/tests/block/010 +++ b/tests/block/010 @@ -15,7 +15,8 @@ TIMED=1 CAN_BE_ZONED=1 requires() { - _have_module_param null_blk shared_tags && _have_fio + _have_module_param null_blk shared_tags + _have_fio } run_fio_job() { diff --git a/tests/block/011 b/tests/block/011 index 63212122a736..662f41c301ce 100755 --- a/tests/block/011 +++ b/tests/block/011 @@ -24,7 +24,8 @@ pci_dev_mounted() { } requires() { - _have_fio && _have_program setpci + _have_fio + _have_program setpci } device_requires() { diff --git a/tests/block/019 b/tests/block/019 index 58aca4cc1020..723eb61350f9 100755 --- a/tests/block/019 +++ b/tests/block/019 @@ -11,7 +11,8 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_fio && _have_program setpci + _have_fio + _have_program setpci } device_requires() { diff --git a/tests/block/020 b/tests/block/020 index a59e73bdffb8..a8bbb3585d0f 100755 --- a/tests/block/020 +++ b/tests/block/020 @@ -14,7 +14,8 @@ QUICK=1 CAN_BE_ZONED=1 requires() { - _have_driver null_blk && _have_fio + _have_driver null_blk + _have_fio } test() { diff --git a/tests/block/029 b/tests/block/029 index 487ebc9ec326..d9a9003a503e 100755 --- a/tests/block/029 +++ b/tests/block/029 @@ -11,7 +11,8 @@ DESCRIPTION="trigger blk_mq_update_nr_hw_queues()" QUICK=1 requires() { - _have_fio && _have_driver null_blk + _have_fio + _have_driver null_blk } modify_nr_hw_queues() { diff --git a/tests/loop/002 b/tests/loop/002 index d0ef964989e6..07b9c6c53c9c 100755 --- a/tests/loop/002 +++ b/tests/loop/002 @@ -15,7 +15,9 @@ DESCRIPTION="try various loop device block sizes" QUICK=1 requires() { - _have_program xfs_io && _have_src_program loblksize && _have_loop_set_block_size + _have_program xfs_io + _have_src_program loblksize + _have_loop_set_block_size } test() { diff --git a/tests/nbd/001 b/tests/nbd/001 index 0975af0543e2..cc083e3ce6ed 100755 --- a/tests/nbd/001 +++ b/tests/nbd/001 @@ -11,7 +11,9 @@ DESCRIPTION="resize a connected nbd device" QUICK=1 requires() { - _have_nbd && _have_program parted && _have_src_program nbdsetsize + _have_nbd + _have_program parted + _have_src_program nbdsetsize } test() { diff --git a/tests/nbd/002 b/tests/nbd/002 index 8e4e062eba66..00701b11236d 100755 --- a/tests/nbd/002 +++ b/tests/nbd/002 @@ -17,7 +17,8 @@ DESCRIPTION="tests on partition handling for an nbd device" QUICK=1 requires() { - _have_nbd_netlink && _have_program parted + _have_nbd_netlink + _have_program parted } test() { diff --git a/tests/nbd/003 b/tests/nbd/003 index 57fb63a9e70f..4fabdebc8f6a 100755 --- a/tests/nbd/003 +++ b/tests/nbd/003 @@ -11,7 +11,8 @@ DESCRIPTION="mount/unmount concurrently with NBD_CLEAR_SOCK" QUICK=1 requires() { - _have_nbd && _have_src_program mount_clear_sock + _have_nbd + _have_src_program mount_clear_sock } test() { diff --git a/tests/nvme/005 b/tests/nvme/005 index 66c12fdb7d8d..8fc1f574ce3d 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -12,7 +12,8 @@ QUICK=1 requires() { _nvme_requires - _have_loop && _have_module_param_value nvme_core multipath Y + _have_loop + _have_module_param_value nvme_core multipath Y _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/010 b/tests/nvme/010 index a5ddf581ecc9..58c8693b1373 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -11,7 +11,8 @@ TIMED=1 requires() { _nvme_requires - _have_fio && _have_loop + _have_fio + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/039 b/tests/nvme/039 index eca8ba35475e..ab58f3b91c7d 100755 --- a/tests/nvme/039 +++ b/tests/nvme/039 @@ -14,8 +14,8 @@ QUICK=1 requires() { _have_program nvme - _have_kernel_option FAULT_INJECTION && \ - _have_kernel_option FAULT_INJECTION_DEBUG_FS + _have_kernel_option FAULT_INJECTION + _have_kernel_option FAULT_INJECTION_DEBUG_FS } device_requires() { diff --git a/tests/nvme/056 b/tests/nvme/056 index d4dda2d98b91..958c2e31165c 100755 --- a/tests/nvme/056 +++ b/tests/nvme/056 @@ -30,7 +30,9 @@ requires() { _have_fio _have_program ip _have_program ethtool - _have_kernel_source && _have_program python3 && have_netlink_cli + _have_kernel_source + _have_program python3 + have_netlink_cli have_iface } diff --git a/tests/scsi/001 b/tests/scsi/001 index 54ca58227659..9e43c8dfbd11 100755 --- a/tests/scsi/001 +++ b/tests/scsi/001 @@ -11,7 +11,8 @@ DESCRIPTION="try triggering a kernel GPF with 0 byte SG reads" QUICK=1 requires() { - _have_scsi_generic && _have_src_program sg/syzkaller1 + _have_scsi_generic + _have_src_program sg/syzkaller1 } test_device() { diff --git a/tests/scsi/002 b/tests/scsi/002 index b38706447f83..82e9d8a554ca 100755 --- a/tests/scsi/002 +++ b/tests/scsi/002 @@ -11,7 +11,8 @@ DESCRIPTION="perform a SG_DXFER_FROM_DEV from the /dev/sg read-write interface" QUICK=1 requires() { - _have_scsi_generic && _have_src_program sg/dxfer-from-dev + _have_scsi_generic + _have_src_program sg/dxfer-from-dev } test_device() {