allow mkfs arguments to be passed from the env for testing multiple
[xfstests-dev.git] / check
diff --git a/check b/check
index 515c41263cc9a76c94e590874f7f945dfb381bdf..22f438da94d4cb3300b9586acecbddacd46d9eb9 100755 (executable)
--- a/check
+++ b/check
@@ -157,6 +157,21 @@ timestamp=false
 
 [ -f check.time ] || touch check.time
 
+if [ ! -z "$MKFS_OPTIONS" ]
+then
+    echo "check: \$MKFS_OPTIONS specified - \"$MKFS_OPTIONS\""
+    umount $SCRATCH_DEV 2>/dev/null
+    # call the overridden mkfs.xfs - make sure the FS is built
+    # the same as we'll create it later.
+    if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.err 2>&1
+    then
+       echo "our local mkfs_xfs routine ..."
+       cat $tmp.err
+        echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options"
+        exit 1
+    fi
+fi
+
 if [ ! -z "$MOUNT_OPTIONS" ]
 then
     echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
@@ -165,7 +180,7 @@ then
     # the same as we'll set it later.
     if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1
     then
-       echo "our mount ..."
+       echo "our local mount routine ..."
        cat $tmp.err
         # call the normal mount
        echo "normal mount ..."