common: Enhance the scratch dev pool and deletable device check

_require_scratch_dev_pool() checks the devices number in
SCRATCH_DEV_POOL, but it's not enough since some btrfs RAID10 tests
needs 4 devices, but when 3 or less devices are provided, the check is
useless and related test case will fail(btrfs/003 btrfs/011 btrfs/023).

Also _require_deletable_scratch_dev_pool only checks whether it is
virtul, like virtio(not including virtio-scsi) disk will pass the check
but is unable to delete.

This patch enhance _require_scratch_dev_pool by add optional $1 as
needed device number to do extra check.
And enhance _require_deletable_scratch_dev_pool by directly check
/sys/class/block/$DEV/device/delete file.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
Miao Xie
2014-01-20 12:52:21 +11:00
committed by Dave Chinner
parent d1d43f623e
commit 5aafebc5fd
3 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ _need_to_be_root
_supported_fs btrfs
_supported_os Linux
_require_scratch
_require_scratch_dev_pool
_require_scratch_dev_pool 4
_require_deletable_scratch_dev_pool
_require_command $WIPEFS_PROG