Minor QA updates and a script for dumping local QA config information.
[xfstests-dev.git] / check
diff --git a/check b/check
index 22f438da94d4cb3300b9586acecbddacd46d9eb9..84eed6ae3ab4c02eb7e2480eb690bc585cacfaa9 100755 (executable)
--- a/check
+++ b/check
@@ -1,7 +1,8 @@
 #!/bin/sh
-
 #
-# Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+# Control script for QA
+#
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of version 2 of the GNU General Public License as
 # 
 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
 #
-#
-# Control script for QA
-#
-# $Header: /build2/depot/linux/pcp/dev/qa/RCS/check,v 2.32 1999/10/18 06:58:20 kenmcd Exp $
-#
+
+export MKFS_OPTIONS=${MKFS_OPTIONS:=-bsize=4096}
+export MOUNT_OPTIONS=${MOUNT_OPTIONS:=-ologbufs=2}
 
 tmp=/tmp/$$
 status=0
@@ -65,12 +64,6 @@ _wallclock()
     date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
 }
 
-_timestamp()
-{
-    now=`date "+%D-%T"` 
-    echo -n " [$now]"
-}
-
 _wrapup()
 {
     # for hangcheck ...
@@ -151,47 +144,39 @@ echo "preamble" >/tmp/check.sts
 rm -f check.full
 
 # by default don't output timestamps
-timestamp=false
+timestamp=${TIMESTAMP:=false}
 
 . ./common
 
 [ -f check.time ] || touch check.time
 
-if [ ! -z "$MKFS_OPTIONS" ]
+FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
+echo "MKFS_OPTIONS  -- $FULL_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 ! _scratch_mkfs_xfs -f >$tmp.err 2>&1
 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
+    echo "our local _scratch_mkfs_xfs routine ..."
+    cat $tmp.err
+    echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options"
+    exit 1
 fi
 
-if [ ! -z "$MOUNT_OPTIONS" ]
+FULL_MOUNT_OPTIONS=`_scratch_mount_options`
+echo "MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS"
+# call the overridden mount - make sure the FS mounts with
+# the same options that we'll mount with later.
+if ! _scratch_mount >$tmp.err 2>&1
 then
-    echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
-    umount $TEST_DEV
-    # call the overridden mount - make sure the FS starts as
-    # the same as we'll set it later.
-    if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1
-    then
-       echo "our local mount routine ..."
-       cat $tmp.err
-        # call the normal mount
-       echo "normal mount ..."
-        /bin/mount -t xfs $TEST_DEV $TEST_DIR
-        echo "check: failed to mount \$TEST_DEV using specified mount options"
-        exit 1
-    fi
+    echo "our local mount routine ..."
+    cat $tmp.err
+    echo "check: failed to mount \$SCRATCH_DEV using specified options"
+    exit 1
 fi
 
 seq="check"
-_check_fs $TEST_DEV
+_check_test_fs
 
 for seq in $list
 do
@@ -215,17 +200,21 @@ do
        #
        rm -f $seq.out.bad
        lasttime=`sed -n -e "/^$seq /s/.* //p" <check.time`
-       [ "X$lasttime" != X ] && echo -n " ${lasttime}s ..."
+       if [ "X$lasttime" != X ]; then
+               echo -n " ${lasttime}s ..."
+       else
+               echo -n "       "       # prettier output with timestamps.
+       fi
        rm -f core $seq.notrun
 
        # for hangcheck ...
        echo "$seq" >/tmp/check.sts
 
        start=`_wallclock`
-       $timestamp && _timestamp
+       $timestamp && echo -n " ["`date "+%T"`"]"
        sh $seq >$tmp.rawout 2>&1
        sts=$?
-       $timestamp && _timestamp
+       $timestamp && echo -n " ["`date "+%T"`"]"
        stop=`_wallclock`
 
        _fix_malloc <$tmp.rawout >$tmp.out
@@ -240,7 +229,8 @@ do
 
        if [ -f $seq.notrun ]
        then
-           echo -n " [not run] "
+           $timestamp || echo -n " [not run] "
+           $timestamp && echo " [not run]" && echo -n "        $seq -- "
            cat $seq.notrun
            notrun="$notrun $seq"
        else
@@ -285,7 +275,7 @@ do
     [ -f $seq.notrun ] || try=`expr $try + 1`
     
     seq="after_$seq"
-    _check_fs $TEST_DEV
+    _check_test_fs
     
 done