Changes in trunk/test/testrun_1.sh [30:19]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_1.sh
r30 r19 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 modify8 # it under the terms of the GNU General Public License as published by9 # the Free Software Foundation; either version 2 of the License, or10 # (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 of14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 # GNU General Public License for more details.16 #17 # You should have received a copy of the GNU General Public License18 # along with this program; if not, write to the Free Software19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20 #21 2 22 3 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE … … 41 22 testrun1_setup=0 42 23 43 MAXTEST=1 1; export MAXTEST24 MAXTEST=10; export MAXTEST 44 25 45 26 test_dirs () { … … 65 46 fi 66 47 done 67 }68 69 #70 # combine file check schedule with one-shot mode71 #72 TESTPOLICY_11="73 [ReadOnly]74 dir=99${BASE}75 "76 77 mod_testdata_11 () {78 sleep 179 echo "foobar" >"${BASE}/c/x"; # bad80 chmod 0555 "${BASE}/a/y"; # bad81 ORIGINAL='SetFilecheckTime=60'82 REPLACEMENT='FileCheckScheduleOne = 6 12 * * *'83 ex $RCFILE <<EOF84 %s/${ORIGINAL}/${REPLACEMENT}/g85 wq86 EOF87 }88 89 chk_testdata_11 () {90 # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";91 tmp=`grep CRIT $LOGFILE | wc -l`92 if [ $tmp -ne 2 ]; then93 [ -z "$verbose" ] || log_msg_fail "policy count";94 return 195 fi96 egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/c/x" $LOGFILE >/dev/null 2>&197 if [ $? -ne 0 ]; then98 [ -z "$verbose" ] || log_msg_fail "${BASE}/c/x";99 return 1100 fi101 egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a/y" $LOGFILE >/dev/null 2>&1102 if [ $? -ne 0 ]; then103 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/y";104 return 1105 fi106 CDIRS="a a/a a/b a/c c b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";107 NDIRS="";108 test_dirs;109 return $?110 48 } 111 49 … … 811 749 run_init () 812 750 { 813 rm -f test_log_valgrind 814 815 ${VALGRIND} ./samhain -t init -p none 2>>test_log_valgrind 751 ./samhain -t init -p none 816 752 817 753 if test x$? = x0; then … … 825 761 run_check () 826 762 { 827 ${VALGRIND} ./samhain -t check -p none -l debug 2>>test_log_valgrind763 ./samhain -t check -p none -l debug 828 764 829 765 if test x$? = x0; then … … 842 778 run_update () 843 779 { 844 ${VALGRIND} ./samhain -t update -p none -l debug 2>>test_log_valgrind780 ./samhain -t update -p none -l debug 845 781 846 782 if test x$? = x0; then … … 856 792 rm -rf $LOGFILE 857 793 858 ${VALGRIND} ./samhain -t check -p none -l debug 2>>test_log_valgrind794 ./samhain -t check -p none -l debug 859 795 860 796 if test x$? = x0; then … … 865 801 return 1 866 802 fi 867 # 868 # wtmp may not be readable 869 # 870 tmp=`./samhain -j -L $LOGFILE | grep ERR | grep -v wtmp | wc -l` 803 tmp=`./samhain -j -L $LOGFILE | grep ERR | wc -l` 871 804 if [ $tmp -ne 0 ]; then 872 [ -z "$verbose" ] || log_msg_fail "errors during check"; 873 return 1 874 fi 875 # 876 [ -z "$VALGRIND" ] || { 877 tmp=`cat test_log_valgrind 2>/dev/null | wc -l`; 878 if [ $tmp -ne 0 ]; then 879 [ -z "$verbose" ] || log_msg_fail "valgrind reports errors"; 880 cat test_log_valgrind 881 return 1; 882 fi; 883 } 805 [ -z "$verbose" ] || log_msg_fail "update not successful(?)"; 806 return 1 807 fi 884 808 # 885 809 [ -z "$verbose" ] || log_msg_ok "check(2)..."; … … 892 816 prep_testdata () 893 817 { 894 if test -d "$BASE"; then 895 if [ -d "${BASE}" ]; then 896 chmod -R 0700 "${BASE}" || { 897 [ -z "$quiet" ] && log_msg_fail "chmod -R 0700 ${BASE}"; 898 return 1; 899 } 900 fi 901 fi 818 chmod -R 0700 "${BASE}" || { 819 [ -z "$quiet" ] && log_msg_fail "chmod -R 0700 ${BASE}"; 820 return 1; 821 } 902 822 903 823 rm -rf "${BASE}" || { … … 952 872 if test x$? = x0; then 953 873 [ -z "$verbose" ] || log_msg_ok "configure..."; 954 $MAKE > /dev/null 2>>test_log874 $MAKE > /dev/null 955 875 if test x$? = x0; then 956 876 [ -z "$verbose" ] || log_msg_ok "make...";
Note:
See TracChangeset
for help on using the changeset viewer.