]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
common: Enhance the scratch dev pool and deletable device check
authorMiao Xie <miaox@cn.fujitsu.com>
Mon, 20 Jan 2014 01:52:21 +0000 (12:52 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 20 Jan 2014 01:52:21 +0000 (12:52 +1100)
commit5aafebc5fd5ebf4b260215b3e56eb69b98134e28
tree23bdfe0abd2f9f0cd6f7920e0df981a1c68cbb68
parentd1d43f623e09815f13e732fbc75e1ff745740b30
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>
common/rc
tests/btrfs/003
tests/btrfs/011