diff test.bash @ 13:75e1a9bcbc2e

gpl3, add removal option for original recipients
author carl
date Sat, 25 Aug 2007 11:14:49 -0700
parents 45c8592d5d13
children
line wrap: on
line diff
--- a/test.bash	Mon Mar 19 22:38:37 2007 -0700
+++ b/test.bash	Sat Aug 25 11:14:49 2007 -0700
@@ -1,60 +1,26 @@
 #!/bin/bash
 
-############################
-## compile and run the test program
-##
-#g++ -c test.cpp
-#if [ $? -ne 0 ]; then
-#    echo "compiler errors"
-#    exit
-#fi
-#g++ -o test test.o -pthread
-#if [ $? -ne 0 ]; then
-#    echo "linker errors"
-#    exit
-#fi
-
-
-###########################
-# compile the milter
-#
-
-if [ "$1" == "build" ]; then
-    rm -f dnsbl.o scanner.o context.o tokenizer.o
-    g++ -c -pthread dnsbl.cpp scanner.cpp context.cpp tokenizer.cpp
-    if [ $? -ne 0 ]; then
-        echo "compiler errors"
-        exit
-    fi
-    g++ -o dnsbl dnsbl.o scanner.o context.o tokenizer.o /usr/lib/libresolv.a -lmilter -pthread
-    if [ $? -ne 0 ]; then
-        echo "linker errors"
-        exit
-    fi
-fi
-
-if [ "$1" == "test" ]; then
     # build the test.cf file
     make -f Makefile.test test.cf
 
     # start the milter
-    pid=/var/run/dnsbl.pid
+pid=/var/run/sm-archive.pid
     echo start the milter
-    mkdir -p /var/run/dnsbl
-    chmod 700 /var/run/dnsbl
-    chown dnsbl:dnsbl /var/run/dnsbl
-    mv -f $pid $pid.save
-    ./dnsbl -d 10 -r /var/run/dnsbl/dnsbl.resolver.sock2 -p local:/var/run/dnsbl/dnsbl.sock2
+mkdir -p /var/run/smarchive
+chmod 700 /var/run/smarchive
+#chown smarchive:smarchive /var/run/smarchive
+[ -f "$pid" ] && mv -f $pid $pid.save
+valgrind --leak-check=full --show-reachable=yes src/smarchive -d 10 -p local:/var/run/smarchive/smarchive.sock
     sleep 5
     P2=`cat $pid`
-    mv -f $pid.save $pid
-    echo started dnsbl milter as process $P2
+[ -f "$pid.save" ] && mv -f $pid.save $pid
+echo started smarchive milter as process $P2
 
-    /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
+/usr/lib/sendmail -bd -Ctest.cf -Lsmarchive
     sleep 5
     P3=`head -1 /var/run/sm-test.pid`
     echo started sendmail as process $P3
 
-    echo eventually "'"kill -KILL $P2 $P3"'"
-
-fi
+echo  "eventually, run the following two kill commands"
+echo  kill -SIGINT $P2
+echo  kill -KILL $P3