Fix build - bsd changes from awhile ago introduced a m4 macro bug, only
[xfstests-dev.git] / tools / auto-qa
index 6d98dd288acc9f135f71c070b62916334d44b90b..21da5d4dc304cead2248d9334c5ab82b9533cd09 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+# 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
 
 # configuration (you could tune this)
 
-BOOT="/boot"
-SOAK_PASSES="-1"
-SOAK_STRESS="10000"
-SOAK_PROC="3"
-export EXTRA=${EXTRA:=-xfs-qa}
-export MKFS_OPTIONS=${MKFS_OPTIONS:=-bsize=4096}
-export MOUNT_OPTIONS=${MOUNT_OPTIONS:=-ologbufs=2}
-export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
-
 _log()
 {
     echo "$*" >&2
     echo "$*" >> $LOG
+    sync
 }
 
 _fail()
@@ -64,7 +56,7 @@ _fail()
     case $state
     in
        cron*)
-           mail -s "XFS QA status report" $ADMINEMAIL \
+           mail -s "XFS QA status report" $EMAIL \
                < $LOG 2>&1
        ;;
     esac
@@ -113,35 +105,6 @@ COMMON_CONFIG="$WORKAREA/cmd/xfstests/common.config"
 SH="/bin/sh"
 LOG="$ROOT/qa.log"
 
-# need to add auto-qa hosts here
-
-case $HOST
-in
-    bruce)
-       EMAIL="nathans@larry"
-       ADMINEMAIL="nathans@larry"
-       MODULAR=0
-       ;;
-    sagan)
-       EMAIL="tes@larry"
-       ADMINEMAIL="tes@larry"
-       MODULAR=1
-       ;;
-    troppo)
-       EMAIL="kaos@larry"
-       ADMINEMAIL="kaos@larry"
-       MODULAR=0
-       ;;
-    frodo)
-       EMAIL="nathans@larry"
-       ADMINEMAIL="nathans@larry"
-       MODULAR=0
-       ;;
-    *)
-       _fail "auto-qa: no configuration information for host '$HOST'"
-       ;;
-esac
-
 # do some cleanup on exit
 
 _cleanup()
@@ -386,7 +349,7 @@ do
                        || _fail "          !!! install $pkg failed"
 
                # attr and acl now have install-lib targets as well
-               [ "$pkg" == "attr" -o "$pkg" == "acl" ] || continue
+               [ "$pkg" = "attr" -o "$pkg" = "acl" ] || continue
                _sudo make install-lib 2>&1 \
                        || _fail "          !!! install $pkg failed"
            done
@@ -427,7 +390,7 @@ do
            
        *restart)
            _log "          *** select qa kernel"
-           _sudo /sbin/lilo -R linux-xfs-qa 2>&1 \
+           _sudo /sbin/lilo -R linux-xfs-qa $KERNEL_OPTIONS 2>&1 \
                        || _fail "          !!! lilo failed"
            
            _log "          *** prepare to restart"
@@ -510,22 +473,37 @@ do
            new_state="run"
            ;;
            
-           
        soak-run)
            cd $QADIR
            
            _log "          *** run soak test"
-           _sudo ./soak $SOAK_PASSES $SOAK_STRESS $SOAK_PROC\
+           _sudo ./soak $SOAK_PASSES $SOAK_STRESS $SOAK_PROC \
                        || _fail "          !!! failed to run soak test"
 
            new_state="done"
            ;;
            
+       bench-run)
+           cd $QADIR
+           
+           # $BENCHMARK is typically unset, which equates to "all"
+           #
+           _log "          *** run benchmarks"
+           _sudo ./bench $BENCH_PASSES `id -nu && id -ng` $BENCHMARK \
+                       || _fail "          !!! failed to run benchmarks"
+
+           _log ""
+           _log "          *** send results mail"
+           mail -s "XFS QA benchmark results" $EMAIL < $QADIR/bench.out 2>&1
+       
+           new_state="done"
+           ;;
+           
        *run)
            cd $QADIR
            
            _log "          *** run tests"
-           _sudo ./check -l -g auto 2>&1 | tee $ROOT/qa.out
+           _sudo ./check -l $CHECK_OPTIONS 2>&1 | tee $ROOT/qa.out
            
            _log ""
            _log "          *** send status mail"