annotate test.bash @ 108:1c7677042b78

move to autoconf/automake/docbook
author carl
date Sun, 18 Dec 2005 12:05:05 -0800
parents c3e9fa6b37c6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a9758165cd Initial revision
carl
parents:
diff changeset
1 #!/bin/bash
96a9758165cd Initial revision
carl
parents:
diff changeset
2
14
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
3 ############################
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
4 ## compile and run the test program
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
5 ##
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
6 #g++ -c test.cpp
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
7 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
8 # echo "compiler errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
9 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
10 #fi
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
11 #g++ -o test test.o -pthread
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
12 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
13 # echo "linker errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
14 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
15 #fi
13
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
16
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
17
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
18 ###########################
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
19 # compile the milter
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
20 #
76
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
21
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
22 if [ "$1" == "build" ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
23 rm -f dnsbl.o scanner.o context.o tokenizer.o
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
24 g++ -c -pthread dnsbl.cpp scanner.cpp context.cpp tokenizer.cpp
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
25 if [ $? -ne 0 ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
26 echo "compiler errors"
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
27 exit
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
28 fi
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
29 g++ -o dnsbl dnsbl.o scanner.o context.o tokenizer.o /usr/lib/libresolv.a -lmilter -pthread
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
30 if [ $? -ne 0 ]; then
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
31 echo "linker errors"
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
32 exit
81f1e400e8ab start coding on new config syntax
carl
parents: 74
diff changeset
33 fi
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
34 fi
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
35
90
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
36 if [ "$1" == "test" ]; then
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
37 # build the test.cf file
105
c3e9fa6b37c6 move to autoconf/automake/docbook
carl
parents: 90
diff changeset
38 make -f Makefile.test test.cf
0
96a9758165cd Initial revision
carl
parents:
diff changeset
39
90
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
40 # start the milter
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
41 pid=/var/run/dnsbl.pid
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
42 echo start the milter
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
43 mkdir -p /var/run/dnsbl
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
44 chmod 700 /var/run/dnsbl
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
45 chown dnsbl:dnsbl /var/run/dnsbl
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
46 mv -f $pid $pid.save
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
47 ./dnsbl -d 10 -r /var/run/dnsbl/dnsbl.resolver.sock2 -p local:/var/run/dnsbl/dnsbl.sock2
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
48 sleep 5
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
49 P2=`cat $pid`
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
50 mv -f $pid.save $pid
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
51 echo started dnsbl milter as process $P2
0
96a9758165cd Initial revision
carl
parents:
diff changeset
52
90
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
53 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
54 sleep 5
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
55 P3=`head -1 /var/run/sm-test.pid`
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
56 echo started sendmail as process $P3
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
57
90
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
58 echo eventually "'"kill -KILL $P2 $P3"'"
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
59
90
962a1f8f1d9f add verify statement to verify addresses with better mx host
carl
parents: 89
diff changeset
60 fi