fstests: fix broken _require_scratch usage
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 20 Mar 2019 00:46:01 +0000 (17:46 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 24 Mar 2019 02:37:43 +0000 (10:37 +0800)
_require_scratch doesn't actually format the scratch device with
anything, which means that tests are required to format them before
using them.  Fix tests that don't do this correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/026
tests/generic/100
tests/generic/506
tests/xfs/065
tests/xfs/108
tests/xfs/109
tests/xfs/194
tests/xfs/261
tests/xfs/284

index 6cbd2829aae89f9920bae84633c328dd49f348ba..31cd0827ff20a8eebbfefc975ec2e590dc2a50c2 100755 (executable)
@@ -32,7 +32,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 _require_test
-_require_scratch
 _acl_setup_ids
 _require_acls
 _require_acl_get_max
index c2593333543c35ac6af7a00e16d7adc4fc398f1f..927c494998c79067e3c6e2856dcf21714ba15f59 100755 (executable)
@@ -52,9 +52,6 @@ _populate_fs -n $NDIRS -f $NFILES -d $DEPTH -r $POPULATED_DIR -s $SIZE >>$seqres
 # Then tar up the directory structure
 tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
 
-# create f/s
-_require_scratch
-
 # untar on f/s
 cd $TEST_DIR
 tar -xvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
index 5d419cad13b8bcefc09df8bdd0ebe3404c188d14..7002c00cc799f5378e85cef72c270b040faef043 100755 (executable)
@@ -46,12 +46,12 @@ _supported_os Linux
 _require_command "$LSATTR_PROG" lsattr
 _require_command "$CHATTR_PROG" chattr
 
-_require_prjquota $SCRATCH_DEV
 _require_scratch
 _require_scratch_shutdown
 
 _scratch_mkfs >/dev/null 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+_require_prjquota $SCRATCH_DEV
 
 testfile=$SCRATCH_MNT/testfile
 
index c34724861e969e17e6d0af7024d6b8a0a2e385a2..c0d1ee93ffaa2654bf56bc2758df3d9f4ff38963 100755 (executable)
@@ -55,7 +55,7 @@ _supported_os Linux
 # too much hassle to get output matching with quotas turned on
 # so don't run it
 #
-_scratch_unmount 2>/dev/null
+_scratch_mkfs_xfs >> $seqres.full
 _scratch_mount
 $here/src/feature -U $SCRATCH_DEV && \
        _notrun "UQuota enabled, test needs controlled xfsdump output"
index c47f4f37b545bd72b9f1b653cb8bfdd79ea8ea4e..e70a1f9a2ad8dea734b18b946751368f1c90d99b 100755 (executable)
@@ -61,6 +61,7 @@ test_accounting()
 }
 
 export MOUNT_OPTIONS="-opquota"
+_scratch_mkfs_xfs >> $seqres.full
 _qmount
 _require_prjquota $SCRATCH_DEV
 
index a063dc3f665fbc58c99f633dcd3c33773651daad..df4ec157821fd0fbde5923c942a5b8b67b8ebdaf 100755 (executable)
@@ -75,7 +75,7 @@ allocate()
 }
 
 # real QA test starts here
-_scratch_unmount 2>/dev/null
+_scratch_mkfs_xfs >> $seqres.full
 _scratch_mount
 rm -f $seqres.full
 
index 6c1eddbaf515ced9990fcaec8e13d5f7b6ecc343..3e186528fecd4d41f5eea1e5ae64db4f4cf3b3d1 100755 (executable)
@@ -32,6 +32,9 @@ _supported_os Linux
 # real QA test starts here
 rm -f $seqres.full
 
+_require_scratch
+_scratch_mkfs_xfs >/dev/null 2>&1
+
 # For this test we use block size = 1/8 page size
 pgsize=`$here/src/feature -s`
 blksize=`expr $pgsize / 8`
@@ -70,7 +73,6 @@ _filter_od()
     sed -e "s/^[0-9A-Fa-f ]\{7,8\}//"
 }
 
-_require_scratch
 unset MKFS_OPTIONS
 unset XFS_MKFS_OPTIONS
 
index 0fabcd6430a055041f123ae8f38fa4e98e6ce8b9..92152ace8a86059bf7d79b87fae1da6ad6f35614 100755 (executable)
@@ -47,6 +47,8 @@ _supported_os Linux
 _require_quota
 _require_scratch
 
+_scratch_mkfs >> $seqres.full 2>&1
+
 # Just use the current mount table as an example mtab file.  Odds
 # are good there's nothing wrong with it.
 _setup_my_mtab() {
index 07f71031f675e51b05bbe0f9a6e30dced909745d..7af77634b51163974ab2fc7ff8f89a6ee308645a 100755 (executable)
@@ -50,6 +50,7 @@ COPY_FILE="${TEST_DIR}/${seq}_copyfile"
 
 # Test dump a mounted device
 # xfs_metadump should refuse to dump a mounted device
+_scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 _scratch_metadump $METADUMP_FILE 2>&1 | filter_mounted
 _scratch_unmount