pagebuf is no longer a separate module.
[xfstests-dev.git] / tools / auto-qa
index 928593c7880b59e270f0edb7a998c54ec4db92ae..2db90e1cdc5d6097918545bc0e67a8614e23a70c 100755 (executable)
 
 # automatic qa system. 31/08/00 dxm@sgi.com
 
+# configuration (you could tune this)
+
+EXTRA="-xfs-qa"
+BOOT="/boot"
+SOAK_PASSES="-1"
+SOAK_STRESS="10000"
+SOAK_PROC="3"
+
+
 _log()
 {
     echo "$*" >&2
@@ -62,14 +71,24 @@ _fail()
     exit 1
 }
 
-# configuration (you could tune this)
-
-EXTRA="-xfs-qa"
-VERSION="2.4.2"
-BOOT="/boot"
-SOAK_PASSES="-1"
-SOAK_STRESS="10000"
-SOAK_PROC="3"
+_get_kernel_version()
+{
+    [ -x $WORKAREA ] \
+        || _fail "can't access workarea $WORKAREA"
+    [ -r $WORKAREA/linux/Makefile ] \
+        || _fail "can't read makefile $WORKAREA/linux/Makefile"
+
+    eval `awk '
+        BEGIN { FS = "[ \t=]+" }
+        /^VERSION =/ { a=$2 }
+        /^PATCHLEVEL =/ { b=$2 }
+        /^SUBLEVEL =/ { c=$2 }
+        /^EXTRAVERSION =/ { d=$2 }
+       END { 
+           print "VERSION=" a "." b "." c d " ; SVERSION=" a "." b "." c
+        }
+   ' < $WORKAREA/linux/Makefile`
+}
 
 # this should be constant
 
@@ -82,14 +101,12 @@ else
 fi
 export WORKAREA
 
+
 export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/ptools:/usr/local/bin"
 STATE=$ROOT/qa.state
 QADIR="$WORKAREA/cmd/xfstests"
 SUDO="su -c"
-IMAGE="$BOOT/vmlinuz-$VERSION$EXTRA"
-SYSTEMMAP="$BOOT/System.map-$VERSION$EXTRA"
 CONFIG="$ROOT/$HOST.config"
-MODULES="/lib/modules/$VERSION$EXTRA"
 COMMON_CONFIG="$WORKAREA/cmd/xfstests/common.config"
 SH="/bin/sh"
 LOG="$ROOT/qa.log"
@@ -99,8 +116,8 @@ LOG="$ROOT/qa.log"
 case $HOST
 in
     fuzzy)
-        EMAIL="dxm@larry"
-        ADMINEMAIL="dxm@larry"
+        EMAIL="nathans@larry"
+        ADMINEMAIL="nathans@larry"
         MODULAR=1
         ;;
     bruce)
@@ -192,7 +209,8 @@ _sudo()
 
 _restart()
 {
-    exec $ROOT/su -c "(shutdown -r 2 \"auto-qa rebooting\" ; reboot )&" < /dev/null
+    # erk - why won't this thing reboot reliably??
+    exec $ROOT/su -c "(shutdown -r 2 \"auto-qa rebooting\" ; sleep 10 ; reboot ; sleep 10 ; reboot )&" < /dev/null
 }
 
 _update_autoqa_file()
@@ -270,6 +288,11 @@ fi
 [ -r $CONFIG ]          || _fail "    !!! Can't read config file $CONFIG"
 . $COMMON_CONFIG       || _fail "    !!! Couldn't source $COMMON_CONFIG"
 
+_get_kernel_version
+IMAGE="$BOOT/vmlinuz$EXTRA"
+SYSTEMMAP="$BOOT/System.map-$VERSION$EXTRA"
+MODULES="/lib/modules/$SVERSION"
+
 cd $ROOT
 
 started=1
@@ -288,9 +311,11 @@ do
         *init)
             echo "" > $ROOT/qa.log
             echo "" > $ROOT/qa.full
-            _log "******************************************"
-            _log "QA init (`date`)"
-            _log "******************************************"
+            _log "******************************************************"
+            _log "QA init $VERSION (`date`)"
+            _log "******************************************************"
+           _log "--- kernel ($IMAGE)"
+           _log "--- modules ($MODULES)"
 
             _change_state "inited"
             _update_autoqa_file
@@ -308,7 +333,7 @@ do
 
         *clean)
             # we need to configure or else we might fail to clean
-            for pkg in attr acl xfsprogs xfsdump xfstests
+            for pkg in attr acl xfsprogs dmapi xfsdump xfstests
            do
                 cd $WORKAREA/cmd/$pkg
                 _log "        *** clean $pkg tools"
@@ -316,11 +341,6 @@ do
                         || _fail "            !!! clean $pkg failed"
             done
 
-            _log "        *** clean quota tools"
-            cd $WORKAREA/cmd/quota
-            ( rm -f configure ; autoconf ; sh configure ; make clean ) 2>&1 \
-                        || _fail "            !!! clean quota failed"
-
             _log "        *** clean linux"
             cd $WORKAREA/linux
             make mrproper 2>&1 \
@@ -366,7 +386,7 @@ do
                         || _fail "            !!! build modules failed"
                                     
             _log "        *** build and install tools"
-            for pkg in attr acl xfsprogs xfsdump xfstests 
+            for pkg in attr acl xfsprogs dmapi xfsdump xfstests 
             do
                 cd $WORKAREA/cmd/$pkg
 
@@ -381,17 +401,6 @@ do
                         || _fail "            !!! install $pkg failed"
             done
 
-            _log "        *** build and install quota tools"
-            cd $WORKAREA/cmd/quota
-            rm -f configure
-            
-            # use e-fence - but this will only take effect on configure
-            export MALLOCLIB=/usr/lib/libefence.a
-            ( autoconf ; sh configure --prefix=/usr; make all ) 2>&1 \
-                        || _fail "            !!! build quota failed"
-            _sudo make install 2>&1 \
-                        || _fail "            !!! install quota failed"
-
             new_state="install"
             ;;
             
@@ -442,9 +451,8 @@ do
             _log "            *** kernel"
             ls -l /boot/*$EXTRA*  2>&1
             _log "            *** kernel modules"
-            ls -l /lib/modules/$VERSION$EXTRA/kernel/fs/pagebuf/* \
-                  /lib/modules/$VERSION$EXTRA/kernel/fs/xfs/*     \
-                  /lib/modules/$VERSION$EXTRA/kernel/fs/xfs/support/* 
+            ls -l /lib/modules/$SVERSION$EXTRA/kernel/fs/xfs/* \
+                  /lib/modules/$SVERSION$EXTRA/kernel/fs/xfs_support/* 
             
             if [ $MODULAR -eq 0 ]
             then
@@ -466,7 +474,7 @@ do
             
             _log "            *** removing modules"
             
-            for m in xfsidbg xfs pagebuf kdbm_pg kdbm_vm
+            for m in xfsidbg xfs kdbm_pg kdbm_vm
             do
                 _sudo rmmod $m 2> /dev/null
             done