From patchwork Thu Dec 8 02:04:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9465619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 083F8607D4 for ; Thu, 8 Dec 2016 02:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F015D28538 for ; Thu, 8 Dec 2016 02:11:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E392028533; Thu, 8 Dec 2016 02:11:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56F1928533 for ; Thu, 8 Dec 2016 02:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933084AbcLHCLW (ORCPT ); Wed, 7 Dec 2016 21:11:22 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:48550 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753177AbcLHCLW (ORCPT ); Wed, 7 Dec 2016 21:11:22 -0500 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="1009421" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 08 Dec 2016 10:05:05 +0800 Received: from localhost.localdomain (unknown [10.167.226.34]) by cn.fujitsu.com (Postfix) with ESMTP id 3B96341B4BD2; Thu, 8 Dec 2016 10:05:04 +0800 (CST) From: Qu Wenruo To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 1/2] fstests: common: rename and enhance _require_btrfs to _require_btrfs_subcommand Date: Thu, 8 Dec 2016 10:04:55 +0800 Message-Id: <20161208020456.16116-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 3B96341B4BD2.AB3D4 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rename _require_btrfs() to _require_btrfs_subcommand() to avoid confusion, as all other _require_btrfs_* has a quite clear suffix, like _require_btrfs_mkfs_feature() or _require_btrfs_fs_feature(). Also enhance _require_btrfs_subcommand() to accept 2nd level commands or options. Options will be determined by the first "-" char. This is quite useful for case like "btrfs inspect-internal dump-tree" and "btrfs check --qgroup-report". Signed-off-by: Qu Wenruo --- common/rc | 29 ++++++++++++++++++++++++----- tests/btrfs/004 | 3 ++- tests/btrfs/048 | 2 +- tests/btrfs/059 | 2 +- tests/btrfs/131 | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/common/rc b/common/rc index 8c99306..1703232 100644 --- a/common/rc +++ b/common/rc @@ -3019,15 +3019,34 @@ _require_deletable_scratch_dev_pool() } # We check for btrfs and (optionally) features of the btrfs command -_require_btrfs() +# _require_btrfs_subcommand [|