cleanup some qa stuff
authorfsgqa <fsgqa>
Fri, 23 Apr 2004 04:08:39 +0000 (04:08 +0000)
committerfsgqa <fsgqa>
Fri, 23 Apr 2004 04:08:39 +0000 (04:08 +0000)
Get rid of checking log for recovery msgs. It's too much
hassle and probably not worth it.

085
085.out
check
tools/README.auto-qa
tools/auto-qa

diff --git a/085 b/085
index 8e46baa400e40a339beeefb2fa6be17e785292fc..d80479b405af1e5ad2ed20e471558e8632e9744d 100755 (executable)
--- a/085
+++ b/085
@@ -47,7 +47,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common.rc
@@ -66,19 +66,9 @@ _do_logprint()
     fi
 }
 
-_cleanup()
-{
-    rm -f $tmp.*
-    kill $pid
-}
-
 rm -f $seq.full
 rm -f $tmp.log
 
-tail -f /var/log/messages >$tmp.log &
-pid=$!
-cp $tmp.log $tmp.log.orig # note the original log
-
 _require_scratch
 
 echo "mkfs"
@@ -112,18 +102,6 @@ echo "mount with replay"
 _scratch_mount $mnt >>$seq.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
-sleep 2
-
-# compare with what has now been added to the log
-comm -13 $tmp.log.orig $tmp.log >$tmp.comm
-echo "$tmp.comm" >>$seq.full
-cat $tmp.comm >>$seq.full
-
-echo "check syslog for recovery..." 
-grep recovery $tmp.comm |\
-sed -e 's/.*Start/Start/' -e 's/system:.*/system/' \
-    -e 's/.*End/End/'
-
 echo "ls SCRATCH_MNT"
 ls $SCRATCH_MNT
 
diff --git a/085.out b/085.out
index ce480ed75d3fbc2753608f582e0a4fa12d36e35f..48e3e73275f25322cdbbe2cc782dd2e087becf1f 100644 (file)
--- a/085.out
+++ b/085.out
@@ -7,9 +7,6 @@ unmount
 logprint after going down...
 dirty log
 mount with replay
-check syslog for recovery...
-Starting XFS recovery on filesystem
-Ending XFS recovery on filesystem
 ls SCRATCH_MNT
 00
 01
diff --git a/check b/check
index c854eb636e853e74d1b4525efb319df3a9a1e979..ea6081b7225ea66e0b1d71ba44959a615fbc67a2 100755 (executable)
--- a/check
+++ b/check
@@ -223,7 +223,8 @@ do
 
        start=`_wallclock`
        $timestamp && echo -n " ["`date "+%T"`"]"
