Index: trunk/test/test.sh
===================================================================
--- trunk/test/test.sh	(revision 19)
+++ trunk/test/test.sh	(revision 22)
@@ -40,4 +40,5 @@
     echo "  ${S}test.sh  6${E}  -- Controlling the daemon"
     echo "  ${S}test.sh  7${E}  -- GnuPG signed files / prelude log"
+    echo "  ${S}test.sh  8${E}  -- Suidcheck"
 
     echo "  ${S}test.sh 10${E}  -- Test c/s init/check      (testrc_2.in)"
@@ -46,11 +47,13 @@
     echo "  ${S}test.sh 13${E}  -- Test full c/s w/mysql    (testrc_2.in)"
     echo "  ${S}test.sh 14${E}  -- Test full c/s w/postgres (testrc_2.in)"
-    echo "  ${S}test.sh all${E} -- All except 12+"
-    
+    echo "  ${S}test.sh all${E} -- All tests"
+}
+scripts () {
     echo 
-    echo "Scripts used by tests (located in ${SCRIPTDIR}):"
+    echo "Scripts used by tests:"
     echo "  (1) testcompile.sh (2) testhash.sh     (3) testrun_1.sh   (4) testrun_1a.sh"
-    echo "  (5) testext.sh     (6) testtimesrv.sh  (7) testrun_1b.sh (10) testrun_2.sh"
-    echo " (11) testrun_2a.sh (12) testrun_2b.sh  (13) testrun_2c.sh (14) testrun_2d.sh"
+    echo "  (5) testext.sh     (6) testtimesrv.sh  (7) testrun_1b.sh  (8) testrun_1c.sh" 
+    echo " (10) testrun_2.sh  (11) testrun_2a.sh  (12) testrun_2b.sh (13) testrun_2c.sh"
+    echo " (14) testrun_2d.sh"
 }
 
@@ -64,4 +67,5 @@
 cleanup=on
 doall=
+usevalgrind=
 
 while [ $# -gt 0 ]
@@ -69,4 +73,5 @@
     case "$1" in
         -h|--help)     usage; exit 0;;
+	--scripts)     usage; scripts; exit 0;;
         -v|--verbose)  verbose=on; quiet= ;;
         -q|--quiet)    quiet=on; verbose= ;;
@@ -74,4 +79,5 @@
 	--no-cleanup) cleanup= ;;
 	--really-all) doall=on;;
+	--valgrind) usevalgrind=on;;
 	--srcdir=*)    TOP_SRCDIR=`echo $1 | sed s,--srcdir=,,`; export TOP_SRCDIR;;
 	--color=*)     
@@ -285,8 +291,12 @@
     rm -f ./.samhain_log*
     rm -f ./.samhain_lock
-    test -d testrun_data && chmod -R 0700 testrun_data
-    rm -rf testrun_data
+    test -d testrun_testdata && chmod -R 0700 testrun_testdata
+    test -d .quarantine && rm -rf .quarantine
+    rm -rf testrun_testdata
     rm -f test_log_db
     rm -f test_log_prelude
+    rm -f test_log_valgrind
+    rm -f test_log_yulectl
+    rm -f yule.html
 }
 
@@ -342,4 +352,50 @@
 fi
 
+# Seems that 'valgrind' causes random hangs :-(
+#
+if [ -z "$usevalgrind" ]; then
+    VALGRIND=
+else
+    VALGRIND=`find_path valgrind`;
+fi
+[ -z "$VALGRIND" ] || { 
+    VALGRIND="$VALGRIND --quiet --tool=memcheck --suppressions=.test.supp"; 
+    export VALGRIND;
+    [ -z "$verbose" ] || log_msg_ok "using valgrind"
+cat > ".test.supp" <<End-of-data
+#
+# there are unitialized bytes in the struct...
+#
+{
+   pushdata_01
+   Memcheck:Param
+   write(buf)
+   obj:/lib/ld-*.so
+   fun:sh_hash_pushdata
+   fun:sh_files_filecheck
+   fun:sh_dirs_chk
+}
+{
+   pushdata_02
+   Memcheck:Param
+   write(buf)
+   obj:/lib/ld-*.so
+   fun:sh_hash_pushdata
+   fun:sh_files_filecheck
+   fun:sh_files_checkdir
+}
+{
+   pushdata_03
+   Memcheck:Param
+   write(buf)
+   obj:/lib/ld-*.so
+   fun:sh_hash_pushdata
+   fun:sh_hash_writeout
+   fun:main
+}
+
+End-of-data
+}
+
 if test x$1 = x1; then
     . ${SCRIPTDIR}/testcompile.sh
@@ -385,4 +441,11 @@
     exit $?
 fi
+if test x$1 = x8; then
+    . ${SCRIPTDIR}/testrun_1.sh
+    . ${SCRIPTDIR}/testrun_1c.sh
+    testrun1c
+    print_summary
+    exit $?
+fi
 if test x$1 = x10; then
     . ${SCRIPTDIR}/testrun_2.sh 
@@ -434,4 +497,6 @@
     . ${SCRIPTDIR}/testrun_1b.sh
     let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
+    . ${SCRIPTDIR}/testrun_1c.sh
+    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
     . ${SCRIPTDIR}/testrun_2.sh
     let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
@@ -471,4 +536,9 @@
     MAXTEST=${TEST_MAX}; export MAXTEST
     testrun1b
+    #
+    . ${SCRIPTDIR}/testrun_1.sh
+    . ${SCRIPTDIR}/testrun_1c.sh
+    MAXTEST=${TEST_MAX}; export MAXTEST
+    testrun1c
     #
     . ${SCRIPTDIR}/testrun_2.sh
