From patchwork Wed Jun 1 06:48:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 655B0C433EF for ; Wed, 1 Jun 2022 06:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244928AbiFAGsp (ORCPT ); Wed, 1 Jun 2022 02:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGso (ORCPT ); Wed, 1 Jun 2022 02:48:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 261C4880E4 for ; Tue, 31 May 2022 23:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=WdNJluqO2nvQx7Te91LUyH5keKJXqSIR9nGmaOv4DdA=; b=xg/hYTVXR4DhgIxGvcoyNNypGU NlZeF01V8EiXPpMZJ6wJ+W0Dar3f40dOrpRfn9PsoHL2TT303UJQMwazW+dSHWCpL0KYZYtj+2cmS rLJeFZHf6U4ZTQ6u2hobpb5JdWj1PXjg3Hv28skgMLf1YMi17sB75svo7D/YYoxbsTsJJKMp/oxzl p4WxGPjbVdeeOfXxKCRXaGaSPF3lPhhl+w9RUHB0+qq0eNCQF/GDdnZb3wtSeSxA/pdUWcpnqSeoj n1lurvTiIhs6dyl9sa1qE9zp2xw0Jie9HLFLKU/BlVIgvz5ytxHS8FnYOzyHBhc8pvM0Hh0GRjZjY GVYrtoaA==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwI9q-00EET6-C2; Wed, 01 Jun 2022 06:48:42 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 1/7] nvme: use _have_loop instead of _have_modules loop Date: Wed, 1 Jun 2022 08:48:31 +0200 Message-Id: <20220601064837.3473709-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Also check for the losetup existance. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- tests/nvme/002 | 2 +- tests/nvme/003 | 2 +- tests/nvme/004 | 2 +- tests/nvme/005 | 3 +-- tests/nvme/006 | 2 +- tests/nvme/008 | 2 +- tests/nvme/010 | 2 +- tests/nvme/012 | 2 +- tests/nvme/014 | 2 +- tests/nvme/015 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 2 +- tests/nvme/030 | 2 +- tests/nvme/031 | 2 +- 23 files changed, 23 insertions(+), 24 deletions(-) diff --git a/tests/nvme/002 b/tests/nvme/002 index ca11c11..6c6ae5f 100755 --- a/tests/nvme/002 +++ b/tests/nvme/002 @@ -11,7 +11,7 @@ DESCRIPTION="create many subsystems and test discovery" requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_loop } diff --git a/tests/nvme/003 b/tests/nvme/003 index 101c184..2ba6954 100755 --- a/tests/nvme/003 +++ b/tests/nvme/003 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/004 b/tests/nvme/004 index 4b0b7ae..9dda538 100755 --- a/tests/nvme/004 +++ b/tests/nvme/004 @@ -13,7 +13,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/005 b/tests/nvme/005 index 9f3e388..de567a7 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -12,8 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules 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/006 b/tests/nvme/006 index 9230dc6..d993861 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/008 b/tests/nvme/008 index 219fe9b..5568fe4 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/010 b/tests/nvme/010 index 08e39d5..b7b1d51 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -11,7 +11,7 @@ TIMED=1 requires() { _nvme_requires - _have_fio && _have_modules loop + _have_fio && _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/012 b/tests/nvme/012 index 6bb4972..c9d2438 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -14,7 +14,7 @@ requires() { _nvme_requires _have_xfs _have_fio - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/014 b/tests/nvme/014 index 48f8caa..d13cff7 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/015 b/tests/nvme/015 index e33cfde..bb52ba2 100755 --- a/tests/nvme/015 +++ b/tests/nvme/015 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/018 b/tests/nvme/018 index 7f407da..315e795 100755 --- a/tests/nvme/018 +++ b/tests/nvme/018 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/019 b/tests/nvme/019 index 8259e2e..4cb3509 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/021 b/tests/nvme/021 index fb77f9c..6ee0af1 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/022 b/tests/nvme/022 index 62c4690..1d76ffa 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/023 b/tests/nvme/023 index bce21b5..b65be07 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/024 b/tests/nvme/024 index ffec36c..f756797 100755 --- a/tests/nvme/024 +++ b/tests/nvme/024 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/025 b/tests/nvme/025 index 3d3f01b..941bf36 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/026 b/tests/nvme/026 index 2f56077..c3f06c2 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/027 b/tests/nvme/027 index 53f0664..0ad663a 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/028 b/tests/nvme/028 index 3d9084f..7de977a 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/029 b/tests/nvme/029 index 960e5f5..f8b4cbb 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/030 b/tests/nvme/030 index c6d485e..20fef69 100755 --- a/tests/nvme/030 +++ b/tests/nvme/030 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/031 b/tests/nvme/031 index 7c18a64..4e17982 100755 --- a/tests/nvme/031 +++ b/tests/nvme/031 @@ -19,7 +19,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } From patchwork Wed Jun 1 06:48:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8D57C433FE for ; Wed, 1 Jun 2022 06:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245200AbiFAGsr (ORCPT ); Wed, 1 Jun 2022 02:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGsq (ORCPT ); Wed, 1 Jun 2022 02:48:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAF238A07E for ; Tue, 31 May 2022 23:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4ZULPl6/bgc4rYT72v1VzqAcaRtZUwHkWk/hSj8RA4U=; b=xxtjp1d56zUXxdpspxNav9FT06 2+AqmY87tV9/91KH/D/jVssYJAjV2K0uw+rvFZf6oXc/slPp75ZYFdzVJHRtTIfLEUDTuIX6F4saM jxEw4W67b8jj7qgieD/B9vE0NwaHS9OXPzTDXOupeL8ocFaNThGTQWS8F7UiOKp5YvZ1DOV6g/ulv XjAtlcyP1u6qKvB2QiK/1M2EvA8XqYRb9wrlr47VR5/U346LJuJ9H8rbJMAsa466Gf6DDsJcCmy67 bNMOFtCSC6FZe3goMmbzNxkaxMQsictymC7gNG/PhSDaQS50FRQb4yIV1RPe4qBmNNj9DzgTgne7H bsIrMAvQ==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwI9t-00EEUD-1e; Wed, 01 Jun 2022 06:48:45 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 2/7] common: add a helper if a driver is available Date: Wed, 1 Jun 2022 08:48:32 +0200 Message-Id: <20220601064837.3473709-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Unlike _have_modules this allows allows for a built-in driver. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- common/rc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/rc b/common/rc index 5e35e21..2d0fd88 100644 --- a/common/rc +++ b/common/rc @@ -28,6 +28,18 @@ _have_root() { return 0 } +_have_driver() +{ + local modname="${1/-/_}" + + if [ ! -d "/sys/module/${modname}" ] && ! modprobe -q "${modname}"; then + SKIP_REASON="driver ${modname} is not available" + return 1 + fi + + return 0 +} + _have_modules() { local missing=() local module From patchwork Wed Jun 1 06:48:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F4227C433F5 for ; Wed, 1 Jun 2022 06:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245359AbiFAGsu (ORCPT ); Wed, 1 Jun 2022 02:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGst (ORCPT ); Wed, 1 Jun 2022 02:48:49 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BFE88FFBE for ; Tue, 31 May 2022 23:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=QVPuNgTa2ZGrVy2RToahyPDiQjKK8qsqdpzHQJJR/0g=; b=DSDaIt2UNAAST69Gx11cacL4ka f4UyynBhTjHDakZybdZoUxv3i+YZEg+dPA3vMMgJwpQX7FwG3H2ZUiL0SYGtqtYcGk+Zxx3/JGyYV D1VPQ5gBPWuJyR9HcT5bg4FTAHbNHePAeN4+9v0nStHTseiC3VAtDHhDzQ9sUoM35ecaUpDE3Xm7P AYfaX2Cseo6gKLATvtACvs1qK9fd6GFtooK1wbBpf8YYJKxdAPMuVkLKmkjdmFtqlt6G97aZUcSAW i6e7y8WjIAIPuAk3sbyEtCapXU7KABb+k+AoICTB/LPL6LubAiNN8NZ3bi2J5JXvP9R0qC0dnpiNX WSwg2MFw==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwI9v-00EEUZ-Ne; Wed, 01 Jun 2022 06:48:48 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 3/7] common: fix _have_module_param_value to work with built-in drivers Date: Wed, 1 Jun 2022 08:48:33 +0200 Message-Id: <20220601064837.3473709-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Don't bother to call modprobe directly and just check the /sys/module/ directory. Also switch to using descriptive variable names for the parameters. Signed-off-by: Christoph Hellwig --- common/rc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/rc b/common/rc index 2d0fd88..c4df814 100644 --- a/common/rc +++ b/common/rc @@ -74,17 +74,22 @@ _have_module_param() { } _have_module_param_value() { + local modname="${1/-/_}" + local param="$2" + local expected_value="$3" local value - modprobe "$1" + if ! _have_driver "$modname"; then + return 1; + fi - if ! _have_module_param "$1" "$2"; then + if ! _have_module_param "$modname" "$param"; then return 1 fi - value=$(cat "/sys/module/$1/parameters/$2") - if [[ "${value}" != "$3" ]]; then - SKIP_REASON="$1 module parameter $2 must be set to $3" + value=$(cat "/sys/module/$modname/parameters/$param") + if [[ "${value}" != "$expected_value" ]]; then + SKIP_REASON="$modname module parameter $param must be set to $expected_value" return 1 fi From patchwork Wed Jun 1 06:48:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93193C433F5 for ; Wed, 1 Jun 2022 06:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245367AbiFAGsx (ORCPT ); Wed, 1 Jun 2022 02:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGsw (ORCPT ); Wed, 1 Jun 2022 02:48:52 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCA38FFBE for ; Tue, 31 May 2022 23:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ZdYkHBG6cL6uaRc7mljfUIEJC/yqn35LG4kq2LLkuiY=; b=YCGSY/QuwrgPnpZRswqz0KC073 6oSo5A6rM8b8LGvJN41SB304TIkp9dySdK8XL7QG84mOkeL3Nigsp2RPDgT6E5B3K/AFA5fy6SmxM C/QmNwY1Sj427NRDVGQEbJ36r5Ma0fUi1cmSQf9luImg7YaRCEaw/429zwlPmtfrYjlSFVR5O8XXZ FkMdTEwFrWF5Mtap/UQhvb3GCvlDDoHNhgueZS8sOoGiBA3CRhojaIbv/DayWNg25uqkTtYvdEqOV luUUT7z8kv8TA4j6rtopRZngAXwnMQ/KzAiDihGyi63n97sZqlFoM1SqklWmD7Lr4iIII6a1UTZx1 ziasTADA==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwI9y-00EEWB-BO; Wed, 01 Jun 2022 06:48:50 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 4/7] common: do not require loop support to be modular Date: Wed, 1 Jun 2022 08:48:34 +0200 Message-Id: <20220601064837.3473709-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_loop as nothing requires the loop driver to be modular. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rc b/common/rc index c4df814..b1cc157 100644 --- a/common/rc +++ b/common/rc @@ -128,7 +128,7 @@ _have_src_program() { } _have_loop() { - _have_modules loop && _have_program losetup + _have_driver loop && _have_program losetup } _have_blktrace() { From patchwork Wed Jun 1 06:48:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B6FC433FE for ; Wed, 1 Jun 2022 06:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245430AbiFAGsz (ORCPT ); Wed, 1 Jun 2022 02:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGsy (ORCPT ); Wed, 1 Jun 2022 02:48:54 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B40558FFBE for ; Tue, 31 May 2022 23:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=zNWbO9ANZxDSJkR1uaf2cgdY/2+eyYYE/LgvB5iNw5U=; b=ISsa35/fdw9tcKk6+2cdiOuvYJ hg42Gn42DXksALDoQze1dQaCOrRAMkyCUxxPeapSv3BNgBiswrpgBOw4XjLQ7FHKaoyNxZm2+Xs4i Ds5F05X1Hu+pULGdEa6i/RJrqBkWKhEfZoTXSww9PP/IRBiX6p9hiphchGGZ3upew+mf5nWpmwSb1 Cl0clZmiHj7zjTQk06pPvJt0fh65fmH/m9437UyMaF445hH0PMDBIbkPPmbxBBOl4obkMAJf/BCYq 42nUWUcFbmYupQe2ee5qqMkNeYk0k37MZ5YWtxgFe6oAl25CW7q18llRqKShylW1WvkFG/WPMeUSn jYB8XZYg==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwIA0-00EEXI-Uj; Wed, 01 Jun 2022 06:48:53 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 5/7] nbd: do not require nbd support to be modular Date: Wed, 1 Jun 2022 08:48:35 +0200 Message-Id: <20220601064837.3473709-6-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_nbd as nothing requires the nbd driver to be modular. Signed-off-by: Christoph Hellwig --- tests/nbd/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nbd/rc b/tests/nbd/rc index 9d0e3d1..118553c 100644 --- a/tests/nbd/rc +++ b/tests/nbd/rc @@ -7,11 +7,11 @@ . common/rc group_requires() { - _have_root && _have_nbd && modprobe nbd + _have_root && _have_nbd } _have_nbd() { - if ! _have_modules nbd; then + if ! _have_driver nbd; then return 1 fi if ! _have_program nbd-server; then From patchwork Wed Jun 1 06:48:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DBC1C433F5 for ; Wed, 1 Jun 2022 06:48:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245483AbiFAGs5 (ORCPT ); Wed, 1 Jun 2022 02:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGs4 (ORCPT ); Wed, 1 Jun 2022 02:48:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68DEB954A4 for ; Tue, 31 May 2022 23:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4aroAkV9hqMPY4J3fHjOJ8aK1ZmGud0BInPy3cIbfy8=; b=U8CHWPtT4XtaL78W8OeygRsZCi e31xynRjfuOjarU4bH6lZkgSNlM9ZM9/2TpVrq/PDgKD5MxYRLb7KPZBdk8br2zufnXsJlynE26GD ac7aLHlqF0QgmzsAJ3hRWzOawkj2+HtLrDdMghhnkt/HZAHohOOKjnT3jlOv6BO4fEXyCLJw4bUaH VRsTWX6KkhHreMOK0yk+KGf90PEmmZ1/nkKizoayAota/ogbYjT8RKm0FzudkEgDeoBETB3JCECgW 2dd7qiv4WR1FAQvYnomxCDGH7y8nnuZKx97u0drZP+J7NpgA2dQWau2Y4rK691AOA8tBHY4L0X8Jv SYxTD5pA==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwIA3-00EEYF-L3; Wed, 01 Jun 2022 06:48:56 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 6/7] scsi: don't require sg to be built in Date: Wed, 1 Jun 2022 08:48:36 +0200 Message-Id: <20220601064837.3473709-7-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_scsi_generic as nothing requires the sg driver to be modular. Signed-off-by: Christoph Hellwig --- tests/scsi/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scsi/rc b/tests/scsi/rc index c8d2f42..0751e77 100644 --- a/tests/scsi/rc +++ b/tests/scsi/rc @@ -15,7 +15,7 @@ group_device_requires() { } _have_scsi_generic() { - _have_modules sg + _have_driver sg } _require_test_dev_is_scsi() { From patchwork Wed Jun 1 06:48:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12866397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 670A0C433F5 for ; Wed, 1 Jun 2022 06:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245519AbiFAGtA (ORCPT ); Wed, 1 Jun 2022 02:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbiFAGs7 (ORCPT ); Wed, 1 Jun 2022 02:48:59 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F37954A4 for ; Tue, 31 May 2022 23:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=rVtv4hqHRIiBfzH3a3TRr9+YdmhHgE1PAv/ncRPpl0c=; b=ys4ARIJTVPyEBap1jOVb4wZhPX aAOp2drORDU5Qj8Sg5SrUAOe7vo9UCwjB9ZXZUuoH2pVMASoGsx9F1K7c8uqWZKWcfJ2IAkDfROCz 1E4XxIPrb6n0ZmOFceZy7JRWL0CV6l2knpWWqbuWi7PNgTgZKRgUSQ0jHGic69pi0l8aAeV16t81D FGPTjok0cnR8L95wBS9IDvzftTbOCYQn943obIAB0lb0Lc2PtaLUWH1VtaLkfD7p3V4/A0DeSmUyL AosNJryIZchp4nkC/OL3TfX7VBAl7VMLdN1RchZVQvRM4mcK+1dEKHc53ucVYPWLvPluSPpcOIMwz areYcjww==; Received: from [2001:4bb8:185:a81e:471a:4927:bd2e:6050] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwIA6-00EEZX-Aj; Wed, 01 Jun 2022 06:48:58 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 7/7] nvme: don't require the nvme drivers to be built in Date: Wed, 1 Jun 2022 08:48:37 +0200 Message-Id: <20220601064837.3473709-8-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601064837.3473709-1-hch@lst.de> References: <20220601064837.3473709-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules to check for the availability of the nvme drivers, and don't bother checking at all for drivers that are pulled in as dependencies. Signed-off-by: Christoph Hellwig --- tests/nvme/rc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index ccdccf9..998b181 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -16,21 +16,23 @@ _nvme_requires() { _have_program nvme case ${nvme_trtype} in loop) - _have_modules nvmet nvme-core nvme-loop + _have_driver nvme-loop _have_configfs ;; pci) - _have_modules nvme nvme-core + _have_driver nvme ;; tcp) - _have_modules nvmet nvme-core nvme-tcp nvmet-tcp + _have_driver nvme-tcp + _have_driver nvmet-tcp _have_configfs ;; rdma) - _have_modules nvmet nvme-core nvme-rdma nvmet-rdma + _have_driver nvme-rdma + _have_driver nvmet-rdma _have_configfs _have_program rdma - _have_modules rdma_rxe || _have_modules siw + _have_driver rdma_rxe || _have_driver siw ;; *) SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}" @@ -125,11 +127,11 @@ _cleanup_nvmet() { shopt -u nullglob trap SIGINT - modprobe -r nvme-"${nvme_trtype}" 2>/dev/null + modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null if [[ "${nvme_trtype}" != "loop" ]]; then - modprobe -r nvmet-"${nvme_trtype}" 2>/dev/null + modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null fi - modprobe -r nvmet 2>/dev/null + modprobe -rq nvmet 2>/dev/null if [[ "${nvme_trtype}" == "rdma" ]]; then stop_soft_rdma fi @@ -137,11 +139,11 @@ _cleanup_nvmet() { _setup_nvmet() { _register_test_cleanup _cleanup_nvmet - modprobe nvmet + modprobe -q nvmet if [[ "${nvme_trtype}" != "loop" ]]; then - modprobe nvmet-"${nvme_trtype}" + modprobe -q nvmet-"${nvme_trtype}" fi - modprobe nvme-"${nvme_trtype}" + modprobe -q nvme-"${nvme_trtype}" if [[ "${nvme_trtype}" == "rdma" ]]; then start_soft_rdma for i in $(rdma_network_interfaces)