Changeset 27 for trunk/test/testrun_2.sh
- Timestamp:
- Apr 6, 2006, 8:55:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_2.sh
r22 r27 1 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 # 2 21 3 22 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE … … 16 35 rm -f test_log_valgrind 17 36 18 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 37 ${VALGRIND} ./yule.2 -l info -p none >/dev/null 2>>test_log_valgrind & 38 PROC_Y2=$! 39 sleep 5 40 41 [ -z "$verbose" ] || { 42 echo; 43 echo "${S}Start Server #2${E}: ./yule.2 -l info -p none &"; 44 echo; 45 } 46 47 ${VALGRIND} ./yule -l info -p none -e info --bind-address=127.0.0.1 \ 48 --server-port=49778 >/dev/null 2>>test_log_valgrind & 19 49 PROC_Y=$! 20 50 sleep 5 … … 32 62 [ -z "$quiet" ] && log_msg_fail "samhain.new -t check"; 33 63 kill $PROC_Y 64 kill $PROC_Y2 34 65 return 1 35 66 fi 36 67 37 68 kill $PROC_Y 38 sleep 5 69 kill $PROC_Y2 70 sleep 5 71 72 # cp ${LOGFILE} triple_test 73 # cp ${LOGFILE}2 triple_test_2 74 75 egrep "START(>|\").*Yule(>|\")" ${LOGFILE}2 >/dev/null 2>&1 76 if [ $? -ne 0 ]; then 77 [ -z "$verbose" ] || log_msg_fail "Server #2 start"; 78 return 1 79 fi 80 egrep "remote_host.*Checking.*/bin" ${LOGFILE}2 >/dev/null 2>&1 81 if [ $? -ne 0 ]; then 82 [ -z "$verbose" ] || log_msg_fail "Client file check (relayed)"; 83 return 1 84 fi 85 egrep "remote_host.*EXIT.*Samhain" ${LOGFILE}2 >/dev/null 2>&1 86 if [ $? -ne 0 ]; then 87 [ -z "$verbose" ] || log_msg_fail "Client exit (relayed)"; 88 return 1 89 fi 90 egrep "EXIT.*Yule.*SIGTERM" ${LOGFILE}2 >/dev/null 2>&1 91 if [ $? -ne 0 ]; then 92 [ -z "$verbose" ] || log_msg_fail "Server #2 exit"; 93 return 1 94 fi 95 39 96 40 97 egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1 … … 195 252 rm -f test_log_valgrind 196 253 197 ${VALGRIND} ./yule -p none >/dev/null 2>>test_log_valgrind &254 ${VALGRIND} ./yule -p none -e none >/dev/null 2>>test_log_valgrind & 198 255 PROC_Y=$! 199 256 sleep 5 … … 292 349 rm -f test_log_valgrind 293 350 294 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 351 ${VALGRIND} ./yule -l info -p none -e none \ 352 >/dev/null 2>>test_log_valgrind & 295 353 PROC_Y=$! 296 354 sleep 5 … … 427 485 ) >entry.html 428 486 429 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 487 ${VALGRIND} ./yule -l info -p none -e none \ 488 >/dev/null 2>>test_log_valgrind & 430 489 PROC_Y=$! 431 490 sleep 5 432 491 433 492 egrep '<!-- head -->' $HTML >/dev/null 2>&1 493 if [ $? -ne 0 ]; then 494 # rm -f head.html; rm -f foot.html; rm -f entry.html; 495 kill $PROC_Y 496 [ -z "$verbose" ] || log_msg_fail "head.html (1)"; 497 return 1 498 fi 499 500 egrep '<!-- foot -->' $HTML >/dev/null 2>&1 434 501 if [ $? -ne 0 ]; then 435 502 rm -f head.html; rm -f foot.html; rm -f entry.html; 436 503 kill $PROC_Y 437 [ -z "$verbose" ] || log_msg_fail "head.html"; 438 return 1 439 fi 440 441 egrep '<!-- foot -->' $HTML >/dev/null 2>&1 442 if [ $? -ne 0 ]; then 443 rm -f head.html; rm -f foot.html; rm -f entry.html; 444 kill $PROC_Y 445 [ -z "$verbose" ] || log_msg_fail "foot.html"; 504 [ -z "$verbose" ] || log_msg_fail "foot.html (1)"; 446 505 return 1 447 506 fi … … 500 559 egrep '<!-- ehead -->' $HTML >/dev/null 2>&1 501 560 if [ $? -ne 0 ]; then 502 [ -z "$verbose" ] || log_msg_fail " head.html";561 [ -z "$verbose" ] || log_msg_fail "end head.html"; 503 562 return 1 504 563 fi … … 511 570 egrep '<!-- eentry -->' $HTML >/dev/null 2>&1 512 571 if [ $? -ne 0 ]; then 513 [ -z "$verbose" ] || log_msg_fail "en try.html";572 [ -z "$verbose" ] || log_msg_fail "end entry.html"; 514 573 return 1 515 574 fi … … 522 581 egrep '<!-- efoot -->' $HTML >/dev/null 2>&1 523 582 if [ $? -ne 0 ]; then 524 [ -z "$verbose" ] || log_msg_fail " foot.html";583 [ -z "$verbose" ] || log_msg_fail "end foot.html"; 525 584 return 1 526 585 fi … … 571 630 fi 572 631 573 # save binary and build server 632 # save binary and build server2 574 633 # 575 634 cp samhain samhain.build || return 1 576 635 make clean >/dev/null || return 1 577 636 578 ${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --enable-network=server --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$ RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --with-html-file=$HTML --enable-encrypt=2637 ${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --enable-network=server --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=${RCFILE}2 --with-log-file=${LOGFILE}2 --with-pid-file=$PW_DIR/.samhain_lock2 --with-html-file=${HTML}2 --with-state-dir=$PW_DIR --enable-encrypt=2 --with-port=49778 579 638 # 580 639 if test x$? = x0; then … … 593 652 fi 594 653 654 # save binary and build server 655 # 656 cp yule yule.2 || return 1 657 make clean >/dev/null || return 1 658 659 ${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --enable-network=server --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-html-file=$HTML --with-state-dir=$PW_DIR --enable-encrypt=2 660 # 661 if test x$? = x0; then 662 [ -z "$verbose" ] || log_msg_ok "configure..."; 663 $MAKE > /dev/null 2>>test_log 664 if test x$? = x0; then 665 [ -z "$verbose" ] || log_msg_ok "make..."; 666 else 667 [ -z "$quiet" ] && log_msg_fail "make..."; 668 return 1 669 fi 670 671 else 672 [ -z "$quiet" ] && log_msg_fail "configure..."; 673 return 1 674 fi 675 595 676 596 677 ##################################################################### … … 633 714 mv samhain.build.new samhain.new || return 1 634 715 635 rm -f ./.samhain_log.* 636 rm -f ./.samhain_lock 716 # Set in server 717 718 ./samhain_setpwd yule new $SHPW >/dev/null 719 720 if test x$? = x0; then 721 [ -z "$verbose" ] || log_msg_ok "./samhain_setpwd yule new $SHPW"; 722 else 723 [ -z "$quiet" ] && log_msg_fail "./samhain_setpwd yule new $SHPW"; 724 return 1 725 fi 726 727 mv yule.new yule || return 1 728 729 # 730 731 rm -f ./.samhain_log* 732 rm -f ./.samhain_lock* 637 733 638 734 SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%` … … 646 742 647 743 echo $SHCLT >> testrc_2 744 cp testrc_2 testrc_22 648 745 649 746 do_test_1
Note:
See TracChangeset
for help on using the changeset viewer.