The test case btrfs/146 calls _require_dm_target which depends on
SCRATCH_DEV. The test case assumes that valid devices are set in
SCRATCH_DEV_POOL, and one of the devices is propagated to
SCRATCH_DEV. However, when SCRATCH_DEV_POOL is not set, valid value
is not propagated to SCRATCH_DEV and _require_dm_target causes
unexpected test case failure.
To avoid the failure, move _require_scratch and
_require_scratch_dev_pool calls before _require_dm_target call to
detect invalid SCRATCH_DEV_POOL beforehand.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
# real QA test starts here
_supported_fs btrfs
+_require_scratch
+_require_scratch_dev_pool
_require_dm_target error
_require_test_program fsync-err
_require_test_program dmerror
SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | perl -pe "s#$SCRATCH_DEV#$DMERROR_DEV#"`
SCRATCH_DEV=$DMERROR_DEV
-_require_scratch
-_require_scratch_dev_pool
-
echo "Format and mount"
# Build a filesystem with 2 devices that stripes the data across