-       sh $seq >$tmp.rawout 2>&1
+       [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
+       ./$seq >$tmp.rawout 2>&1
        sts=$?
        $timestamp && echo -n " ["`date "+%T"`"]"
        stop=`_wallclock`
index 86e362150235b3aa2f185ed92af17aa59979eac5..82a873e3aad45cb4558b6c5408637532c41b5e2a 100644 (file)
@@ -10,9 +10,6 @@ ______________________                                      ______________
        - make a kernel workarea "$HOME/qa/2.4.x-xfs" for 2.4.x-xfs
          and a commands workarea "$HOME/qa/xfs-cmds" for xfs-cmds
                (easiest to copy them from elsewhere)
-       - cd $HOME/qa ; ln -s xfs-cmds/xfstests/tools/auto-qa .
-               (auto-qa must be a link into it's own source tree
-               so it can update itself)
        - copy an appropriate .config file to
                $HOME/qa/$HOSTNAME.config
        - You'll need a hacked version of 'su' in $HOME/qa that
index 89854433598694cc1da802792b815cd85da92830..35e6c532bc57fad20c2ae56c7a430f871baad9cb 100755 (executable)
 #
 
 # automatic qa system. 31/08/00 dxm@sgi.com
-
-# configuration (you could tune this)
+#
+# Usage: auto_qa start-state [stop-state]
+# Do auto_qa from start-state up to stop-state inclusive
+# or if no stop-state given then do it until reach "done" state.
+#
 
 _log()
 {
@@ -98,7 +101,7 @@ STATE=$ROOT/qa.state
 QADIR="$WORKAREA/xfstests"
 SUDO="su -c"
 CONFIG="$ROOT/$HOST.config"
-COMMON_CONFIG="$WORKAREA/xfstests/common.config"
+COMMON_CONFIG="$QADIR/common.config"
 SH="/bin/sh"
 LOG="$ROOT/qa.log"
 
@@ -139,6 +142,8 @@ _set_state()
 _change_state()
 {
     new=$1
+
+    # if have state XXXX-state then preserve XXXX-newstate
     
     case $state
     in
@@ -169,18 +174,6 @@ _restart()
     exec $ROOT/su -c "(shutdown -r now \"auto-qa rebooting\" )&" < /dev/null
 }
 
-_update_autoqa_file()
-{
-    SELF="$ROOT/auto-qa"
-    SELF_UPDATE="xfstests/tools/auto-qa"
-    if [ -z "$CVSROOT" ]; then
-           cmd="p_tupdate $SELF_UPDATE"
-    else
-           cmd="cvs -z3 update $SELF_UPDATE"
-    fi
-    exec $SH -c "cd $WORKAREA ; $cmd; chmod +x $SELF_UPDATE ; exec $SELF"
-}
-
 _update_workarea()
 {
     if [ -z "$CVSROOT" ]; then
@@ -237,6 +230,7 @@ _i386_install()
                || _fail "          !!! install modules failed"
     fi
 
+
     if [ -z "$KINSTALL" -o "$KINSTALL" = lilo ]; then
        _log "  *** reinit lilo"
        _sudo /sbin/lilo 2>&1 \
@@ -262,6 +256,12 @@ _ia64_restart()
     echo not yet implemented
 }
 
+_check_kernel()
+{
+    [ -d "$KWORKAREA" ]        || _fail "    !!! QA kernel workarea \"$KWORKAREA\" not found"
+    [ -r "$CONFIG" ]   || _fail "    !!! Can't read config file $CONFIG"
+}
+
 
 _log "*** XFS QA (`date`)"
 
@@ -290,15 +290,13 @@ in
        ;;
 esac
 
-if [ "$1" != "" ]
-then
-    _set_state $1
-fi
+[ -n "$1" ] && _set_state $1
+[ -n "$2" ] && stop_state=$2
 
 [ "$UID" -eq 0 ]       && _fail "    !!! QA most be run as a normal user"
 [ -d "$ROOT" ]         || _fail "    !!! QA root \"$ROOT\" not found"
 [ -d "$WORKAREA" ]     || _fail "    !!! QA workarea \"$WORKAREA\" not found"
-[ -r "$CONFIG" ]       || _fail "    !!! Can't read config file $CONFIG"
+cd $QADIR
 . "$COMMON_CONFIG"     || _fail "    !!! Couldn't source $COMMON_CONFIG"
 
 _get_kernel_version
@@ -327,21 +325,10 @@ do
            _log "******************************************************"
            _log "QA init $VERSION (`date`)"
            _log "******************************************************"
-           _log "--- kernel ($IMAGE)"
-           [ -z "$KMODULES" -o "$KMODULES" = yes ] && \
-               _log "--- modules ($MODULES)"
-
-           _change_state "inited"
-           _update_autoqa_file
-           ;;
-           
-       *inited)
-           _log "      *** QA initialized"
-           new_state="update"
+           new_state="updatetools"
            ;;
        
-       *update)
-           _update_workarea "$KWORKAREA"
+       *updatetools)
            _update_workarea "$WORKAREA"
            new_state="cleantools"
            ;;
@@ -381,10 +368,17 @@ do
                        || _fail "          !!! install $pkg failed"
            done
 
+           new_state="updatekernel"
+           ;;
+
+       *updatekernel)
+           _check_kernel
+           _update_workarea "$KWORKAREA"
            new_state="cleankernel"
            ;;
 
        *cleankernel)
+           _check_kernel
            _log "      *** clean kernel"
            cd "$KWORKAREA"
            make mrproper 2>&1 \
@@ -402,7 +396,7 @@ do
            ;;
            
        *reconfig)
-       
+           _check_kernel
            _log "      *** reconfig kernel"
            
            # we better start from scratch if this fails
@@ -420,7 +414,11 @@ do
            ;;
            
        *buildkernel)
+           _check_kernel
            _log "      *** build kernel"
+           _log "          --- kernel ($IMAGE)"
+           [ -z "$KMODULES" -o "$KMODULES" = yes ] && \
+            _log "          --- modules ($MODULES)"
            
            _change_state "cleankernel" ; # we better start from scratch if this fails
            
@@ -434,6 +432,7 @@ do
            ;;
 
        *install)
+           _check_kernel
            _log "      *** blat old modules"
            _sudo rm -rf $MODULES
            
@@ -445,11 +444,7 @@ do
                ia64)           _ia64_install ;;
            esac
 
-           if [ -z "$KRESTART" -o "$KRESTART" = yes ]; then
-               new_state="restart"
-           else
-               new_state="done"
-           fi
+           new_state="restart"
            ;;
            
        *restart)
@@ -565,7 +560,7 @@ do
            ;;
            
        *done)
-           _log "*** QA run complete"
+           _log "*** requested QA state transitions complete"
 
            _success
            ;;
@@ -582,6 +577,20 @@ do
 
     _log "    *** state $state done (`date`)"
     [ "$new_state" = "" ] && _fail "    !!! no new state set"
+
+    if [ -n "$stop_state" ]
+    then
+        # remove hyphen prefixes
+       s1=`echo $state | sed 's/.*-//'`
+       s2=`echo $stop_state | sed 's/.*-//'`
+
+       if [ $s1 = $s2 ]
+       then
+           # we have been requested to stop here and not go on
+           new_state="done"
+       fi
+    fi
+
     _change_state $new_state
     
 done