From patchwork Mon Feb 15 20:46:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 8318611 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F6639F399 for ; Mon, 15 Feb 2016 20:47:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A97D820390 for ; Mon, 15 Feb 2016 20:47:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 329D020392 for ; Mon, 15 Feb 2016 20:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752162AbcBOUrB (ORCPT ); Mon, 15 Feb 2016 15:47:01 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:46610 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbcBOUqc (ORCPT ); Mon, 15 Feb 2016 15:46:32 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1FKkT67031160 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Feb 2016 20:46:30 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1FKkTeK003644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 15 Feb 2016 20:46:29 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1FKkT9O013963; Mon, 15 Feb 2016 20:46:29 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Feb 2016 12:46:28 -0800 Subject: [PATCH 3/3] xfs/24[356]: check for -c switch to xfs_io bmap command From: "Darrick J. Wong" To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Mon, 15 Feb 2016 12:46:27 -0800 Message-ID: <20160215204627.7977.93549.stgit@birch.djwong.org> In-Reply-To: <20160215204608.7977.2802.stgit@birch.djwong.org> References: <20160215204608.7977.2802.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extend _require_xfs_io_command so that we can pass it a command line argument to look for, and then use new capabililty in the relevant tests to ensure that bmap knows how to dump CoW fork contents (bmap -c) Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- common/rc | 9 +++++++-- tests/xfs/243 | 1 + tests/xfs/245 | 1 + tests/xfs/246 | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/rc b/common/rc index b11f170..e810062 100644 --- a/common/rc +++ b/common/rc @@ -1831,12 +1831,13 @@ _user_do() _require_xfs_io_command() { - if [ $# -ne 1 ] + if [ -z "$1" ] then - echo "Usage: _require_xfs_io_command command" 1>&2 + echo "Usage: _require_xfs_io_command command [switch]" 1>&2 exit 1 fi command=$1 + param=$2 testfile=$TEST_DIR/$$.xfs_io case $command in @@ -1866,6 +1867,10 @@ _require_xfs_io_command() _notrun "xfs_io $command support is missing" echo $testio | grep -q "Operation not supported" && \ _notrun "xfs_io $command failed (old kernel/wrong fs?)" + + test -z "$param" && return + $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ + _notrun "xfs_io $command doesn't support $param" } # check that xfs_db supports a specific command diff --git a/tests/xfs/243 b/tests/xfs/243 index 629173e..d75cfd8 100755 --- a/tests/xfs/243 +++ b/tests/xfs/243 @@ -56,6 +56,7 @@ _supported_fs xfs _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" +_require_xfs_io_command "bmap" "-c" _require_cp_reflink rm -f $seqres.full diff --git a/tests/xfs/245 b/tests/xfs/245 index 6da701d..7f80260 100755 --- a/tests/xfs/245 +++ b/tests/xfs/245 @@ -49,6 +49,7 @@ _supported_os Linux _supported_fs xfs _require_scratch_reflink _require_xfs_io_command "falloc" +_require_xfs_io_command "bmap" "-c" _require_cp_reflink rm -f $seqres.full diff --git a/tests/xfs/246 b/tests/xfs/246 index 13b0c98..bf471cc 100755 --- a/tests/xfs/246 +++ b/tests/xfs/246 @@ -42,6 +42,7 @@ _cleanup() # real QA test starts here _supported_os Linux _supported_fs xfs +_require_xfs_io_command "bmap" "-c" rm -f $seqres.full