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 | MAXTEST=65; export MAXTEST
|
---|
23 |
|
---|
24 | run_flawfinder ()
|
---|
25 | {
|
---|
26 | flawfinder --minlevel=3 --quiet src/s*.c | \
|
---|
27 | egrep '^No hits found.' >/dev/null 2>&1
|
---|
28 | if [ $? -eq 0 ]; then
|
---|
29 | [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
|
---|
30 | else
|
---|
31 | flawfinder --minlevel=3 --quiet src/s*.c >test_log 2>&1
|
---|
32 | [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
|
---|
33 | return 1
|
---|
34 | fi
|
---|
35 | }
|
---|
36 |
|
---|
37 | run_smatch ()
|
---|
38 | {
|
---|
39 | export CDIR=`pwd`;
|
---|
40 |
|
---|
41 | if [ -z "$doall" ]; then
|
---|
42 | [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
|
---|
43 | return 0
|
---|
44 | fi
|
---|
45 |
|
---|
46 | if [ "x$3" = "xdebug" ]; then memcheck=debug; else memcheck=simple; fi
|
---|
47 | if [ -f ../../static/sm_scripts/smatch.pm ]; then
|
---|
48 | (
|
---|
49 | cd ../../static/sm_scripts;
|
---|
50 |
|
---|
51 | for i in ${CDIR}/*.c.sm ; do
|
---|
52 | # echo $i;
|
---|
53 | cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
|
---|
54 | cat $i | ./ampersand_missing.sh;
|
---|
55 | cat $i | ./eqeq.pl;
|
---|
56 | cat $i | ./for_bounds.pl; # doesn't work?
|
---|
57 | cat $i | ./unchecked_returns.pl;
|
---|
58 | cat $i | ./uninitialized.pl; # doesn't work?
|
---|
59 |
|
---|
60 | # from http://people.redhat.com/mstefani/wine/smatch/
|
---|
61 | if [ -f ./while_for_check.pl ]; then
|
---|
62 | cat $i | ./while_for_check.pl; # works
|
---|
63 | fi
|
---|
64 | # --> end wine <--
|
---|
65 |
|
---|
66 | # samhain specific modifications (list of free/malloc funcs)
|
---|
67 | # doesn't seem to find anything useful
|
---|
68 | if [ $memcheck = xsimple ]; then
|
---|
69 | if [ -f ./samhain_unfree.pl ]; then
|
---|
70 | cat $i | ./samhain_unfree.pl | \
|
---|
71 | egrep -v 'x_cutest_.*Test_' | \
|
---|
72 | egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
|
---|
73 | fi
|
---|
74 | fi
|
---|
75 | if [ $memcheck = xdebug ]; then
|
---|
76 | if [ -f ./samhain_unfree_debug.pl ]; then
|
---|
77 | cat $i | ./samhain_unfree_debug.pl | \
|
---|
78 | egrep -v 'x_cutest_.*Test_' | \
|
---|
79 | egrep -v 'x_sh_unix.c .... .... sh_unix_copyenv';
|
---|
80 | fi
|
---|
81 | fi
|
---|
82 | # --> end samhain specific <--
|
---|
83 |
|
---|
84 | echo malloc > list_null_funcs_uniq;
|
---|
85 | echo getenv >> list_null_funcs_uniq;
|
---|
86 | cat $i | ./deference_check.pl;
|
---|
87 | rm -f list_null_funcs_uniq;
|
---|
88 | rm -f $i
|
---|
89 | done
|
---|
90 | ) >test_log_smatch 2>&1
|
---|
91 | if [ -f test_log_smatch ]; then
|
---|
92 | lines=`cat test_log_smatch | wc -l`
|
---|
93 | if [ $lines -ne 0 ]; then
|
---|
94 | cat test_log_smatch
|
---|
95 | rm -f test_log_smatch
|
---|
96 | [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (smatch)";
|
---|
97 | return 1
|
---|
98 | fi
|
---|
99 | fi
|
---|
100 | [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (smatch)";
|
---|
101 | return 0
|
---|
102 | fi
|
---|
103 | [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)";
|
---|
104 | return 0
|
---|
105 | }
|
---|
106 |
|
---|
107 | testmake ()
|
---|
108 | {
|
---|
109 | fail=0
|
---|
110 | if test x$1 = x0; then
|
---|
111 | [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
|
---|
112 | $MAKE clean > /dev/null 2>> test_log
|
---|
113 | $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
|
---|
114 | if test x$? = x0; then
|
---|
115 | [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
|
---|
116 | else
|
---|
117 | [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
|
---|
118 | fail=1
|
---|
119 | fi
|
---|
120 | else
|
---|
121 | [ -z "$quiet" ] && log_msg_fail "configure... $TEST";
|
---|
122 | if [ x"$3" = xskip ]; then
|
---|
123 | [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
|
---|
124 | fi
|
---|
125 | fail=1
|
---|
126 | fi
|
---|
127 | if [ $fail -eq 1 ]; then
|
---|
128 | [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
|
---|
129 | return 1
|
---|
130 | fi
|
---|
131 | [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST";
|
---|
132 | return 0
|
---|
133 | }
|
---|
134 |
|
---|
135 | testcompile ()
|
---|
136 | {
|
---|
137 | log_start "COMPILE"
|
---|
138 |
|
---|
139 | if [ -f /usr/local/gcc-smatch/bin/gcc ]; then
|
---|
140 | SAVE_CC="${CC}"
|
---|
141 | SMATCH="DBGDEF=--smatch"; export SMATCH
|
---|
142 | CC="/usr/local/gcc-smatch/bin/gcc"; export CC
|
---|
143 | fi
|
---|
144 |
|
---|
145 | num=0
|
---|
146 | numfail=0
|
---|
147 |
|
---|
148 | #
|
---|
149 | # test flawfinder
|
---|
150 | #
|
---|
151 | TEST="${S}check w/flawfinder${E}"
|
---|
152 | #
|
---|
153 | #
|
---|
154 | let "num = num + 1" >/dev/null
|
---|
155 | FLAWFINDER=`find_path flawfinder`
|
---|
156 | #
|
---|
157 | if [ -z "$FLAWFINDER" ]; then
|
---|
158 | log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
|
---|
159 | else
|
---|
160 | run_flawfinder 0 $num || let "numfail = numfail + 1" >/dev/null
|
---|
161 | fi
|
---|
162 | #
|
---|
163 |
|
---|
164 | #
|
---|
165 | # test standalone compilation
|
---|
166 | #
|
---|
167 | TEST="${S}standalone w/suidcheck w/procchk${E}"
|
---|
168 | #
|
---|
169 | if test -r "Makefile"; then
|
---|
170 | $MAKE distclean
|
---|
171 | fi
|
---|
172 | #
|
---|
173 | ${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
|
---|
174 | #
|
---|
175 | let "num = num + 1" >/dev/null
|
---|
176 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
177 | let "num = num + 1" >/dev/null
|
---|
178 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
179 |
|
---|
180 | #
|
---|
181 | # test standalone compilation
|
---|
182 | #
|
---|
183 | TEST="${S}standalone w/procchk w/portchk${E}"
|
---|
184 | #
|
---|
185 | if test -r "Makefile"; then
|
---|
186 | $MAKE distclean
|
---|
187 | fi
|
---|
188 | #
|
---|
189 | ${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
|
---|
190 | #
|
---|
191 | let "num = num + 1" >/dev/null
|
---|
192 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
193 | let "num = num + 1" >/dev/null
|
---|
194 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
195 |
|
---|
196 | #
|
---|
197 | # test standalone compilation
|
---|
198 | #
|
---|
199 | TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
|
---|
200 | #
|
---|
201 | if test -r "Makefile"; then
|
---|
202 | $MAKE distclean
|
---|
203 | fi
|
---|
204 | #
|
---|
205 | ${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
|
---|
206 | #
|
---|
207 | let "num = num + 1" >/dev/null
|
---|
208 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
209 | let "num = num + 1" >/dev/null
|
---|
210 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
211 |
|
---|
212 | #
|
---|
213 | # test standalone compilation
|
---|
214 | #
|
---|
215 | TEST="${S}standalone w/mounts-check w/userfiles${E}"
|
---|
216 | #
|
---|
217 | if test -r "Makefile"; then
|
---|
218 | $MAKE distclean
|
---|
219 | fi
|
---|
220 | #
|
---|
221 | ${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
|
---|
222 | #
|
---|
223 | let "num = num + 1" >/dev/null
|
---|
224 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
225 | let "num = num + 1" >/dev/null
|
---|
226 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
227 |
|
---|
228 |
|
---|
229 | #
|
---|
230 | # test standalone compilation
|
---|
231 | #
|
---|
232 | TEST="${S}standalone w/timeserver and w/msgqueue${E}"
|
---|
233 | #
|
---|
234 | if test -r "Makefile"; then
|
---|
235 | $MAKE clean
|
---|
236 | fi
|
---|
237 | #
|
---|
238 | ${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
|
---|
239 | #
|
---|
240 | let "num = num + 1" >/dev/null
|
---|
241 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
242 | let "num = num + 1" >/dev/null
|
---|
243 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
244 |
|
---|
245 | #
|
---|
246 | # test standalone compilation with --with-nocl=PW
|
---|
247 | #
|
---|
248 | TEST="${S}standalone w/nocl${E}"
|
---|
249 | #
|
---|
250 | if test -r "Makefile"; then
|
---|
251 | $MAKE clean
|
---|
252 | fi
|
---|
253 | #
|
---|
254 | ${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
|
---|
255 | #
|
---|
256 | let "num = num + 1" >/dev/null
|
---|
257 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
258 | let "num = num + 1" >/dev/null
|
---|
259 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
260 |
|
---|
261 | #
|
---|
262 | # test standalone compilation w/ debug
|
---|
263 | #
|
---|
264 | TEST="${S}standalone w/debug${E}"
|
---|
265 | #
|
---|
266 | if test -r "Makefile"; then
|
---|
267 | $MAKE clean
|
---|
268 | fi
|
---|
269 | #
|
---|
270 | ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
|
---|
271 | #
|
---|
272 | let "num = num + 1" >/dev/null
|
---|
273 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
274 | let "num = num + 1" >/dev/null
|
---|
275 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
276 |
|
---|
277 | #
|
---|
278 | # test standalone compilation w/ gpg
|
---|
279 | #
|
---|
280 | TEST="${S}standalone w/gpg${E}"
|
---|
281 | #
|
---|
282 | GPG=`find_path gpg`
|
---|
283 | let "num = num + 1" >/dev/null
|
---|
284 | #
|
---|
285 | if [ -z "$GPG" ]; then
|
---|
286 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
287 | let "num = num + 1" >/dev/null
|
---|
288 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
289 | else
|
---|
290 | if test -r "Makefile"; then
|
---|
291 | $MAKE clean
|
---|
292 | fi
|
---|
293 | #
|
---|
294 | ${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
|
---|
295 | #
|
---|
296 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
297 | let "num = num + 1" >/dev/null
|
---|
298 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
299 | fi
|
---|
300 |
|
---|
301 | #
|
---|
302 | # test standalone compilation w/stealth
|
---|
303 | #
|
---|
304 | TEST="${S}standalone w/stealth${E}"
|
---|
305 | #
|
---|
306 | if test -r "Makefile"; then
|
---|
307 | $MAKE clean
|
---|
308 | fi
|
---|
309 | #
|
---|
310 | ${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
|
---|
311 | #
|
---|
312 | let "num = num + 1" >/dev/null
|
---|
313 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
314 | let "num = num + 1" >/dev/null
|
---|
315 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
316 |
|
---|
317 | #
|
---|
318 | # test standalone compilation w/logwatch
|
---|
319 | #
|
---|
320 | TEST="${S}standalone w/login-watch${E}"
|
---|
321 | #
|
---|
322 | if test -r "Makefile"; then
|
---|
323 | $MAKE clean
|
---|
324 | fi
|
---|
325 | #
|
---|
326 | ${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
|
---|
327 | #
|
---|
328 | let "num = num + 1" >/dev/null
|
---|
329 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
330 | let "num = num + 1" >/dev/null
|
---|
331 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
332 |
|
---|
333 | #
|
---|
334 | # test standalone compilation w/mysql
|
---|
335 | #
|
---|
336 | TEST="${S}standalone w/mysql${E}"
|
---|
337 | #
|
---|
338 | if test -r "Makefile"; then
|
---|
339 | $MAKE clean
|
---|
340 | fi
|
---|
341 | #
|
---|
342 | ${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
|
---|
343 | #
|
---|
344 | let "num = num + 1" >/dev/null
|
---|
345 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
346 | let "num = num + 1" >/dev/null
|
---|
347 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
348 |
|
---|
349 | #
|
---|
350 | # test standalone compilation w/mysql and stealth
|
---|
351 | #
|
---|
352 | TEST="${S}standalone w/mysql+stealth${E}"
|
---|
353 | #
|
---|
354 | if test -r "Makefile"; then
|
---|
355 | $MAKE clean
|
---|
356 | fi
|
---|
357 | #
|
---|
358 | ${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
|
---|
359 | #
|
---|
360 | let "num = num + 1" >/dev/null
|
---|
361 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
362 | let "num = num + 1" >/dev/null
|
---|
363 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
364 |
|
---|
365 | #
|
---|
366 | # test standalone compilation w/postgresql
|
---|
367 | #
|
---|
368 | TEST="${S}standalone w/postgresql${E}"
|
---|
369 | #
|
---|
370 | if test -r "Makefile"; then
|
---|
371 | $MAKE clean
|
---|
372 | fi
|
---|
373 | #
|
---|
374 | ${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
|
---|
375 | #
|
---|
376 | let "num = num + 1" >/dev/null
|
---|
377 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
378 | let "num = num + 1" >/dev/null
|
---|
379 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
380 |
|
---|
381 | #
|
---|
382 | # test standalone compilation w/postgresql+stealth
|
---|
383 | #
|
---|
384 | TEST="${S}standalone w/postgresql+stealth${E}"
|
---|
385 | #
|
---|
386 | if test -r "Makefile"; then
|
---|
387 | $MAKE clean
|
---|
388 | fi
|
---|
389 | #
|
---|
390 | ${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
|
---|
391 | #
|
---|
392 | let "num = num + 1" >/dev/null
|
---|
393 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
394 | let "num = num + 1" >/dev/null
|
---|
395 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
396 |
|
---|
397 | #
|
---|
398 | # test standalone compilation
|
---|
399 | #
|
---|
400 | TEST="${S}standalone w/o mail${E}"
|
---|
401 | #
|
---|
402 | if test -r "Makefile"; then
|
---|
403 | $MAKE clean
|
---|
404 | fi
|
---|
405 | #
|
---|
406 | ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
|
---|
407 | #
|
---|
408 | let "num = num + 1" >/dev/null
|
---|
409 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
410 | let "num = num + 1" >/dev/null
|
---|
411 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
412 |
|
---|
413 | #
|
---|
414 | # test standalone compilation
|
---|
415 | #
|
---|
416 | TEST="${S}standalone w/o external${E}"
|
---|
417 | #
|
---|
418 | if test -r "Makefile"; then
|
---|
419 | $MAKE clean
|
---|
420 | fi
|
---|
421 | #
|
---|
422 | ${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
|
---|
423 | #
|
---|
424 | let "num = num + 1" >/dev/null
|
---|
425 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
426 | let "num = num + 1" >/dev/null
|
---|
427 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
428 |
|
---|
429 | # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
|
---|
430 |
|
---|
431 | #
|
---|
432 | # test client/server compilation
|
---|
433 | #
|
---|
434 | TEST="${S}client/server application w/timeserver${E}"
|
---|
435 | #
|
---|
436 | if test -r "Makefile"; then
|
---|
437 | $MAKE clean
|
---|
438 | fi
|
---|
439 | #
|
---|
440 | ${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
|
---|
441 | #
|
---|
442 | let "num = num + 1" >/dev/null
|
---|
443 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
444 | let "num = num + 1" >/dev/null
|
---|
445 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
446 |
|
---|
447 | if test -r "Makefile"; then
|
---|
448 | $MAKE clean
|
---|
449 | fi
|
---|
450 | #
|
---|
451 | ${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
|
---|
452 | #
|
---|
453 | let "num = num + 1" >/dev/null
|
---|
454 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
455 | let "num = num + 1" >/dev/null
|
---|
456 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
457 |
|
---|
458 | #
|
---|
459 | # test c/s compilation w/ gpg
|
---|
460 | #
|
---|
461 | TEST="${S}client/server application w/gpg${E}"
|
---|
462 | #
|
---|
463 | GPG=`find_path gpg`
|
---|
464 | let "num = num + 1" >/dev/null
|
---|
465 | #
|
---|
466 | if [ -z "$GPG" ]; then
|
---|
467 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
468 | let "num = num + 1" >/dev/null
|
---|
469 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
470 | let "num = num + 1" >/dev/null
|
---|
471 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
472 | let "num = num + 1" >/dev/null
|
---|
473 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
474 | else
|
---|
475 | if test -r "Makefile"; then
|
---|
476 | $MAKE clean
|
---|
477 | fi
|
---|
478 | #
|
---|
479 | ${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
|
---|
480 | #
|
---|
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 | #
|
---|
485 | if test -r "Makefile"; then
|
---|
486 | $MAKE clean
|
---|
487 | fi
|
---|
488 | #
|
---|
489 | ${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
|
---|
490 | #
|
---|
491 | let "num = num + 1" >/dev/null
|
---|
492 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
493 | let "num = num + 1" >/dev/null
|
---|
494 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
495 | fi
|
---|
496 |
|
---|
497 |
|
---|
498 | #
|
---|
499 | # test client/server compilation
|
---|
500 | #
|
---|
501 | TEST="${S}client/server application w/o srp${E}"
|
---|
502 | #
|
---|
503 | if test -r "Makefile"; then
|
---|
504 | $MAKE clean
|
---|
505 | fi
|
---|
506 | #
|
---|
507 | ${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
|
---|
508 | #
|
---|
509 | let "num = num + 1" >/dev/null
|
---|
510 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
511 | let "num = num + 1" >/dev/null
|
---|
512 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
513 | #
|
---|
514 | if test -r "Makefile"; then
|
---|
515 | $MAKE clean
|
---|
516 | fi
|
---|
517 | #
|
---|
518 | ${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
|
---|
519 | #
|
---|
520 | let "num = num + 1" >/dev/null
|
---|
521 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
522 | let "num = num + 1" >/dev/null
|
---|
523 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
524 |
|
---|
525 | #
|
---|
526 | # test client/server compilation w/ debug
|
---|
527 | #
|
---|
528 | TEST="${S}client/server application w/debug${E}"
|
---|
529 | #
|
---|
530 | if test -r "Makefile"; then
|
---|
531 | $MAKE clean
|
---|
532 | fi
|
---|
533 | #
|
---|
534 | ${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
|
---|
535 | #
|
---|
536 | let "num = num + 1" >/dev/null
|
---|
537 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
538 | let "num = num + 1" >/dev/null
|
---|
539 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
540 | #
|
---|
541 | if test -r "Makefile"; then
|
---|
542 | $MAKE clean
|
---|
543 | fi
|
---|
544 | #
|
---|
545 | ${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
|
---|
546 | #
|
---|
547 | let "num = num + 1" >/dev/null
|
---|
548 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
549 | let "num = num + 1" >/dev/null
|
---|
550 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
551 |
|
---|
552 | #
|
---|
553 | # test client/server compilation w/stealth
|
---|
554 | #
|
---|
555 | TEST="${S}client/server application w/stealth${E}"
|
---|
556 | #
|
---|
557 | if test -r "Makefile"; then
|
---|
558 | $MAKE clean
|
---|
559 | fi
|
---|
560 | #
|
---|
561 | ${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
|
---|
562 | #
|
---|
563 | let "num = num + 1" >/dev/null
|
---|
564 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
565 | let "num = num + 1" >/dev/null
|
---|
566 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
567 | #
|
---|
568 | if test -r "Makefile"; then
|
---|
569 | $MAKE clean
|
---|
570 | fi
|
---|
571 | #
|
---|
572 | ${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
|
---|
573 | #
|
---|
574 | let "num = num + 1" >/dev/null
|
---|
575 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
576 | let "num = num + 1" >/dev/null
|
---|
577 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
578 |
|
---|
579 | #
|
---|
580 | # test client/server compilation w/logwatch
|
---|
581 | #
|
---|
582 | TEST="${S}client/server application w/login-watch${E}"
|
---|
583 | #
|
---|
584 | if test -r "Makefile"; then
|
---|
585 | $MAKE clean
|
---|
586 | fi
|
---|
587 | #
|
---|
588 | ${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
|
---|
589 | #
|
---|
590 | let "num = num + 1" >/dev/null
|
---|
591 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
592 | let "num = num + 1" >/dev/null
|
---|
593 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
594 | #
|
---|
595 | if test -r "Makefile"; then
|
---|
596 | $MAKE clean
|
---|
597 | fi
|
---|
598 | #
|
---|
599 | ${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
|
---|
600 | #
|
---|
601 | let "num = num + 1" >/dev/null
|
---|
602 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
603 | let "num = num + 1" >/dev/null
|
---|
604 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
605 |
|
---|
606 | #
|
---|
607 | # test client/server compilation
|
---|
608 | #
|
---|
609 | TEST="${S}client/server application w/o mail${E}"
|
---|
610 | #
|
---|
611 | if test -r "Makefile"; then
|
---|
612 | $MAKE clean
|
---|
613 | fi
|
---|
614 | #
|
---|
615 | ${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
|
---|
616 | #
|
---|
617 | let "num = num + 1" >/dev/null
|
---|
618 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
619 | let "num = num + 1" >/dev/null
|
---|
620 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
621 | #
|
---|
622 | if test -r "Makefile"; then
|
---|
623 | $MAKE clean
|
---|
624 | fi
|
---|
625 | #
|
---|
626 | ${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
|
---|
627 | #
|
---|
628 | let "num = num + 1" >/dev/null
|
---|
629 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
630 | let "num = num + 1" >/dev/null
|
---|
631 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
632 |
|
---|
633 | #
|
---|
634 | # test client/server compilation
|
---|
635 | #
|
---|
636 | TEST="${S}client/server application w/o external${E}"
|
---|
637 | #
|
---|
638 | if test -r "Makefile"; then
|
---|
639 | $MAKE clean
|
---|
640 | fi
|
---|
641 | #
|
---|
642 | ${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
|
---|
643 | #
|
---|
644 | let "num = num + 1" >/dev/null
|
---|
645 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
646 | let "num = num + 1" >/dev/null
|
---|
647 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
648 | #
|
---|
649 | if test -r "Makefile"; then
|
---|
650 | $MAKE clean
|
---|
651 | fi
|
---|
652 | #
|
---|
653 | ${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
|
---|
654 | #
|
---|
655 | let "num = num + 1" >/dev/null
|
---|
656 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
657 | let "num = num + 1" >/dev/null
|
---|
658 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
659 |
|
---|
660 | [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
|
---|
661 |
|
---|
662 | log_end "COMPILE"
|
---|
663 | }
|
---|