source: trunk/test/testcompile.sh@ 272

Last change on this file since 272 was 257, checked in by katerina, 15 years ago

Fix for issues with debug code and testsuite (tickets #174, #175).

File size: 30.4 KB
RevLine 
[1]1#! /bin/sh
2
[27]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
[210]22# dnmalloc + flawfinder + (36 * 3)
23MAXTEST=110; export MAXTEST
[1]24
[171]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/
[172]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`
[171]101 if [ $stat -ne 1 ]; then
[172]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
[171]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
[30]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
[22]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
[170]135 if [ ! -f "./x_samhain.c.sm" ]; then
[171]136 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
[170]137 return 0
138 fi
139
[22]140 if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi
[91]141 if [ -f ../../static/sm_scripts/smatch.pm ]; then
[22]142 (
[91]143 cd ../../static/sm_scripts;
[22]144
145 for i in ${CDIR}/*.c.sm ; do
146 # echo $i;
[140]147 cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
[22]148 cat $i | ./ampersand_missing.sh;
149 cat $i | ./eqeq.pl;
[96]150 cat $i | ./for_bounds.pl; # doesn't work?
[22]151 cat $i | ./unchecked_returns.pl;
[96]152 cat $i | ./uninitialized.pl; # doesn't work?
153
[22]154 # from http://people.redhat.com/mstefani/wine/smatch/
155 if [ -f ./while_for_check.pl ]; then
[96]156 cat $i | ./while_for_check.pl; # works
[22]157 fi
158 # --> end wine <--
[96]159
160 # samhain specific modifications (list of free/malloc funcs)
161 # doesn't seem to find anything useful
[22]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 <--
[96]177
178 echo malloc > list_null_funcs_uniq;
179 echo getenv >> list_null_funcs_uniq;
[227]180 cat $i | ./deference_check.pl |\
[257]181 egrep -v 'x_trustfile.c ... ... sl_trustfile' | \
182 egrep -v 'x_sh_mem.c ';
[22]183 rm -f list_null_funcs_uniq;
[227]184 # rm -f $i
[22]185 done
186 ) >test_log_smatch 2>&1
187 if [ -f test_log_smatch ]; then
188 lines=`cat test_log_smatch | wc -l`
189 if [ $lines -ne 0 ]; then
190 cat test_log_smatch
191 rm -f test_log_smatch
192 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)";
193 return 1
194 fi
195 fi
196 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)";
197 return 0
198 fi
199 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
200 return 0
201}
202
[1]203testmake ()
204{
[19]205 fail=0
[210]206 #
207 # Compiler warnings can be OS specific, but at least
208 # on Linux there should be none
209 #
210 isLinux=0
211 uname -a | grep Linux >/dev/null
212 if [ $? -eq 0 ]; then
213 isLinux=1
214 sed --in-place 's/-Wall/-Wall -Werror/' Makefile
215 fi
216 #
[1]217 if test x$1 = x0; then
[19]218 [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
[138]219 $MAKE clean > /dev/null 2>> test_log
[22]220 $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
[1]221 if test x$? = x0; then
[19]222 [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
[1]223 else
[19]224 [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
225 fail=1
[1]226 fi
227 else
[19]228 [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
229 if [ x"$3" = xskip ]; then
230 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
231 fi
232 fail=1
[1]233 fi
[210]234 if [ $isLinux -eq 1 ]; then
235 sed --in-place 's/-Wall -Werror/-Wall/' Makefile
236 fi
[19]237 if [ $fail -eq 1 ]; then
238 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
239 return 1
240 fi
241 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
242 return 0
[1]243}
244
245testcompile ()
246{
[19]247 log_start "COMPILE"
[1]248
[171]249 if [ "x$doall" = xon ]; then
[172]250 uname -a | grep x86_64 >/dev/null
251 if [ $? -ne 0 ]; then
252 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then # FIXME
253 SAVE_CC="${CC}"
254 SMATCH="DBGDEF=--smatch"; export SMATCH
255 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
256 CC="/usr/local/gcc-smatch/bin/gcc"; export CC
257 SMATCH_CC="${CC}"
258 fi
[171]259 fi
[22]260 fi
261
[19]262 num=0
263 numfail=0
264
[257]265
266 C_LOGFILE=""
267
268 ls /lib/libpcre* >/dev/null 2>&1
269 if [ $? -eq 0 ]; then
270 C_LOGFILE=" --enable-logfile-monitor "
271 else
272 ls /usr/lib/libpcre* >/dev/null 2>&1
273 if [ $? -eq 0 ]; then
274 C_LOGFILE=" --enable-logfile-monitor "
275 else
276 ls /usr/local/lib/libpcre* >/dev/null 2>&1
277 if [ $? -eq 0 ]; then
278 C_LOGFILE=" --enable-logfile-monitor "
279 fi
280 fi
281 fi
282 if [ x"${C_LOGFILE}" = x ]; then
283 log_msg_ok "Not testing --enable-logfile-monitor";
284 fi
285
[1]286 #
[171]287 # test dnmalloc
288 #
289 TEST="${S}check dnmalloc${E}"
290 #
291 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
292 #
293 let "num = num + 1" >/dev/null
294 #
295 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null
296 #
297
298 #
[30]299 # test flawfinder
300 #
301 TEST="${S}check w/flawfinder${E}"
302 #
303 #
304 let "num = num + 1" >/dev/null
305 FLAWFINDER=`find_path flawfinder`
306 #
307 if [ -z "$FLAWFINDER" ]; then
308 log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
309 else
310 run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
311 fi
312 #
313
314 #
[1]315 # test standalone compilation
316 #
[75]317 TEST="${S}standalone w/suidcheck w/procchk${E}"
[1]318 #
319 if test -r "Makefile"; then
320 $MAKE distclean
321 fi
322 #
[68]323 ${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
[1]324 #
[19]325 let "num = num + 1" >/dev/null
326 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]327 let "num = num + 1" >/dev/null
328 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]329 let "num = num + 1" >/dev/null
330 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]331
332 #
333 # test standalone compilation
334 #
[145]335 TEST="${S}standalone static w/suidcheck w/procchk${E}"
336 #
337 if test -r "Makefile"; then
338 $MAKE distclean
339 fi
340 #
[170]341 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
342 #
[257]343 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check ${C_LOGFILE} > /dev/null 2>> test_log
[145]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
[171]349 let "num = num + 1" >/dev/null
350 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]351 #
[170]352 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
353 #
[145]354 # test standalone compilation
355 #
[75]356 TEST="${S}standalone w/procchk w/portchk${E}"
[68]357 #
358 if test -r "Makefile"; then
359 $MAKE distclean
360 fi
361 #
362 ${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
363 #
364 let "num = num + 1" >/dev/null
365 testmake $? $num || let "numfail = numfail + 1" >/dev/null
366 let "num = num + 1" >/dev/null
367 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]368 let "num = num + 1" >/dev/null
369 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[68]370
371 #
372 # test standalone compilation
373 #
[210]374 TEST="${S}standalone w/procchk w/portchk w/static${E}"
375 #
376 if test -r "Makefile"; then
377 $MAKE distclean
378 fi
379 #
380 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-process-check --enable-port-check --enable-static > /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
391 #
[75]392 TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
393 #
394 if test -r "Makefile"; then
395 $MAKE distclean
396 fi
397 #
398 ${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
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
[171]404 let "num = num + 1" >/dev/null
405 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[75]406
407 #
408 # test standalone compilation
409 #
[22]410 TEST="${S}standalone w/mounts-check w/userfiles${E}"
[1]411 #
412 if test -r "Makefile"; then
413 $MAKE distclean
414 fi
415 #
416 ${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
417 #
[19]418 let "num = num + 1" >/dev/null
419 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]420 let "num = num + 1" >/dev/null
421 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]422 let "num = num + 1" >/dev/null
423 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]424
425
426 #
427 # test standalone compilation
428 #
[22]429 TEST="${S}standalone w/timeserver and w/msgqueue${E}"
[1]430 #
431 if test -r "Makefile"; then
432 $MAKE clean
433 fi
434 #
435 ${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
436 #
[19]437 let "num = num + 1" >/dev/null
438 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]439 let "num = num + 1" >/dev/null
440 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]441 let "num = num + 1" >/dev/null
442 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]443
444 #
445 # test standalone compilation with --with-nocl=PW
446 #
[183]447 TEST="${S}standalone w/nocl w/logmon${E}"
[1]448 #
449 if test -r "Makefile"; then
450 $MAKE clean
451 fi
452 #
[257]453 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log
[1]454 #
[19]455 let "num = num + 1" >/dev/null
456 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]457 let "num = num + 1" >/dev/null
458 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]459 let "num = num + 1" >/dev/null
460 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]461
462 #
463 # test standalone compilation w/ debug
464 #
[22]465 TEST="${S}standalone w/debug${E}"
[1]466 #
467 if test -r "Makefile"; then
468 $MAKE clean
469 fi
470 #
471 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
472 #
[19]473 let "num = num + 1" >/dev/null
474 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]475 let "num = num + 1" >/dev/null
476 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]477 let "num = num + 1" >/dev/null
478 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]479
480 #
481 # test standalone compilation w/ gpg
482 #
[22]483 TEST="${S}standalone w/gpg${E}"
[1]484 #
[19]485 GPG=`find_path gpg`
486 let "num = num + 1" >/dev/null
487 #
488 if [ -z "$GPG" ]; then
489 log_skip $num $MAXTEST 'gpg not in PATH'
[29]490 let "num = num + 1" >/dev/null
[54]491 log_skip $num $MAXTEST 'gpg not in PATH'
[19]492 else
493 if test -r "Makefile"; then
[1]494 $MAKE clean
[19]495 fi
496 #
497 ${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
498 #
499 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]500 let "num = num + 1" >/dev/null
501 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]502 let "num = num + 1" >/dev/null
503 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]504 fi
505
506 #
507 # test standalone compilation w/stealth
508 #
[22]509 TEST="${S}standalone w/stealth${E}"
[1]510 #
511 if test -r "Makefile"; then
512 $MAKE clean
513 fi
514 #
515 ${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
516 #
[19]517 let "num = num + 1" >/dev/null
518 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]519 let "num = num + 1" >/dev/null
520 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]521 let "num = num + 1" >/dev/null
522 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]523
524 #
[183]525 # test standalone compilation w/loginwatch
[1]526 #
[22]527 TEST="${S}standalone w/login-watch${E}"
[1]528 #
529 if test -r "Makefile"; then
530 $MAKE clean
531 fi
532 #
533 ${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
534 #
[19]535 let "num = num + 1" >/dev/null
536 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]537 let "num = num + 1" >/dev/null
538 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]539 let "num = num + 1" >/dev/null
540 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]541
542 #
[19]543 # test standalone compilation w/mysql
544 #
[22]545 TEST="${S}standalone w/mysql${E}"
[19]546 #
547 if test -r "Makefile"; then
548 $MAKE clean
549 fi
550 #
551 ${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
552 #
553 let "num = num + 1" >/dev/null
554 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
[22]555 let "num = num + 1" >/dev/null
556 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]557 let "num = num + 1" >/dev/null
558 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]559
560 #
[54]561 # test standalone compilation w/mysql and stealth
562 #
563 TEST="${S}standalone w/mysql+stealth${E}"
564 #
565 if test -r "Makefile"; then
566 $MAKE clean
567 fi
568 #
569 ${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
570 #
571 let "num = num + 1" >/dev/null
572 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
573 let "num = num + 1" >/dev/null
574 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]575 let "num = num + 1" >/dev/null
576 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[54]577
578 #
[19]579 # test standalone compilation w/postgresql
580 #
[22]581 TEST="${S}standalone w/postgresql${E}"
[19]582 #
583 if test -r "Makefile"; then
584 $MAKE clean
585 fi
586 #
587 ${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
588 #
589 let "num = num + 1" >/dev/null
590 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
[22]591 let "num = num + 1" >/dev/null
592 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]593 let "num = num + 1" >/dev/null
594 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]595
596 #
[54]597 # test standalone compilation w/postgresql+stealth
598 #
599 TEST="${S}standalone w/postgresql+stealth${E}"
600 #
601 if test -r "Makefile"; then
602 $MAKE clean
603 fi
604 #
605 ${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
606 #
607 let "num = num + 1" >/dev/null
608 testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
609 let "num = num + 1" >/dev/null
610 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]611 let "num = num + 1" >/dev/null
612 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[54]613
614 #
[1]615 # test standalone compilation
616 #
[147]617 TEST="${S}standalone w/o mail w/unix_rnd${E}"
[1]618 #
619 if test -r "Makefile"; then
620 $MAKE clean
621 fi
622 #
[147]623 ${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
[1]624 #
[19]625 let "num = num + 1" >/dev/null
626 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]627 let "num = num + 1" >/dev/null
628 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]629 let "num = num + 1" >/dev/null
630 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]631
632 #
633 # test standalone compilation
634 #
[22]635 TEST="${S}standalone w/o external${E}"
[1]636 #
637 if test -r "Makefile"; then
638 $MAKE clean
639 fi
640 #
641 ${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
642 #
[19]643 let "num = num + 1" >/dev/null
644 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]645 let "num = num + 1" >/dev/null
646 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]647 let "num = num + 1" >/dev/null
648 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]649
650 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
651
652 #
653 # test client/server compilation
654 #
655 TEST="${S}client/server application w/timeserver${E}"
656 #
657 if test -r "Makefile"; then
658 $MAKE clean
659 fi
660 #
661 ${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
662 #
[19]663 let "num = num + 1" >/dev/null
664 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]665 let "num = num + 1" >/dev/null
666 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]667 let "num = num + 1" >/dev/null
668 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]669
[1]670 if test -r "Makefile"; then
671 $MAKE clean
672 fi
673 #
674 ${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
675 #
[19]676 let "num = num + 1" >/dev/null
677 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]678 let "num = num + 1" >/dev/null
679 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]680 let "num = num + 1" >/dev/null
681 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]682
683 #
[145]684 # test client/server compilation
685 #
686 TEST="${S}client/server application static w/timeserver${E}"
687 #
688 if test -r "Makefile"; then
689 $MAKE clean
690 fi
691 #
[170]692 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; }
693 #
[257]694 ${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 ${C_LOGFILE} > /dev/null 2>> test_log
[145]695 #
696 let "num = num + 1" >/dev/null
697 testmake $? $num || let "numfail = numfail + 1" >/dev/null
698 let "num = num + 1" >/dev/null
699 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]700 let "num = num + 1" >/dev/null
701 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]702
703 if test -r "Makefile"; then
704 $MAKE clean
705 fi
706 #
707 ${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
708 #
709 let "num = num + 1" >/dev/null
710 testmake $? $num || let "numfail = numfail + 1" >/dev/null
711 let "num = num + 1" >/dev/null
712 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]713 let "num = num + 1" >/dev/null
714 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[145]715 #
[170]716 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
717 #
[1]718 # test c/s compilation w/ gpg
719 #
720 TEST="${S}client/server application w/gpg${E}"
721 #
[19]722 GPG=`find_path gpg`
723 let "num = num + 1" >/dev/null
[1]724 #
[19]725 if [ -z "$GPG" ]; then
726 log_skip $num $MAXTEST 'gpg not in PATH'
[54]727 let "num = num + 1" >/dev/null
728 log_skip $num $MAXTEST 'gpg not in PATH'
729 let "num = num + 1" >/dev/null
730 log_skip $num $MAXTEST 'gpg not in PATH'
731 let "num = num + 1" >/dev/null
732 log_skip $num $MAXTEST 'gpg not in PATH'
[19]733 else
734 if test -r "Makefile"; then
[1]735 $MAKE clean
[19]736 fi
737 #
738 ${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
739 #
740 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]741 let "num = num + 1" >/dev/null
742 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]743 let "num = num + 1" >/dev/null
744 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]745 #
746 if test -r "Makefile"; then
747 $MAKE clean
748 fi
749 #
[257]750 ${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 ${C_LOGFILE} > /dev/null 2>> test_log
[19]751 #
752 let "num = num + 1" >/dev/null
753 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]754 let "num = num + 1" >/dev/null
755 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]756 let "num = num + 1" >/dev/null
757 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]758 fi
759
760
761 #
762 # test client/server compilation
763 #
764 TEST="${S}client/server application w/o srp${E}"
765 #
766 if test -r "Makefile"; then
767 $MAKE clean
768 fi
769 #
770 ${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
771 #
[19]772 let "num = num + 1" >/dev/null
773 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]774 let "num = num + 1" >/dev/null
775 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]776 let "num = num + 1" >/dev/null
777 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]778 #
779 if test -r "Makefile"; then
780 $MAKE clean
781 fi
782 #
783 ${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
784 #
[19]785 let "num = num + 1" >/dev/null
786 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]787 let "num = num + 1" >/dev/null
788 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]789 let "num = num + 1" >/dev/null
790 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]791
792 #
793 # test client/server compilation w/ debug
794 #
795 TEST="${S}client/server application w/debug${E}"
796 #
797 if test -r "Makefile"; then
798 $MAKE clean
799 fi
800 #
801 ${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
802 #
[19]803 let "num = num + 1" >/dev/null
804 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]805 let "num = num + 1" >/dev/null
806 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]807 let "num = num + 1" >/dev/null
808 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]809 #
810 if test -r "Makefile"; then
811 $MAKE clean
812 fi
813 #
[257]814 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log
[1]815 #
[19]816 let "num = num + 1" >/dev/null
817 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]818 let "num = num + 1" >/dev/null
819 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]820 let "num = num + 1" >/dev/null
821 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]822
823 #
824 # test client/server compilation w/stealth
825 #
826 TEST="${S}client/server application w/stealth${E}"
827 #
828 if test -r "Makefile"; then
829 $MAKE clean
830 fi
831 #
832 ${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
833 #
[19]834 let "num = num + 1" >/dev/null
835 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]836 let "num = num + 1" >/dev/null
837 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]838 let "num = num + 1" >/dev/null
839 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]840 #
841 if test -r "Makefile"; then
842 $MAKE clean
843 fi
844 #
845 ${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
846 #
[19]847 let "num = num + 1" >/dev/null
848 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]849 let "num = num + 1" >/dev/null
850 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]851 let "num = num + 1" >/dev/null
852 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]853
854 #
855 # test client/server compilation w/logwatch
856 #
857 TEST="${S}client/server application w/login-watch${E}"
858 #
859 if test -r "Makefile"; then
860 $MAKE clean
861 fi
862 #
863 ${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
864 #
[19]865 let "num = num + 1" >/dev/null
866 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]867 let "num = num + 1" >/dev/null
868 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]869 let "num = num + 1" >/dev/null
870 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]871 #
872 if test -r "Makefile"; then
873 $MAKE clean
874 fi
875 #
876 ${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
877 #
[19]878 let "num = num + 1" >/dev/null
879 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]880 let "num = num + 1" >/dev/null
881 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]882 let "num = num + 1" >/dev/null
883 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]884
885 #
886 # test client/server compilation
887 #
888 TEST="${S}client/server application w/o mail${E}"
889 #
890 if test -r "Makefile"; then
891 $MAKE clean
892 fi
893 #
894 ${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
895 #
[19]896 let "num = num + 1" >/dev/null
897 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]898 let "num = num + 1" >/dev/null
899 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]900 let "num = num + 1" >/dev/null
901 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]902 #
903 if test -r "Makefile"; then
904 $MAKE clean
905 fi
906 #
907 ${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
908 #
[19]909 let "num = num + 1" >/dev/null
910 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]911 let "num = num + 1" >/dev/null
912 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
[171]913 let "num = num + 1" >/dev/null
914 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]915
916 #
917 # test client/server compilation
918 #
[22]919 TEST="${S}client/server application w/o external${E}"
[1]920 #
921 if test -r "Makefile"; then
922 $MAKE clean
923 fi
924 #
925 ${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
926 #
[19]927 let "num = num + 1" >/dev/null
928 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]929 let "num = num + 1" >/dev/null
930 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]931 let "num = num + 1" >/dev/null
932 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[1]933 #
934 if test -r "Makefile"; then
935 $MAKE clean
936 fi
937 #
938 ${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
939 #
[19]940 let "num = num + 1" >/dev/null
941 testmake $? $num || let "numfail = numfail + 1" >/dev/null
[22]942 let "num = num + 1" >/dev/null
943 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
[171]944 let "num = num + 1" >/dev/null
945 run_uno $? $num || let "numfail = numfail + 1" >/dev/null
[19]946
[22]947 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
948
[19]949 log_end "COMPILE"
[1]950}
Note: See TracBrowser for help on using the repository browser.