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