common/btrfs: rename and enhance _require_btrfs to _require_btrfs_command

Rename _require_btrfs() to _require_btrfs_command() 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_command() 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".

[eguan: make local vars in _require_btrfs_command "local"]

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Qu Wenruo
2016-12-08 16:12:12 +08:00
committed by Eryu Guan
parent 490baac380
commit 47bb69de19
5 changed files with 27 additions and 7 deletions
+2 -1
View File
@@ -51,7 +51,8 @@ _supported_fs btrfs
_supported_os Linux
_require_scratch
_require_no_large_scratch_dev
_require_btrfs inspect-internal
_require_btrfs_command inspect-internal logical-resolve
_require_btrfs_command inspect-internal inode-resolve
_require_command "/usr/sbin/filefrag" filefrag
rm -f $seqres.full
+1 -1
View File
@@ -48,7 +48,7 @@ _supported_fs btrfs
_supported_os Linux
_require_test
_require_scratch
_require_btrfs "property"
_require_btrfs_command "property"
send_files_dir=$TEST_DIR/btrfs-test-$seq
+1 -1
View File
@@ -51,7 +51,7 @@ _supported_fs btrfs
_supported_os Linux
_require_test
_require_scratch
_require_btrfs "property"
_require_btrfs_command "property"
rm -f $seqres.full
+1 -1
View File
@@ -48,7 +48,7 @@ rm -f $seqres.full
_supported_fs btrfs
_supported_os Linux
_require_scratch
_require_btrfs inspect-internal
_require_btrfs_command inspect-internal dump-super
mkfs_v1()
{