From patchwork Wed May 25 07:34:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 12860739 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 35F48C433EF for ; Wed, 25 May 2022 07:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243146AbiEYHeu (ORCPT ); Wed, 25 May 2022 03:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244329AbiEYHef (ORCPT ); Wed, 25 May 2022 03:34:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B22654BF7 for ; Wed, 25 May 2022 00:34:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E7F05B81CBA for ; Wed, 25 May 2022 07:34:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A794C34114 for ; Wed, 25 May 2022 07:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653464071; bh=qS8ssO1YQaX3xYqZdOSEvhEegK0FX9J8Cv8aoNqtz70=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ggX+tB1oJgmsjGCTSqilQazhYGpJWT+cv0RntxgY1ZK/e8I6H92XmDBNfuvqxPapa BP1Uhg0nB6OF/kxfLNvQ6iq9aFMq3K7vGPcokMQEV7wrxznXTC1Ie0zTHe75cELF3P Db0CL91qt7CcuoJP1CQSSw2V+AkSmVuQHHrmPa34IMfxM4aFBYn0nbB5edyyRZM+b9 Q4VaLl31+7GyIoUHObvqunVP0mFM4UMoSbPpq+xRWSca9sREFkL+eQfqGmkFbrYxXs BWwfoa/Gb8UvA2OcZexBJLcfKRpGKMLtnGTtDgWsk1yPB+f28uQMl3GvWrFd4QG6f6 wM5bQuGZPnndw== From: Zorro Lang To: fstests@vger.kernel.org Subject: [PATCH 1/2] common: source base fs specific common file Date: Wed, 25 May 2022 15:34:26 +0800 Message-Id: <20220525073427.3355242-2-zlang@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220525073427.3355242-1-zlang@kernel.org> References: <20220525073427.3355242-1-zlang@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org When tests overlayfs, sometimes we need the underlying fs specific helpers, e.g. common/rc has: _filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP So when we source common/overlay, better to source OVL_BASE_FSTYP too. Signed-off-by: Zorro Lang Reviewed-by: Amir Goldstein --- common/config | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ common/overlay | 4 ++++ common/rc | 49 +---------------------------------------- 3 files changed, 64 insertions(+), 48 deletions(-) diff --git a/common/config b/common/config index c6428f90..558f148b 100644 --- a/common/config +++ b/common/config @@ -481,6 +481,65 @@ _fsck_opts() esac } +# check necessary running dependences then source sepcific fs helpers +_source_specific_fs() +{ + local fs=$1 + + if [ -z "$fs" ];then + fs=$FSTYP + fi + + case "$fs" in + xfs) + [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" + [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" + [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" + [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" + [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" + + . ./common/xfs + ;; + udf) + [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" + ;; + btrfs) + [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" + + . ./common/btrfs + ;; + ext4) + [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" + ;; + f2fs) + [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" + ;; + nfs) + . ./common/nfs + ;; + cifs) + ;; + 9p) + ;; + ceph) + . ./common/ceph + ;; + glusterfs) + ;; + overlay) + . ./common/overlay + ;; + reiser4) + [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" + ;; + pvfs2) + ;; + ubifs) + [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" + ;; + esac +} + known_hosts() { [ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configs diff --git a/common/overlay b/common/overlay index c4e7ee58..e35419d0 100644 --- a/common/overlay +++ b/common/overlay @@ -12,6 +12,10 @@ export OVL_XATTR_NLINK="trusted.overlay.nlink" export OVL_XATTR_UPPER="trusted.overlay.upper" export OVL_XATTR_METACOPY="trusted.overlay.metacopy" +if [ -n "$OVL_BASE_FSTYP" ];then + _source_specific_fs $OVL_BASE_FSTYP +fi + # helper function to do the actual overlayfs mount operation _overlay_mount_dirs() { diff --git a/common/rc b/common/rc index 70a15f9c..2f31ca46 100644 --- a/common/rc +++ b/common/rc @@ -96,54 +96,7 @@ _log_err() umask 022 # check for correct setup and source the $FSTYP specific functions now -case "$FSTYP" in - xfs) - [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" - [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" - [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" - [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" - [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" - - . ./common/xfs - ;; - udf) - [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" - ;; - btrfs) - [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" - - . ./common/btrfs - ;; - ext4) - [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" - ;; - f2fs) - [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" - ;; - nfs) - . ./common/nfs - ;; - cifs) - ;; - 9p) - ;; - ceph) - . ./common/ceph - ;; - glusterfs) - ;; - overlay) - . ./common/overlay - ;; - reiser4) - [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" - ;; - pvfs2) - ;; - ubifs) - [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" - ;; -esac +_source_specific_fs $FSTYP if [ ! -z "$REPORT_LIST" ]; then . ./common/report From patchwork Wed May 25 07:34:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 12860738 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 3141DC433F5 for ; Wed, 25 May 2022 07:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243096AbiEYHer (ORCPT ); Wed, 25 May 2022 03:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244236AbiEYHef (ORCPT ); Wed, 25 May 2022 03:34:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C1454BDE for ; Wed, 25 May 2022 00:34:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 287C76177A for ; Wed, 25 May 2022 07:34:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F1B5C34117 for ; Wed, 25 May 2022 07:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653464072; bh=NuUBdA0ZR5iH8JUy9SZF9+B4NE33FdX4kHuU+R0iH5A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QMbkYCbpruvxaa/hzkpBl3NIj/gamktWZ8xexKFQT++4CfmV5MgX/Qe7funAT6BML +hsjaSRIbWWd3/PKK/fuuWnPLa+4t/FZmMBYGQ47iYnnqKU1hgwYLORzbaRm8DD9Tb EfJN13P+y0Djhe95PCf3Ne2Iz3W/bFCl7JfFkDhECLmSgUwtSlTvT71TUvNFGsyeRv lgMxGJV/bllEquvns54w82rBWmuSAEa4RjUPyHvLJ3P8dRI9foYgF0H9Kt1LQa+fBy mCNjgNIWwXhssTLYlWP6nd8gJDz/C8ZVIXNJdZDTgBZKuzeh/wpTDVZqmQ9ePRM7pX 5Cle3I7jtuDsg== From: Zorro Lang To: fstests@vger.kernel.org Subject: [PATCH 2/2] tests: remove redundant common/$FSTYP importing Date: Wed, 25 May 2022 15:34:27 +0800 Message-Id: <20220525073427.3355242-3-zlang@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220525073427.3355242-1-zlang@kernel.org> References: <20220525073427.3355242-1-zlang@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org As fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again. Signed-off-by: Zorro Lang --- tests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-) diff --git a/tests/btrfs/177 b/tests/btrfs/177 index 2fd11e89..7b004b83 100755 --- a/tests/btrfs/177 +++ b/tests/btrfs/177 @@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfs diff --git a/tests/btrfs/258 b/tests/btrfs/258 index 158eaf79..8fc828df 100755 --- a/tests/btrfs/258 +++ b/tests/btrfs/258 @@ -11,7 +11,6 @@ _begin_fstest auto defrag quick . ./common/btrfs -. ./common/filter # real QA test starts here diff --git a/tests/btrfs/259 b/tests/btrfs/259 index e7bd8ddd..92d0b9a6 100755 --- a/tests/btrfs/259 +++ b/tests/btrfs/259 @@ -12,7 +12,6 @@ _begin_fstest auto quick defrag # Import common functions. . ./common/filter -. ./common/btrfs # real QA test starts here diff --git a/tests/xfs/422 b/tests/xfs/422 index 77db492e..175253aa 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -17,7 +17,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/423 b/tests/xfs/423 index be56f311..c9dfaece 100755 --- a/tests/xfs/423 +++ b/tests/xfs/423 @@ -18,7 +18,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/517 b/tests/xfs/517 index 512f795f..88c4f43b 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -23,7 +23,6 @@ _cleanup() . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs