]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/146: require scratch dev and pool before _require_dm_target
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 8 Sep 2021 08:37:14 +0000 (17:37 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Sep 2021 09:30:30 +0000 (17:30 +0800)
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>
tests/btrfs/146

index 64c3513f15e48a1a9502c574ebbdf81b8b29cc2c..e3b75dc0b8d32df87e83a990ba98d55047de75e9 100755 (executable)
@@ -26,6 +26,8 @@ _cleanup()
 
 # 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
@@ -38,9 +40,6 @@ old_SCRATCH_DEV=$SCRATCH_DEV
 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