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