[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 |
|
---|
[145] | 22 | MAXTEST=71; export MAXTEST
|
---|
[1] | 23 |
|
---|
[30] | 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 |
|
---|
[22] | 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
|
---|
[91] | 47 | if [ -f ../../static/sm_scripts/smatch.pm ]; then
|
---|
[22] | 48 | (
|
---|
[91] | 49 | cd ../../static/sm_scripts;
|
---|
[22] | 50 |
|
---|
| 51 | for i in ${CDIR}/*.c.sm ; do
|
---|
| 52 | # echo $i;
|
---|
[140] | 53 | cat $i | ./unreached_code.pl | grep -v sh_threaded_module_run;
|
---|
[22] | 54 | cat $i | ./ampersand_missing.sh;
|
---|
| 55 | cat $i | ./eqeq.pl;
|
---|
[96] | 56 | cat $i | ./for_bounds.pl; # doesn't work?
|
---|
[22] | 57 | cat $i | ./unchecked_returns.pl;
|
---|
[96] | 58 | cat $i | ./uninitialized.pl; # doesn't work?
|
---|
| 59 |
|
---|
[22] | 60 | # from http://people.redhat.com/mstefani/wine/smatch/
|
---|
| 61 | if [ -f ./while_for_check.pl ]; then
|
---|
[96] | 62 | cat $i | ./while_for_check.pl; # works
|
---|
[22] | 63 | fi
|
---|
| 64 | # --> end wine <--
|
---|
[96] | 65 |
|
---|
| 66 | # samhain specific modifications (list of free/malloc funcs)
|
---|
| 67 | # doesn't seem to find anything useful
|
---|
[22] | 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 <--
|
---|
[96] | 83 |
|
---|
| 84 | echo malloc > list_null_funcs_uniq;
|
---|
| 85 | echo getenv >> list_null_funcs_uniq;
|
---|
[22] | 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 |
|
---|
[1] | 107 | testmake ()
|
---|
| 108 | {
|
---|
[19] | 109 | fail=0
|
---|
[1] | 110 | if test x$1 = x0; then
|
---|
[19] | 111 | [ -z "$verbose" ] || log_msg_ok "configure... $TEST";
|
---|
[138] | 112 | $MAKE clean > /dev/null 2>> test_log
|
---|
[22] | 113 | $MAKE ${SMATCH} cutest > /dev/null 2>> test_log
|
---|
[1] | 114 | if test x$? = x0; then
|
---|
[19] | 115 | [ -z "$verbose" ] || log_msg_ok "make cutest... $TEST";
|
---|
[1] | 116 | else
|
---|
[19] | 117 | [ -z "$quiet" ] && log_msg_fail "make cutest... $TEST";
|
---|
| 118 | fail=1
|
---|
[1] | 119 | fi
|
---|
| 120 | else
|
---|
[19] | 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
|
---|
[1] | 126 | fi
|
---|
[19] | 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
|
---|
[1] | 133 | }
|
---|
| 134 |
|
---|
| 135 | testcompile ()
|
---|
| 136 | {
|
---|
[19] | 137 | log_start "COMPILE"
|
---|
[1] | 138 |
|
---|
[22] | 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 |
|
---|
[19] | 145 | num=0
|
---|
| 146 | numfail=0
|
---|
| 147 |
|
---|
[1] | 148 | #
|
---|
[30] | 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 | #
|
---|
[1] | 165 | # test standalone compilation
|
---|
| 166 | #
|
---|
[75] | 167 | TEST="${S}standalone w/suidcheck w/procchk${E}"
|
---|
[1] | 168 | #
|
---|
| 169 | if test -r "Makefile"; then
|
---|
| 170 | $MAKE distclean
|
---|
| 171 | fi
|
---|
| 172 | #
|
---|
[68] | 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
|
---|
[1] | 174 | #
|
---|
[19] | 175 | let "num = num + 1" >/dev/null
|
---|
| 176 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 177 | let "num = num + 1" >/dev/null
|
---|
| 178 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 179 |
|
---|
| 180 | #
|
---|
| 181 | # test standalone compilation
|
---|
| 182 | #
|
---|
[145] | 183 | TEST="${S}standalone static w/suidcheck w/procchk${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-static --enable-suidcheck --enable-process-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 | #
|
---|
[75] | 199 | TEST="${S}standalone w/procchk w/portchk${E}"
|
---|
[68] | 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-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 | #
|
---|
[75] | 215 | TEST="${S}standalone w/procchk w/portchk w/stealth${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-stealth=164 --enable-process-check --enable-port-check > /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
|
---|
| 230 | #
|
---|
[22] | 231 | TEST="${S}standalone w/mounts-check w/userfiles${E}"
|
---|
[1] | 232 | #
|
---|
| 233 | if test -r "Makefile"; then
|
---|
| 234 | $MAKE distclean
|
---|
| 235 | fi
|
---|
| 236 | #
|
---|
| 237 | ${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
|
---|
| 238 | #
|
---|
[19] | 239 | let "num = num + 1" >/dev/null
|
---|
| 240 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 241 | let "num = num + 1" >/dev/null
|
---|
| 242 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 243 |
|
---|
| 244 |
|
---|
| 245 | #
|
---|
| 246 | # test standalone compilation
|
---|
| 247 | #
|
---|
[22] | 248 | TEST="${S}standalone w/timeserver and w/msgqueue${E}"
|
---|
[1] | 249 | #
|
---|
| 250 | if test -r "Makefile"; then
|
---|
| 251 | $MAKE clean
|
---|
| 252 | fi
|
---|
| 253 | #
|
---|
| 254 | ${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
|
---|
| 255 | #
|
---|
[19] | 256 | let "num = num + 1" >/dev/null
|
---|
| 257 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 258 | let "num = num + 1" >/dev/null
|
---|
| 259 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 260 |
|
---|
| 261 | #
|
---|
| 262 | # test standalone compilation with --with-nocl=PW
|
---|
| 263 | #
|
---|
[22] | 264 | TEST="${S}standalone w/nocl${E}"
|
---|
[1] | 265 | #
|
---|
| 266 | if test -r "Makefile"; then
|
---|
| 267 | $MAKE clean
|
---|
| 268 | fi
|
---|
| 269 | #
|
---|
| 270 | ${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
|
---|
| 271 | #
|
---|
[19] | 272 | let "num = num + 1" >/dev/null
|
---|
| 273 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 274 | let "num = num + 1" >/dev/null
|
---|
| 275 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 276 |
|
---|
| 277 | #
|
---|
| 278 | # test standalone compilation w/ debug
|
---|
| 279 | #
|
---|
[22] | 280 | TEST="${S}standalone w/debug${E}"
|
---|
[1] | 281 | #
|
---|
| 282 | if test -r "Makefile"; then
|
---|
| 283 | $MAKE clean
|
---|
| 284 | fi
|
---|
| 285 | #
|
---|
| 286 | ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
|
---|
| 287 | #
|
---|
[19] | 288 | let "num = num + 1" >/dev/null
|
---|
| 289 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 290 | let "num = num + 1" >/dev/null
|
---|
| 291 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 292 |
|
---|
| 293 | #
|
---|
| 294 | # test standalone compilation w/ gpg
|
---|
| 295 | #
|
---|
[22] | 296 | TEST="${S}standalone w/gpg${E}"
|
---|
[1] | 297 | #
|
---|
[19] | 298 | GPG=`find_path gpg`
|
---|
| 299 | let "num = num + 1" >/dev/null
|
---|
| 300 | #
|
---|
| 301 | if [ -z "$GPG" ]; then
|
---|
| 302 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
[29] | 303 | let "num = num + 1" >/dev/null
|
---|
[54] | 304 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
[19] | 305 | else
|
---|
| 306 | if test -r "Makefile"; then
|
---|
[1] | 307 | $MAKE clean
|
---|
[19] | 308 | fi
|
---|
| 309 | #
|
---|
| 310 | ${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
|
---|
| 311 | #
|
---|
| 312 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 313 | let "num = num + 1" >/dev/null
|
---|
| 314 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 315 | fi
|
---|
| 316 |
|
---|
| 317 | #
|
---|
| 318 | # test standalone compilation w/stealth
|
---|
| 319 | #
|
---|
[22] | 320 | TEST="${S}standalone w/stealth${E}"
|
---|
[1] | 321 | #
|
---|
| 322 | if test -r "Makefile"; then
|
---|
| 323 | $MAKE clean
|
---|
| 324 | fi
|
---|
| 325 | #
|
---|
| 326 | ${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
|
---|
| 327 | #
|
---|
[19] | 328 | let "num = num + 1" >/dev/null
|
---|
| 329 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 330 | let "num = num + 1" >/dev/null
|
---|
| 331 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 332 |
|
---|
| 333 | #
|
---|
| 334 | # test standalone compilation w/logwatch
|
---|
| 335 | #
|
---|
[22] | 336 | TEST="${S}standalone w/login-watch${E}"
|
---|
[1] | 337 | #
|
---|
| 338 | if test -r "Makefile"; then
|
---|
| 339 | $MAKE clean
|
---|
| 340 | fi
|
---|
| 341 | #
|
---|
| 342 | ${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
|
---|
| 343 | #
|
---|
[19] | 344 | let "num = num + 1" >/dev/null
|
---|
| 345 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 346 | let "num = num + 1" >/dev/null
|
---|
| 347 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 348 |
|
---|
| 349 | #
|
---|
[19] | 350 | # test standalone compilation w/mysql
|
---|
| 351 | #
|
---|
[22] | 352 | TEST="${S}standalone w/mysql${E}"
|
---|
[19] | 353 | #
|
---|
| 354 | if test -r "Makefile"; then
|
---|
| 355 | $MAKE clean
|
---|
| 356 | fi
|
---|
| 357 | #
|
---|
| 358 | ${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
|
---|
| 359 | #
|
---|
| 360 | let "num = num + 1" >/dev/null
|
---|
| 361 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 362 | let "num = num + 1" >/dev/null
|
---|
| 363 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[19] | 364 |
|
---|
| 365 | #
|
---|
[54] | 366 | # test standalone compilation w/mysql and stealth
|
---|
| 367 | #
|
---|
| 368 | TEST="${S}standalone w/mysql+stealth${E}"
|
---|
| 369 | #
|
---|
| 370 | if test -r "Makefile"; then
|
---|
| 371 | $MAKE clean
|
---|
| 372 | fi
|
---|
| 373 | #
|
---|
| 374 | ${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
|
---|
| 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 | #
|
---|
[19] | 382 | # test standalone compilation w/postgresql
|
---|
| 383 | #
|
---|
[22] | 384 | TEST="${S}standalone w/postgresql${E}"
|
---|
[19] | 385 | #
|
---|
| 386 | if test -r "Makefile"; then
|
---|
| 387 | $MAKE clean
|
---|
| 388 | fi
|
---|
| 389 | #
|
---|
| 390 | ${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
|
---|
| 391 | #
|
---|
| 392 | let "num = num + 1" >/dev/null
|
---|
| 393 | testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 394 | let "num = num + 1" >/dev/null
|
---|
| 395 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[19] | 396 |
|
---|
| 397 | #
|
---|
[54] | 398 | # test standalone compilation w/postgresql+stealth
|
---|
| 399 | #
|
---|
| 400 | TEST="${S}standalone w/postgresql+stealth${E}"
|
---|
| 401 | #
|
---|
| 402 | if test -r "Makefile"; then
|
---|
| 403 | $MAKE clean
|
---|
| 404 | fi
|
---|
| 405 | #
|
---|
| 406 | ${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
|
---|
| 407 | #
|
---|
| 408 | let "num = num + 1" >/dev/null
|
---|
| 409 | testmake $? $num "skip" || 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 | #
|
---|
[1] | 414 | # test standalone compilation
|
---|
| 415 | #
|
---|
[22] | 416 | TEST="${S}standalone w/o mail${E}"
|
---|
[1] | 417 | #
|
---|
| 418 | if test -r "Makefile"; then
|
---|
| 419 | $MAKE clean
|
---|
| 420 | fi
|
---|
| 421 | #
|
---|
| 422 | ${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
|
---|
| 423 | #
|
---|
[19] | 424 | let "num = num + 1" >/dev/null
|
---|
| 425 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 426 | let "num = num + 1" >/dev/null
|
---|
| 427 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 428 |
|
---|
| 429 | #
|
---|
| 430 | # test standalone compilation
|
---|
| 431 | #
|
---|
[22] | 432 | TEST="${S}standalone w/o external${E}"
|
---|
[1] | 433 | #
|
---|
| 434 | if test -r "Makefile"; then
|
---|
| 435 | $MAKE clean
|
---|
| 436 | fi
|
---|
| 437 | #
|
---|
| 438 | ${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
|
---|
| 439 | #
|
---|
[19] | 440 | let "num = num + 1" >/dev/null
|
---|
| 441 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 442 | let "num = num + 1" >/dev/null
|
---|
| 443 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 444 |
|
---|
| 445 | # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
|
---|
| 446 |
|
---|
| 447 | #
|
---|
| 448 | # test client/server compilation
|
---|
| 449 | #
|
---|
| 450 | TEST="${S}client/server application w/timeserver${E}"
|
---|
| 451 | #
|
---|
| 452 | if test -r "Makefile"; then
|
---|
| 453 | $MAKE clean
|
---|
| 454 | fi
|
---|
| 455 | #
|
---|
| 456 | ${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
|
---|
| 457 | #
|
---|
[19] | 458 | let "num = num + 1" >/dev/null
|
---|
| 459 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 460 | let "num = num + 1" >/dev/null
|
---|
| 461 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[19] | 462 |
|
---|
[1] | 463 | if test -r "Makefile"; then
|
---|
| 464 | $MAKE clean
|
---|
| 465 | fi
|
---|
| 466 | #
|
---|
| 467 | ${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
|
---|
| 468 | #
|
---|
[19] | 469 | let "num = num + 1" >/dev/null
|
---|
| 470 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 471 | let "num = num + 1" >/dev/null
|
---|
| 472 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 473 |
|
---|
| 474 | #
|
---|
[145] | 475 | # test client/server compilation
|
---|
| 476 | #
|
---|
| 477 | TEST="${S}client/server application static w/timeserver${E}"
|
---|
| 478 | #
|
---|
| 479 | if test -r "Makefile"; then
|
---|
| 480 | $MAKE clean
|
---|
| 481 | fi
|
---|
| 482 | #
|
---|
| 483 | ${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
|
---|
| 484 | #
|
---|
| 485 | let "num = num + 1" >/dev/null
|
---|
| 486 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
| 487 | let "num = num + 1" >/dev/null
|
---|
| 488 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
| 489 |
|
---|
| 490 | if test -r "Makefile"; then
|
---|
| 491 | $MAKE clean
|
---|
| 492 | fi
|
---|
| 493 | #
|
---|
| 494 | ${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
|
---|
| 495 | #
|
---|
| 496 | let "num = num + 1" >/dev/null
|
---|
| 497 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
| 498 | let "num = num + 1" >/dev/null
|
---|
| 499 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
| 500 |
|
---|
| 501 | #
|
---|
[1] | 502 | # test c/s compilation w/ gpg
|
---|
| 503 | #
|
---|
| 504 | TEST="${S}client/server application w/gpg${E}"
|
---|
| 505 | #
|
---|
[19] | 506 | GPG=`find_path gpg`
|
---|
| 507 | let "num = num + 1" >/dev/null
|
---|
[1] | 508 | #
|
---|
[19] | 509 | if [ -z "$GPG" ]; then
|
---|
| 510 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
[54] | 511 | let "num = num + 1" >/dev/null
|
---|
| 512 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
| 513 | let "num = num + 1" >/dev/null
|
---|
| 514 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
| 515 | let "num = num + 1" >/dev/null
|
---|
| 516 | log_skip $num $MAXTEST 'gpg not in PATH'
|
---|
[19] | 517 | else
|
---|
| 518 | if test -r "Makefile"; then
|
---|
[1] | 519 | $MAKE clean
|
---|
[19] | 520 | fi
|
---|
| 521 | #
|
---|
| 522 | ${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
|
---|
| 523 | #
|
---|
| 524 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 525 | let "num = num + 1" >/dev/null
|
---|
| 526 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[19] | 527 | #
|
---|
| 528 | if test -r "Makefile"; then
|
---|
| 529 | $MAKE clean
|
---|
| 530 | fi
|
---|
| 531 | #
|
---|
| 532 | ${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
|
---|
| 533 | #
|
---|
| 534 | let "num = num + 1" >/dev/null
|
---|
| 535 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 536 | let "num = num + 1" >/dev/null
|
---|
| 537 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 538 | fi
|
---|
| 539 |
|
---|
| 540 |
|
---|
| 541 | #
|
---|
| 542 | # test client/server compilation
|
---|
| 543 | #
|
---|
| 544 | TEST="${S}client/server application w/o srp${E}"
|
---|
| 545 | #
|
---|
| 546 | if test -r "Makefile"; then
|
---|
| 547 | $MAKE clean
|
---|
| 548 | fi
|
---|
| 549 | #
|
---|
| 550 | ${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
|
---|
| 551 | #
|
---|
[19] | 552 | let "num = num + 1" >/dev/null
|
---|
| 553 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 554 | let "num = num + 1" >/dev/null
|
---|
| 555 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 556 | #
|
---|
| 557 | if test -r "Makefile"; then
|
---|
| 558 | $MAKE clean
|
---|
| 559 | fi
|
---|
| 560 | #
|
---|
| 561 | ${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
|
---|
| 562 | #
|
---|
[19] | 563 | let "num = num + 1" >/dev/null
|
---|
| 564 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 565 | let "num = num + 1" >/dev/null
|
---|
| 566 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 567 |
|
---|
| 568 | #
|
---|
| 569 | # test client/server compilation w/ debug
|
---|
| 570 | #
|
---|
| 571 | TEST="${S}client/server application w/debug${E}"
|
---|
| 572 | #
|
---|
| 573 | if test -r "Makefile"; then
|
---|
| 574 | $MAKE clean
|
---|
| 575 | fi
|
---|
| 576 | #
|
---|
| 577 | ${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
|
---|
| 578 | #
|
---|
[19] | 579 | let "num = num + 1" >/dev/null
|
---|
| 580 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 581 | let "num = num + 1" >/dev/null
|
---|
| 582 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 583 | #
|
---|
| 584 | if test -r "Makefile"; then
|
---|
| 585 | $MAKE clean
|
---|
| 586 | fi
|
---|
| 587 | #
|
---|
| 588 | ${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
|
---|
| 589 | #
|
---|
[19] | 590 | let "num = num + 1" >/dev/null
|
---|
| 591 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 592 | let "num = num + 1" >/dev/null
|
---|
| 593 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 594 |
|
---|
| 595 | #
|
---|
| 596 | # test client/server compilation w/stealth
|
---|
| 597 | #
|
---|
| 598 | TEST="${S}client/server application w/stealth${E}"
|
---|
| 599 | #
|
---|
| 600 | if test -r "Makefile"; then
|
---|
| 601 | $MAKE clean
|
---|
| 602 | fi
|
---|
| 603 | #
|
---|
| 604 | ${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
|
---|
| 605 | #
|
---|
[19] | 606 | let "num = num + 1" >/dev/null
|
---|
| 607 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 608 | let "num = num + 1" >/dev/null
|
---|
| 609 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 610 | #
|
---|
| 611 | if test -r "Makefile"; then
|
---|
| 612 | $MAKE clean
|
---|
| 613 | fi
|
---|
| 614 | #
|
---|
| 615 | ${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
|
---|
| 616 | #
|
---|
[19] | 617 | let "num = num + 1" >/dev/null
|
---|
| 618 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 619 | let "num = num + 1" >/dev/null
|
---|
| 620 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 621 |
|
---|
| 622 | #
|
---|
| 623 | # test client/server compilation w/logwatch
|
---|
| 624 | #
|
---|
| 625 | TEST="${S}client/server application w/login-watch${E}"
|
---|
| 626 | #
|
---|
| 627 | if test -r "Makefile"; then
|
---|
| 628 | $MAKE clean
|
---|
| 629 | fi
|
---|
| 630 | #
|
---|
| 631 | ${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
|
---|
| 632 | #
|
---|
[19] | 633 | let "num = num + 1" >/dev/null
|
---|
| 634 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 635 | let "num = num + 1" >/dev/null
|
---|
| 636 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 637 | #
|
---|
| 638 | if test -r "Makefile"; then
|
---|
| 639 | $MAKE clean
|
---|
| 640 | fi
|
---|
| 641 | #
|
---|
| 642 | ${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
|
---|
| 643 | #
|
---|
[19] | 644 | let "num = num + 1" >/dev/null
|
---|
| 645 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 646 | let "num = num + 1" >/dev/null
|
---|
| 647 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 648 |
|
---|
| 649 | #
|
---|
| 650 | # test client/server compilation
|
---|
| 651 | #
|
---|
| 652 | TEST="${S}client/server application w/o mail${E}"
|
---|
| 653 | #
|
---|
| 654 | if test -r "Makefile"; then
|
---|
| 655 | $MAKE clean
|
---|
| 656 | fi
|
---|
| 657 | #
|
---|
| 658 | ${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
|
---|
| 659 | #
|
---|
[19] | 660 | let "num = num + 1" >/dev/null
|
---|
| 661 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 662 | let "num = num + 1" >/dev/null
|
---|
| 663 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 664 | #
|
---|
| 665 | if test -r "Makefile"; then
|
---|
| 666 | $MAKE clean
|
---|
| 667 | fi
|
---|
| 668 | #
|
---|
| 669 | ${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
|
---|
| 670 | #
|
---|
[19] | 671 | let "num = num + 1" >/dev/null
|
---|
| 672 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 673 | let "num = num + 1" >/dev/null
|
---|
| 674 | run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 675 |
|
---|
| 676 | #
|
---|
| 677 | # test client/server compilation
|
---|
| 678 | #
|
---|
[22] | 679 | TEST="${S}client/server application w/o external${E}"
|
---|
[1] | 680 | #
|
---|
| 681 | if test -r "Makefile"; then
|
---|
| 682 | $MAKE clean
|
---|
| 683 | fi
|
---|
| 684 | #
|
---|
| 685 | ${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
|
---|
| 686 | #
|
---|
[19] | 687 | let "num = num + 1" >/dev/null
|
---|
| 688 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 689 | let "num = num + 1" >/dev/null
|
---|
| 690 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[1] | 691 | #
|
---|
| 692 | if test -r "Makefile"; then
|
---|
| 693 | $MAKE clean
|
---|
| 694 | fi
|
---|
| 695 | #
|
---|
| 696 | ${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
|
---|
| 697 | #
|
---|
[19] | 698 | let "num = num + 1" >/dev/null
|
---|
| 699 | testmake $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[22] | 700 | let "num = num + 1" >/dev/null
|
---|
| 701 | run_smatch $? $num || let "numfail = numfail + 1" >/dev/null
|
---|
[19] | 702 |
|
---|
[22] | 703 | [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
|
---|
| 704 |
|
---|
[19] | 705 | log_end "COMPILE"
|
---|
[1] | 706 | }
|
---|