source: trunk/test/testcompile.sh@ 181

Last change on this file since 181 was 172, checked in by katerina, 16 years ago

Documentation update, more dnmalloc fixes.

File size: 28.8 KB
Line 
1#! /bin/sh
2
3#
4# Copyright Rainer Wichmann (2006)
5#
6# License Information:
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22# dnmalloc + flawfinder + (35 * 3)
23MAXTEST=107; export MAXTEST
24
25run_dnmalloc ()
26{
27 fail=0
28 if test x$1 = x0; then
29 [ -z "$verbose" ] || log_msg_ok "configure...";
30 $MAKE clean > /dev/null 2>> test_log
31 $MAKE test_dnmalloc > /dev/null 2>> test_log
32 if test x$? = x0; then
33 [ -z "$verbose" ] || log_msg_ok "make test_dnmalloc...";
34 else
35 [ -z "$quiet" ] && log_msg_fail "make test_dnmalloc...";
36 fail=1
37 fi
38 else
39 [ -z "$quiet" ] && log_msg_fail "configure...";
40 if [ x"$3" = xskip ]; then
41 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc";
42 fi
43 fail=1
44 fi
45 if [ $fail -eq 1 ]; then
46 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
47 return 1
48 fi
49 #
50 fail=0
51 ./test_dnmalloc >/dev/null
52 if test x$? = x0; then
53 [ -z "$verbose" ] || log_msg_ok "run 1 completed...";
54 ./test_dnmalloc 300 12 3000 150000 400 >/dev/null
55 if test x$? = x0; then
56 [ -z "$verbose" ] || log_msg_ok "run 2 completed...";
57 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
58 if test x$? = x0; then
59 [ -z "$verbose" ] || log_msg_ok "run 3 completed...";
60 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
61 if test x$? = x0; then
62 [ -z "$verbose" ] || log_msg_ok "run 4 completed...";
63 else
64 fail=1
65 fi
66 else
67 fail=1
68 fi
69 else
70 fail=1
71 fi
72 else
73 fail=1
74 fi
75 #
76 if test x$fail = x0; then
77 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "test dnmalloc";
78 return 0
79 else
80 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
81 return 1
82 fi
83}
84
85run_uno ()
86{
87 if [ -z "$doall" ]; then
88 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (uno)";
89 return 0
90 fi
91 #
92 UNO=`find_path uno`
93 #
94 if [ -z "$UNO" ]; then
95 log_skip $num $MAXTEST 'check w/uno (not in PATH)'
96 return 0
97 fi
98 #
99 cd src/
100 stat=`uno -DHAVE_MMAP=1 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`
101 if [ $stat -ne 1 ]; then
102 uno -DSH_WITH_CLIENT -DSH_WITH_SERVER -DHAVE_MMAP=1 -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1
103 retval=1
104 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (uno)";
105 else
106 retval=0
107 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (uno)";
108 fi
109 cd ..
110 return $retval
111}
112
113run_flawfinder ()
114{
115 flawfinder --minlevel=3 --quiet src/s*.c | \
116 egrep '^No hits found.' >/dev/null 2>&1
117 if [ $? -eq 0 ]; then
118 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
119 else
120 flawfinder --minlevel=3 --quiet src/s*.c >test_log 2>&1
121 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
122 return 1
123 fi
124}
125
126run_smatch ()
127{
128 export CDIR=`pwd`;
129
130 if [ -z "$doall" ]; then
131 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
132 return 0
133 fi
134
135 if [ ! -f "./x_samhain.c.sm" ]; then
136 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
137 return 0
138 fi
139
140 if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi
141 if [ -f ../../static/sm_scripts/smatch.pm ]; then
142 (
143 cd ../../static/sm_scripts;
144
145 for i in ${CDIR}/*.c.sm ; do
146 # echo $i;
147 cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
148 cat $i | ./ampersand_missing.sh;
149 cat $i | ./eqeq.pl;
150 cat $i | ./for_bounds.pl; # doesn't work?
151 cat $i | ./unchecked_returns.pl;
152 cat $i | ./uninitialized.pl; # doesn't work?
153
154 # from http://people.redhat.com/mstefani/wine/smatch/
155 if [ -f ./while_for_check.pl ]; then
156 cat $i | ./while_for_check.pl; # works
157 fi
158 # --> end wine <--
159
160 # samhain specific modifications (list of free/malloc funcs)
161 # doesn't seem to find anything useful
162 if [ $memcheck = xsimple ]; then
163 if [ -f ./samhain_unfree.pl ]; then
164 cat $i | ./samhain_unfree.pl | \
165 egrep -v 'x_cutest_.*Test_' | \
166 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
167 fi
168 fi
169 if [ $memcheck = xdebug ]; then
170 if [ -f ./samhain_unfree_debug.pl ]; then
171 cat $i | ./samhain_unfree_debug.pl | \
172 egrep -v 'x_cutest_.*Test_' | \
173 egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
174 fi
175 fi
176 # --> end samhain specific <--
177
178 echo malloc > list_null_funcs_uniq;
179 echo getenv >> list_null_funcs_uniq;
180 cat $i | ./deference_check.pl;
181 rm -f list_null_funcs_uniq;
182 rm -f $i
183 done
184 ) >test_log_smatch 2>&1
185 if [ -f test_log_smatch ]; then
186 lines=`cat test_log_smatch | wc -l`
187 if [ $lines -ne 0 ]; then
188 cat test_log_smatch
189 rm -f test_log_smatch
190 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)";
191 return 1
192 fi
193 fi
194 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)";
195 return 0
196 fi
197 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
198 return 0
199}
200
201testmake ()
202{
203 fail=0
204 if test x$1 = x0; then
205 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
206 $MAKE clean > /dev/null 2>> test_log
207 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
208 if test x$? = x0; then
209 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
210 else
211 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
212 fail=1
213 fi
214 else
215 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
216 if [ x"$3" = xskip ]; then
217 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
218 fi
219 fail=1
220 fi
221 if [ $fail -eq 1 ]; then
222 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
223 return 1
224 fi
225 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
226 return 0
227}
228
229testcompile ()
230{
231 log_start "COMPILE"
232
233 if [ "x$doall" = xon ]; then
234 uname -a | grep x86_64 >/dev/null
235 if [ $? -ne 0 ]; then
236 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then # FIXME
237 SAVE_CC="${CC}"
238 SMATCH="DBGDEF=--smatch"; export SMATCH
239 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
240 CC="/usr/local/gcc-smatch/bin/gcc"; export CC
241 SMATCH_CC="${CC}"
242 fi
243 fi
244 fi
245
246 num=0
247 numfail=0
248
249 #
250 # test dnmalloc
251 #
252 TEST="${S}check dnmalloc${E}"
253 #
254 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
255 #
256 let "num = num + 1" >/dev/null
257 #
258 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
259 #
260
261 #
262 # test flawfinder
263 #
264 TEST="${S}check w/flawfinder${E}"
265 #
266 #
267 let "num = num + 1" >/dev/null
268 FLAWFINDER=`find_path flawfinder`
269 #
270 if [ -z "$FLAWFINDER" ]; then
271 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
272 else
273 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
274 fi
275 #
276
277 #
278 # test standalone compilation
279 #
280 TEST="${S}standalone w/suidcheck w/procchk${E}"
281 #
282 if test -r "Makefile"; then
283 $MAKE distclean
284 fi
285 #
286 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-suidcheck --enable-process-check > /dev/null 2>> test_log
287 #
288 let "num = num + 1" >/dev/null
289 testmake $? $num || let "numfail = numfail + 1" >/dev/null
290 let "num = num + 1" >/dev/null
291 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
292 let "num = num + 1" >/dev/null
293 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
294
295 #
296 # test standalone compilation
297 #
298 TEST="${S}standalone static w/suidcheck w/procchk${E}"
299 #
300 if test -r "Makefile"; then
301 $MAKE distclean
302 fi
303 #
304 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
305 #
306 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check > /dev/null 2>> test_log
307 #
308 let "num = num + 1" >/dev/null
309 testmake $? $num || let "numfail = numfail + 1" >/dev/null
310 let "num = num + 1" >/dev/null
311 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
312 let "num = num + 1" >/dev/null
313 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
314 #
315 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
316 #
317 # test standalone compilation
318 #
319 TEST="${S}standalone w/procchk w/portchk${E}"
320 #
321 if test -r "Makefile"; then
322 $MAKE distclean
323 fi
324 #
325 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-process-check --enable-port-check > /dev/null 2>> test_log
326 #
327 let "num = num + 1" >/dev/null
328 testmake $? $num || let "numfail = numfail + 1" >/dev/null
329 let "num = num + 1" >/dev/null
330 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
331 let "num = num + 1" >/dev/null
332 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
333
334 #
335 # test standalone compilation
336 #
337 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
338 #
339 if test -r "Makefile"; then
340 $MAKE distclean
341 fi
342 #
343 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-stealth=164 --enable-process-check --enable-port-check > /dev/null 2>> test_log
344 #
345 let "num = num + 1" >/dev/null
346 testmake $? $num || let "numfail = numfail + 1" >/dev/null
347 let "num = num + 1" >/dev/null
348 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
349 let "num = num + 1" >/dev/null
350 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
351
352 #
353 # test standalone compilation
354 #
355 TEST="${S}standalone w/mounts-check w/userfiles${E}"
356 #
357 if test -r "Makefile"; then
358 $MAKE distclean
359 fi
360 #
361 ${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
362 #
363 let "num = num + 1" >/dev/null
364 testmake $? $num || let "numfail = numfail + 1" >/dev/null
365 let "num = num + 1" >/dev/null
366 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
367 let "num = num + 1" >/dev/null
368 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
369
370
371 #
372 # test standalone compilation
373 #
374 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
375 #
376 if test -r "Makefile"; then
377 $MAKE clean
378 fi
379 #
380 ${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
381 #
382 let "num = num + 1" >/dev/null
383 testmake $? $num || let "numfail = numfail + 1" >/dev/null
384 let "num = num + 1" >/dev/null
385 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
386 let "num = num + 1" >/dev/null
387 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
388
389 #
390 # test standalone compilation with --with-nocl=PW
391 #
392 TEST="${S}standalone w/nocl${E}"
393 #
394 if test -r "Makefile"; then
395 $MAKE clean
396 fi
397 #
398 ${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
399 #
400 let "num = num + 1" >/dev/null
401 testmake $? $num || let "numfail = numfail + 1" >/dev/null
402 let "num = num + 1" >/dev/null
403 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
404 let "num = num + 1" >/dev/null
405 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
406
407 #
408 # test standalone compilation w/ debug
409 #
410 TEST="${S}standalone w/debug${E}"
411 #
412 if test -r "Makefile"; then
413 $MAKE clean
414 fi
415 #
416 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
417 #
418 let "num = num + 1" >/dev/null
419 testmake $? $num || let "numfail = numfail + 1" >/dev/null
420 let "num = num + 1" >/dev/null
421 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
422 let "num = num + 1" >/dev/null
423 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
424
425 #
426 # test standalone compilation w/ gpg
427 #
428 TEST="${S}standalone w/gpg${E}"
429 #
430 GPG=`find_path gpg`
431 let "num = num + 1" >/dev/null
432 #
433 if [ -z "$GPG" ]; then
434 log_skip $num $MAXTEST 'gpg not in PATH'
435 let "num = num + 1" >/dev/null
436 log_skip $num $MAXTEST 'gpg not in PATH'
437 else
438 if test -r "Makefile"; then
439 $MAKE clean
440 fi
441 #
442 ${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
443 #
444 testmake $? $num || let "numfail = numfail + 1" >/dev/null
445 let "num = num + 1" >/dev/null
446 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
447 let "num = num + 1" >/dev/null
448 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
449 fi
450
451 #
452 # test standalone compilation w/stealth
453 #
454 TEST="${S}standalone w/stealth${E}"
455 #
456 if test -r "Makefile"; then
457 $MAKE clean
458 fi
459 #
460 ${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
461 #
462 let "num = num + 1" >/dev/null
463 testmake $? $num || let "numfail = numfail + 1" >/dev/null
464 let "num = num + 1" >/dev/null
465 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
466 let "num = num + 1" >/dev/null
467 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
468
469 #
470 # test standalone compilation w/logwatch
471 #
472 TEST="${S}standalone w/login-watch${E}"
473 #
474 if test -r "Makefile"; then
475 $MAKE clean
476 fi
477 #
478 ${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
479 #
480 let "num = num + 1" >/dev/null
481 testmake $? $num || let "numfail = numfail + 1" >/dev/null
482 let "num = num + 1" >/dev/null
483 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
484 let "num = num + 1" >/dev/null
485 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
486
487 #
488 # test standalone compilation w/mysql
489 #
490 TEST="${S}standalone w/mysql${E}"
491 #
492 if test -r "Makefile"; then
493 $MAKE clean
494 fi
495 #
496 ${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
497 #
498 let "num = num + 1" >/dev/null
499 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
500 let "num = num + 1" >/dev/null
501 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
502 let "num = num + 1" >/dev/null
503 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
504
505 #
506 # test standalone compilation w/mysql and stealth
507 #
508 TEST="${S}standalone w/mysql+stealth${E}"
509 #
510 if test -r "Makefile"; then
511 $MAKE clean
512 fi
513 #
514 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=mysql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
515 #
516 let "num = num + 1" >/dev/null
517 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
518 let "num = num + 1" >/dev/null
519 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
520 let "num = num + 1" >/dev/null
521 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
522
523 #
524 # test standalone compilation w/postgresql
525 #
526 TEST="${S}standalone w/postgresql${E}"
527 #
528 if test -r "Makefile"; then
529 $MAKE clean
530 fi
531 #
532 ${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
533 #
534 let "num = num + 1" >/dev/null
535 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
536 let "num = num + 1" >/dev/null
537 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
538 let "num = num + 1" >/dev/null
539 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
540
541 #
542 # test standalone compilation w/postgresql+stealth
543 #
544 TEST="${S}standalone w/postgresql+stealth${E}"
545 #
546 if test -r "Makefile"; then
547 $MAKE clean
548 fi
549 #
550 ${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=postgresql --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
551 #
552 let "num = num + 1" >/dev/null
553 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
554 let "num = num + 1" >/dev/null
555 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
556 let "num = num + 1" >/dev/null
557 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
558
559 #
560 # test standalone compilation
561 #
562 TEST="${S}standalone w/o mail w/unix_rnd${E}"
563 #
564 if test -r "Makefile"; then
565 $MAKE clean
566 fi
567 #
568 ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-rnd=unix > /dev/null 2>> test_log
569 #
570 let "num = num + 1" >/dev/null
571 testmake $? $num || let "numfail = numfail + 1" >/dev/null
572 let "num = num + 1" >/dev/null
573 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
574 let "num = num + 1" >/dev/null
575 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
576
577 #
578 # test standalone compilation
579 #
580 TEST="${S}standalone w/o external${E}"
581 #
582 if test -r "Makefile"; then
583 $MAKE clean
584 fi
585 #
586 ${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
587 #
588 let "num = num + 1" >/dev/null
589 testmake $? $num || let "numfail = numfail + 1" >/dev/null
590 let "num = num + 1" >/dev/null
591 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
592 let "num = num + 1" >/dev/null
593 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
594
595 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
596
597 #
598 # test client/server compilation
599 #
600 TEST="${S}client/server application w/timeserver${E}"
601 #
602 if test -r "Makefile"; then
603 $MAKE clean
604 fi
605 #
606 ${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
607 #
608 let "num = num + 1" >/dev/null
609 testmake $? $num || let "numfail = numfail + 1" >/dev/null
610 let "num = num + 1" >/dev/null
611 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
612 let "num = num + 1" >/dev/null
613 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
614
615 if test -r "Makefile"; then
616 $MAKE clean
617 fi
618 #
619 ${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
620 #
621 let "num = num + 1" >/dev/null
622 testmake $? $num || let "numfail = numfail + 1" >/dev/null
623 let "num = num + 1" >/dev/null
624 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
625 let "num = num + 1" >/dev/null
626 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
627
628 #
629 # test client/server compilation
630 #
631 TEST="${S}client/server application static w/timeserver${E}"
632 #
633 if test -r "Makefile"; then
634 $MAKE clean
635 fi
636 #
637 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
638 #
639 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-static --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
640 #
641 let "num = num + 1" >/dev/null
642 testmake $? $num || let "numfail = numfail + 1" >/dev/null
643 let "num = num + 1" >/dev/null
644 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
645 let "num = num + 1" >/dev/null
646 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
647
648 if test -r "Makefile"; then
649 $MAKE clean
650 fi
651 #
652 ${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-static --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
653 #
654 let "num = num + 1" >/dev/null
655 testmake $? $num || let "numfail = numfail + 1" >/dev/null
656 let "num = num + 1" >/dev/null
657 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
658 let "num = num + 1" >/dev/null
659 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
660 #
661 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
662 #
663 # test c/s compilation w/ gpg
664 #
665 TEST="${S}client/server application w/gpg${E}"
666 #
667 GPG=`find_path gpg`
668 let "num = num + 1" >/dev/null
669 #
670 if [ -z "$GPG" ]; then
671 log_skip $num $MAXTEST 'gpg not in PATH'
672 let "num = num + 1" >/dev/null
673 log_skip $num $MAXTEST 'gpg not in PATH'
674 let "num = num + 1" >/dev/null
675 log_skip $num $MAXTEST 'gpg not in PATH'
676 let "num = num + 1" >/dev/null
677 log_skip $num $MAXTEST 'gpg not in PATH'
678 else
679 if test -r "Makefile"; then
680 $MAKE clean
681 fi
682 #
683 ${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
684 #
685 testmake $? $num || let "numfail = numfail + 1" >/dev/null
686 let "num = num + 1" >/dev/null
687 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
688 let "num = num + 1" >/dev/null
689 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
690 #
691 if test -r "Makefile"; then
692 $MAKE clean
693 fi
694 #
695 ${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
696 #
697 let "num = num + 1" >/dev/null
698 testmake $? $num || let "numfail = numfail + 1" >/dev/null
699 let "num = num + 1" >/dev/null
700 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
701 let "num = num + 1" >/dev/null
702 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
703 fi
704
705
706 #
707 # test client/server compilation
708 #
709 TEST="${S}client/server application w/o srp${E}"
710 #
711 if test -r "Makefile"; then
712 $MAKE clean
713 fi
714 #
715 ${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
716 #
717 let "num = num + 1" >/dev/null
718 testmake $? $num || let "numfail = numfail + 1" >/dev/null
719 let "num = num + 1" >/dev/null
720 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
721 let "num = num + 1" >/dev/null
722 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
723 #
724 if test -r "Makefile"; then
725 $MAKE clean
726 fi
727 #
728 ${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
729 #
730 let "num = num + 1" >/dev/null
731 testmake $? $num || let "numfail = numfail + 1" >/dev/null
732 let "num = num + 1" >/dev/null
733 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
734 let "num = num + 1" >/dev/null
735 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
736
737 #
738 # test client/server compilation w/ debug
739 #
740 TEST="${S}client/server application w/debug${E}"
741 #
742 if test -r "Makefile"; then
743 $MAKE clean
744 fi
745 #
746 ${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
747 #
748 let "num = num + 1" >/dev/null
749 testmake $? $num || let "numfail = numfail + 1" >/dev/null
750 let "num = num + 1" >/dev/null
751 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
752 let "num = num + 1" >/dev/null
753 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
754 #
755 if test -r "Makefile"; then
756 $MAKE clean
757 fi
758 #
759 ${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
760 #
761 let "num = num + 1" >/dev/null
762 testmake $? $num || let "numfail = numfail + 1" >/dev/null
763 let "num = num + 1" >/dev/null
764 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
765 let "num = num + 1" >/dev/null
766 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
767
768 #
769 # test client/server compilation w/stealth
770 #
771 TEST="${S}client/server application w/stealth${E}"
772 #
773 if test -r "Makefile"; then
774 $MAKE clean
775 fi
776 #
777 ${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
778 #
779 let "num = num + 1" >/dev/null
780 testmake $? $num || let "numfail = numfail + 1" >/dev/null
781 let "num = num + 1" >/dev/null
782 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
783 let "num = num + 1" >/dev/null
784 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
785 #
786 if test -r "Makefile"; then
787 $MAKE clean
788 fi
789 #
790 ${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
791 #
792 let "num = num + 1" >/dev/null
793 testmake $? $num || let "numfail = numfail + 1" >/dev/null
794 let "num = num + 1" >/dev/null
795 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
796 let "num = num + 1" >/dev/null
797 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
798
799 #
800 # test client/server compilation w/logwatch
801 #
802 TEST="${S}client/server application w/login-watch${E}"
803 #
804 if test -r "Makefile"; then
805 $MAKE clean
806 fi
807 #
808 ${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
809 #
810 let "num = num + 1" >/dev/null
811 testmake $? $num || let "numfail = numfail + 1" >/dev/null
812 let "num = num + 1" >/dev/null
813 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
814 let "num = num + 1" >/dev/null
815 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
816 #
817 if test -r "Makefile"; then
818 $MAKE clean
819 fi
820 #
821 ${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
822 #
823 let "num = num + 1" >/dev/null
824 testmake $? $num || let "numfail = numfail + 1" >/dev/null
825 let "num = num + 1" >/dev/null
826 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
827 let "num = num + 1" >/dev/null
828 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
829
830 #
831 # test client/server compilation
832 #
833 TEST="${S}client/server application w/o mail${E}"
834 #
835 if test -r "Makefile"; then
836 $MAKE clean
837 fi
838 #
839 ${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
840 #
841 let "num = num + 1" >/dev/null
842 testmake $? $num || let "numfail = numfail + 1" >/dev/null
843 let "num = num + 1" >/dev/null
844 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
845 let "num = num + 1" >/dev/null
846 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
847 #
848 if test -r "Makefile"; then
849 $MAKE clean
850 fi
851 #
852 ${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
853 #
854 let "num = num + 1" >/dev/null
855 testmake $? $num || let "numfail = numfail + 1" >/dev/null
856 let "num = num + 1" >/dev/null
857 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
858 let "num = num + 1" >/dev/null
859 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
860
861 #
862 # test client/server compilation
863 #
864 TEST="${S}client/server application w/o external${E}"
865 #
866 if test -r "Makefile"; then
867 $MAKE clean
868 fi
869 #
870 ${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
871 #
872 let "num = num + 1" >/dev/null
873 testmake $? $num || let "numfail = numfail + 1" >/dev/null
874 let "num = num + 1" >/dev/null
875 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
876 let "num = num + 1" >/dev/null
877 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
878 #
879 if test -r "Makefile"; then
880 $MAKE clean
881 fi
882 #
883 ${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
884 #
885 let "num = num + 1" >/dev/null
886 testmake $? $num || let "numfail = numfail + 1" >/dev/null
887 let "num = num + 1" >/dev/null
888 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
889 let "num = num + 1" >/dev/null
890 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
891
892 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
893
894 log_end "COMPILE"
895}
Note: See TracBrowser for help on using the repository browser.