Changeset 170 for trunk/test
- Timestamp:
- Apr 30, 2008, 11:56:45 PM (17 years ago)
- Location:
- trunk/test
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/test.sh
r128 r170 296 296 MAKE=`which gmake` 297 297 if test "x$?" = x1 ; then 298 MAKE="make -s "298 MAKE="make -s -j 3" 299 299 else 300 300 MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` -
trunk/test/testcompile.sh
r147 r170 41 41 if [ -z "$doall" ]; then 42 42 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (smatch)"; 43 return 0 44 fi 45 46 if [ ! -f "./x_samhain.c.sm" ]; then 47 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip smatch)"; 43 48 return 0 44 49 fi … … 140 145 SAVE_CC="${CC}" 141 146 SMATCH="DBGDEF=--smatch"; export SMATCH 147 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH 142 148 CC="/usr/local/gcc-smatch/bin/gcc"; export CC 149 SMATCH_CC="${CC}" 143 150 fi 144 151 … … 187 194 fi 188 195 # 196 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; } 197 # 189 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 190 199 # … … 193 202 let "num = num + 1" >/dev/null 194 203 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 195 204 # 205 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } 196 206 # 197 207 # test standalone compilation … … 481 491 fi 482 492 # 493 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; } 494 # 483 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 484 496 # … … 498 510 let "num = num + 1" >/dev/null 499 511 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 500 512 # 513 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } 501 514 # 502 515 # test c/s compilation w/ gpg -
trunk/test/testrun_1b.sh
r169 r170 20 20 # 21 21 22 MAXTEST= 6; export MAXTEST22 MAXTEST=7; export MAXTEST 23 23 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE 24 24 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE 25 26 testrun1b_modrc () 27 { 28 ORIGINAL="\[EOF\]" 29 REPLACEMENT="\[PortCheck\]" 30 ex -s $RCFILE <<EOF 31 %s/$ORIGINAL/$REPLACEMENT/g 32 wq 33 EOF 34 35 echo "PortCheckActive = yes" >>"$RCFILE" 36 echo "PortCheckInterface = 127.0.0.1" >>"$RCFILE" 37 } 25 38 26 39 testrun1b_internal () … … 173 186 174 187 cp "${SCRIPTDIR}/testrc_1" "${RCFILE}" 188 189 if test "x$2" = "xmodrc"; then 190 [ -z "$verbose" ] || log_msg_ok "mod rc..."; 191 testrun1b_modrc 192 fi 175 193 176 194 ./samhain -t init -p none -l info … … 253 271 [ -z "$verbose" ] || log_msg_fail "checking"; 254 272 fi 255 tmp=`egrep 'Classification text: Checking' test_log_prelude 2>/dev/null | wc -l` 256 if [ $tmp -lt 1 ]; then 257 [ -z "$verbose" ] || log_msg_fail "checking"; 273 # 274 if test "x$2" = "xmodrc"; then 275 tmp=`egrep 'Classification text: Service opened' test_log_prelude 2>/dev/null | wc -l` 276 if [ $tmp -lt 1 ]; then 277 [ -z "$verbose" ] || log_msg_fail "service"; 278 fi 279 tmp=`egrep 'Service: port=5500' test_log_prelude 2>/dev/null | wc -l` 280 if [ $tmp -lt 1 ]; then 281 [ -z "$verbose" ] || log_msg_fail "port 5500"; 282 fi 258 283 fi 259 284 # … … 270 295 log_skip 2 $MAXTEST 'gpg not found in $PATH' 271 296 log_skip 3 $MAXTEST 'gpg not found in $PATH' 297 log_skip 4 $MAXTEST 'gpg not found in $PATH' 298 log_skip 5 $MAXTEST 'gpg not found in $PATH' 299 log_skip 6 $MAXTEST 'gpg not found in $PATH' 300 log_skip 7 $MAXTEST 'gpg not found in $PATH' 272 301 else 273 302 eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null … … 278 307 log_skip 4 $MAXTEST 'public PGP key 0x0F571F6C not present' 279 308 log_skip 5 $MAXTEST 'public PGP key 0x0F571F6C not present' 309 log_skip 6 $MAXTEST 'public PGP key 0x0F571F6C not present' 310 log_skip 7 $MAXTEST 'public PGP key 0x0F571F6C not present' 280 311 else 281 312 # … … 342 373 # ------------- fifth test ------------- 343 374 # 344 if test -f /usr/local/lib/libprelude.so375 if ! test -d /var/run/prelude-manager 345 376 then 346 LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" 347 export LD_LIBRARY_PATH 377 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 378 sudo mkdir /var/run/prelude-manager 379 sudo chown prelude:rainer /var/run/prelude-manager 380 sudo chmod 770 /var/run/prelude-manager 348 381 fi 349 382 # … … 367 400 # ------------- sixth test ------------- 368 401 # 369 if test -f /usr/local/lib/libprelude.so402 if ! test -d /var/run/prelude-manager 370 403 then 371 LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" 372 export LD_LIBRARY_PATH 404 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 405 sudo mkdir /var/run/prelude-manager 406 sudo chown prelude:rainer /var/run/prelude-manager 407 sudo chmod 770 /var/run/prelude-manager 373 408 fi 374 409 # … … 389 424 fi 390 425 426 # 427 # ------------- seventh test ----------- 428 # 429 if ! test -d /var/run/prelude-manager 430 then 431 [ -z "$verbose" ] || log_msg_ok "create /var/run/prelude-manager..."; 432 sudo mkdir /var/run/prelude-manager 433 sudo chown prelude:rainer /var/run/prelude-manager 434 sudo chmod 770 /var/run/prelude-manager 435 fi 436 # 437 PM=`find_path prelude-manager` 438 if [ -z "$PM" ]; then 439 log_skip 7 $MAXTEST 'prelude-manager not found in $PATH' 440 elif [ -z "$doall" ]; then 441 log_skip 7 $MAXTEST 'logging to prelude (or use --really-all)' 442 else 443 BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file" 444 testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1" "modrc" 445 do_test_1b_2 446 if [ $? -eq 0 ]; then 447 log_ok 7 $MAXTEST 'logging to prelude' 448 else 449 log_fail 7 $MAXTEST 'logging to prelude' 450 fi 451 fi 452 391 453 fi 392 454 fi -
trunk/test/testrun_2d.sh
r51 r170 24 24 CLIENT_BUILDOPTS="--quiet $TRUST --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --enable-network=client --disable-mail --disable-external-scripts --enable-login-watch --enable-xml-log --enable-db-reload --with-logserver=localhost --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS 25 25 26 create_pgpass () { 27 touch ~/.pgpass 28 chmod 600 ~/.pgpass 29 cat > ~/.pgpass << EOF 30 localhost:*:samhain:samhain:samhain 31 EOF 32 } 33 26 34 check_psql_log () { 27 35 DATE="$1" 28 36 29 37 rm -f test_log_db 30 PGPASSWORD=samhain; export PGPASSWORD 38 # PGPASSWORD=samhain; export PGPASSWORD 39 create_pgpass 31 40 psql -U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';" >test_log_db 32 41 # … … 77 86 return 1 78 87 else 79 PGPASSWORD="samhain"; export PGPASSWORD 88 # PGPASSWORD="samhain"; export PGPASSWORD 89 create_pgpass 80 90 TEST=`psql -U samhain -d samhain -c "SELECT * FROM log LIMIT 1;" 2>/dev/null` 81 91 if [ $? -ne 0 -o -z "$TEST" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.