source: trunk/test/testcompile.sh@ 19

Last change on this file since 19 was 19, checked in by rainer, 19 years ago

Rewrite of test suite, checksum for growing logs, fix for minor bug with dead client detection.

File size: 12.3 KB
Line 
1#! /bin/sh
2
3MAXTEST=28; export MAXTEST
4
5testmake ()
6{
7 fail=0
8 if test x$1 = x0; then
9 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
10 $MAKE cutest > /dev/null 2>> test_log
11 if test x$? = x0; then
12 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
13 else
14 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
15 fail=1
16 fi
17 else
18 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
19 if [ x"$3" = xskip ]; then
20 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
21 fi
22 fail=1
23 fi
24 if [ $fail -eq 1 ]; then
25 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
26 return 1
27 fi
28 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
29 return 0
30}
31
32testcompile ()
33{
34 log_start "COMPILE"
35
36 num=0
37 numfail=0
38
39 #
40 # test standalone compilation
41 #
42 TEST="${S}standalone agent w/suidcheck${E}"
43 #
44 if test -r "Makefile"; then
45 $MAKE distclean
46 fi
47 #
48 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-suidcheck > /dev/null 2>> test_log
49 #
50 let "num = num + 1" >/dev/null
51 testmake $? $num || let "numfail = numfail + 1" >/dev/null
52
53 #
54 # test standalone compilation
55 #
56 TEST="${S}standalone agent w/mounts-check and w/userfiles${E}"
57 #
58 if test -r "Makefile"; then
59 $MAKE distclean
60 fi
61 #
62 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-mounts-check --enable-userfiles > /dev/null 2>> test_log
63 #
64 let "num = num + 1" >/dev/null
65 testmake $? $num || let "numfail = numfail + 1" >/dev/null
66
67
68 #
69 # test standalone compilation
70 #
71 TEST="${S}standalone agent w/timeserver and w/message-queue${E}"
72 #
73 if test -r "Makefile"; then
74 $MAKE clean
75 fi
76 #
77 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-message-queue --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
78 #
79 let "num = num + 1" >/dev/null
80 testmake $? $num || let "numfail = numfail + 1" >/dev/null
81
82 #
83 # test standalone compilation with --with-nocl=PW
84 #
85 TEST="${S}standalone agent w/nocl${E}"
86 #
87 if test -r "Makefile"; then
88 $MAKE clean
89 fi
90 #
91 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
92 #
93 let "num = num + 1" >/dev/null
94 testmake $? $num || let "numfail = numfail + 1" >/dev/null
95
96 #
97 # test standalone compilation w/ debug
98 #
99 TEST="${S}standalone agent w/debug${E}"
100 #
101 if test -r "Makefile"; then
102 $MAKE clean
103 fi
104 #
105 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
106 #
107 let "num = num + 1" >/dev/null
108 testmake $? $num || let "numfail = numfail + 1" >/dev/null
109
110 #
111 # test standalone compilation w/ gpg
112 #
113 TEST="${S}standalone agent w/gpg${E}"
114 #
115 GPG=`find_path gpg`
116 let "num = num + 1" >/dev/null
117 #
118 if [ -z "$GPG" ]; then
119 log_skip $num $MAXTEST 'gpg not in PATH'
120 else
121 if test -r "Makefile"; then
122 $MAKE clean
123 fi
124 #
125 ${TOP_SRCDIR}/configure --quiet --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
126 #
127 testmake $? $num || let "numfail = numfail + 1" >/dev/null
128 fi
129
130 #
131 # test standalone compilation w/stealth
132 #
133 TEST="${S}standalone agent w/stealth${E}"
134 #
135 if test -r "Makefile"; then
136 $MAKE clean
137 fi
138 #
139 ${TOP_SRCDIR}/configure --quiet --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
140 #
141 let "num = num + 1" >/dev/null
142 testmake $? $num || let "numfail = numfail + 1" >/dev/null
143
144 #
145 # test standalone compilation w/logwatch
146 #
147 TEST="${S}standalone agent w/login-watch${E}"
148 #
149 if test -r "Makefile"; then
150 $MAKE clean
151 fi
152 #
153 ${TOP_SRCDIR}/configure --quiet --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
154 #
155 let "num = num + 1" >/dev/null
156 testmake $? $num || let "numfail = numfail + 1" >/dev/null
157
158 #
159 # test standalone compilation w/mysql
160 #
161 TEST="${S}standalone agent w/mysql${E}"
162 #
163 if test -r "Makefile"; then
164 $MAKE clean
165 fi
166 #
167 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=mysql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
168 #
169 let "num = num + 1" >/dev/null
170 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
171
172 #
173 # test standalone compilation w/postgresql
174 #
175 TEST="${S}standalone agent w/postgresql${E}"
176 #
177 if test -r "Makefile"; then
178 $MAKE clean
179 fi
180 #
181 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=postgresql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
182 #
183 let "num = num + 1" >/dev/null
184 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
185
186 #
187 # test standalone compilation
188 #
189 TEST="${S}standalone agent w/o mail${E}"
190 #
191 if test -r "Makefile"; then
192 $MAKE clean
193 fi
194 #
195 ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
196 #
197 let "num = num + 1" >/dev/null
198 testmake $? $num || let "numfail = numfail + 1" >/dev/null
199
200 #
201 # test standalone compilation
202 #
203 TEST="${S}standalone agent w/o external scripts${E}"
204 #
205 if test -r "Makefile"; then
206 $MAKE clean
207 fi
208 #
209 ${TOP_SRCDIR}/configure --quiet --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
210 #
211 let "num = num + 1" >/dev/null
212 testmake $? $num || let "numfail = numfail + 1" >/dev/null
213
214 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
215
216 #
217 # test client/server compilation
218 #
219 TEST="${S}client/server application w/timeserver${E}"
220 #
221 if test -r "Makefile"; then
222 $MAKE clean
223 fi
224 #
225 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
226 #
227 let "num = num + 1" >/dev/null
228 testmake $? $num || let "numfail = numfail + 1" >/dev/null
229
230 if test -r "Makefile"; then
231 $MAKE clean
232 fi
233 #
234 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
235 #
236 let "num = num + 1" >/dev/null
237 testmake $? $num || let "numfail = numfail + 1" >/dev/null
238
239 #
240 # test c/s compilation w/ gpg
241 #
242 TEST="${S}client/server application w/gpg${E}"
243 #
244 GPG=`find_path gpg`
245 let "num = num + 1" >/dev/null
246 #
247 if [ -z "$GPG" ]; then
248 log_skip $num $MAXTEST 'gpg not in PATH'
249 let "num = num + 1" >/dev/null
250 log_skip $num $MAXTEST 'gpg not in PATH'
251 else
252 if test -r "Makefile"; then
253 $MAKE clean
254 fi
255 #
256 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
257 #
258 testmake $? $num || let "numfail = numfail + 1" >/dev/null
259 #
260 if test -r "Makefile"; then
261 $MAKE clean
262 fi
263 #
264 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
265 #
266 let "num = num + 1" >/dev/null
267 testmake $? $num || let "numfail = numfail + 1" >/dev/null
268 fi
269
270
271 #
272 # test client/server compilation
273 #
274 TEST="${S}client/server application w/o srp${E}"
275 #
276 if test -r "Makefile"; then
277 $MAKE clean
278 fi
279 #
280 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
281 #
282 let "num = num + 1" >/dev/null
283 testmake $? $num || let "numfail = numfail + 1" >/dev/null
284 #
285 if test -r "Makefile"; then
286 $MAKE clean
287 fi
288 #
289 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
290 #
291 let "num = num + 1" >/dev/null
292 testmake $? $num || let "numfail = numfail + 1" >/dev/null
293
294 #
295 # test client/server compilation w/ debug
296 #
297 TEST="${S}client/server application w/debug${E}"
298 #
299 if test -r "Makefile"; then
300 $MAKE clean
301 fi
302 #
303 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
304 #
305 let "num = num + 1" >/dev/null
306 testmake $? $num || let "numfail = numfail + 1" >/dev/null
307 #
308 if test -r "Makefile"; then
309 $MAKE clean
310 fi
311 #
312 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
313 #
314 let "num = num + 1" >/dev/null
315 testmake $? $num || let "numfail = numfail + 1" >/dev/null
316
317 #
318 # test client/server compilation w/stealth
319 #
320 TEST="${S}client/server application w/stealth${E}"
321 #
322 if test -r "Makefile"; then
323 $MAKE clean
324 fi
325 #
326 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
327 #
328 let "num = num + 1" >/dev/null
329 testmake $? $num || let "numfail = numfail + 1" >/dev/null
330 #
331 if test -r "Makefile"; then
332 $MAKE clean
333 fi
334 #
335 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
336 #
337 let "num = num + 1" >/dev/null
338 testmake $? $num || let "numfail = numfail + 1" >/dev/null
339
340 #
341 # test client/server compilation w/logwatch
342 #
343 TEST="${S}client/server application w/login-watch${E}"
344 #
345 if test -r "Makefile"; then
346 $MAKE clean
347 fi
348 #
349 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
350 #
351 let "num = num + 1" >/dev/null
352 testmake $? $num || let "numfail = numfail + 1" >/dev/null
353 #
354 if test -r "Makefile"; then
355 $MAKE clean
356 fi
357 #
358 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
359 #
360 let "num = num + 1" >/dev/null
361 testmake $? $num || let "numfail = numfail + 1" >/dev/null
362
363 #
364 # test client/server compilation
365 #
366 TEST="${S}client/server application w/o mail${E}"
367 #
368 if test -r "Makefile"; then
369 $MAKE clean
370 fi
371 #
372 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
373 #
374 let "num = num + 1" >/dev/null
375 testmake $? $num || let "numfail = numfail + 1" >/dev/null
376 #
377 if test -r "Makefile"; then
378 $MAKE clean
379 fi
380 #
381 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
382 #
383 let "num = num + 1" >/dev/null
384 testmake $? $num || let "numfail = numfail + 1" >/dev/null
385
386 #
387 # test client/server compilation
388 #
389 TEST="${S}client/server application w/o external scripts${E}"
390 #
391 if test -r "Makefile"; then
392 $MAKE clean
393 fi
394 #
395 ${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
396 #
397 let "num = num + 1" >/dev/null
398 testmake $? $num || let "numfail = numfail + 1" >/dev/null
399 #
400 if test -r "Makefile"; then
401 $MAKE clean
402 fi
403 #
404 ${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
405 #
406 let "num = num + 1" >/dev/null
407 testmake $? $num || let "numfail = numfail + 1" >/dev/null
408
409 log_end "COMPILE"
410}
Note: See TracBrowser for help on using the repository browser.