Changeset 169 for trunk/test/testrun_1.sh
- Timestamp:
- Apr 13, 2008, 9:59:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/testrun_1.sh
r138 r169 41 41 testrun1_setup=0 42 42 43 MAXTEST=1 3; export MAXTEST43 MAXTEST=15; export MAXTEST 44 44 45 45 test_dirs () { … … 65 65 fi 66 66 done 67 } 68 69 70 TESTPOLICY_15=" 71 [Misc] 72 DigestAlgo=SHA1 73 RedefReadOnly = +TXT 74 [ReadOnly] 75 dir=${BASE} 76 " 77 mod_testdata_15 () { 78 mod_testdata_1 79 } 80 chk_testdata_15 () { 81 chk_testdata_1 82 } 83 84 TESTPOLICY_14=" 85 [Misc] 86 DigestAlgo=MD5 87 RedefReadOnly = +TXT 88 [ReadOnly] 89 dir=${BASE} 90 " 91 mod_testdata_14 () { 92 mod_testdata_1 93 } 94 chk_testdata_14 () { 95 chk_testdata_1 67 96 } 68 97 … … 455 484 mod_testdata_5 () { 456 485 mod_testdata_4 457 echo "This is a xxxx file" > "${BASE}/a/a/b/x" # GrowingLogFiles 458 echo "This is a test file" > "${BASE}/a/a/b/y" # GrowingLogFiles 459 echo "This is a xxxx file bad" > "${BASE}/a/a/b/z" # GrowingLogFiles 486 echo "1 This is a xxxx file" > "${BASE}/a/a/b/x" # GrowingLogFiles 487 echo "1 This is a test file" > "${BASE}/a/a/b/y" # GrowingLogFiles 488 echo "2 This is a test file" >> "${BASE}/a/a/b/y" # GrowingLogFiles 489 echo "1 This is a xxxx file bad" > "${BASE}/a/a/b/z" # GrowingLogFiles 490 echo "2 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles 491 echo "3 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles 460 492 } 461 493 … … 716 748 " 717 749 mod_testdata_2 () { 718 mod_testdata_1; 750 # mod_testdata_1; 751 one_sec_sleep 752 touch "${BASE}/a/a/x" 753 chmod 0555 "${BASE}/a/a/y" 754 mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 755 echo "1 This is a test file" > "${BASE}/a/b/y"; 756 echo "2 This is a test file" >> "${BASE}/a/b/y"; 757 echo "4 This is a test file" >> "${BASE}/a/b/z"; 758 rm "${BASE}/a/b/yy"; # mv/rm to force new inode 759 rm "${BASE}/a/b/l_y"; 760 ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y"; 761 echo "foobar" > "${BASE}/a/c/y" 719 762 rm "${BASE}/a/a/c/y" 720 763 echo "foobar" > "${BASE}/a/a/c/foo" … … 762 805 fi 763 806 tmp=`grep CRIT $LOGFILE | wc -l` 764 if [ $tmp -ne 8]; then807 if [ $tmp -ne 10 ]; then 765 808 [ -z "$verbose" ] || log_msg_fail "policy count"; 766 809 return 1 … … 769 812 770 813 TESTPOLICY_1=" 814 [Misc] 815 RedefReadOnly = +TXT 771 816 [ReadOnly] 772 817 dir=${BASE} … … 777 822 touch "${BASE}/a/a/x" 778 823 chmod 0555 "${BASE}/a/a/y" 779 mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; echo "This is a test file" > "${BASE}/a/b/y"; rm "${BASE}/a/b/yy" 824 mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 825 echo "1 This is a test file" > "${BASE}/a/b/y"; 826 echo "2 This is a test file" >> "${BASE}/a/b/y"; 827 echo "4 This is a test file" >> "${BASE}/a/b/z"; 828 rm "${BASE}/a/b/yy"; # mv/rm to force new inode 829 rm "${BASE}/a/b/l_y"; 830 ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y"; 780 831 echo "foobar" > "${BASE}/a/c/y" 832 # 833 mv "${BASE}/b/x" "${BASE}/b/xx"; # mv/rm to force new inode 834 mkdir "${BASE}/b/x" 835 rm "${BASE}/b/xx"; 836 # 837 mv "${BASE}/b/y" "${BASE}/b/yy"; # mv/rm to force new inode 838 ln -s "${BASE}/b/z" "${BASE}/b/y" 839 rm "${BASE}/b/yy"; 840 # 841 rm "${BASE}/b/l_x"; echo "1 This is a test file" > "${BASE}/b/l_x"; 781 842 } 782 843 … … 792 853 if [ $tmp -ne 1 ]; then 793 854 [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)"; 855 return 1 794 856 fi 795 857 # … … 797 859 egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1 798 860 if [ $? -ne 0 ]; then 799 [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)"; 800 return 1 861 if [ "${BASE}/${ff}" != "${BASE}/b" ]; then 862 [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checksum)"; 863 return 1 864 fi 801 865 fi 802 866 tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l` 803 867 if [ $tmp -ne 1 ]; then 804 [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)"; 868 if [ "${BASE}/${ff}" != "${BASE}/b" ]; then 869 [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)"; 870 return 1 871 fi 805 872 fi 806 873 done 807 874 done 875 # 876 # 877 # 878 egrep "CRIT.*POLICY \[ReadOnly\] ----H---T-.*${BASE}/b" $LOGFILE >/dev/null 2>&1 879 if [ $? -ne 0 ]; then 880 [ -z "$verbose" ] || log_msg_fail "${BASE}/b"; 881 return 1 882 fi 883 egrep "CRIT.*POLICY \[ReadOnly\] CL-I-M--TS.*${BASE}/b/y" $LOGFILE >/dev/null 2>&1 884 if [ $? -ne 0 ]; then 885 [ -z "$verbose" ] || log_msg_fail "${BASE}/b/y"; 886 return 1 887 fi 888 egrep "CRIT.*POLICY \[ReadOnly\] CL---M--TS.*${BASE}/b/l_x" $LOGFILE >/dev/null 2>&1 889 if [ $? -ne 0 ]; then 890 [ -z "$verbose" ] || log_msg_fail "${BASE}/b/l_x"; 891 return 1 892 fi 893 egrep "CRIT.*POLICY \[ReadOnly\] C--IHM--TS.*${BASE}/b/x" $LOGFILE >/dev/null 2>&1 894 if [ $? -ne 0 ]; then 895 [ -z "$verbose" ] || log_msg_fail "${BASE}/b/x"; 896 return 1 897 fi 898 # 899 # 900 # 808 901 egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/a/x" $LOGFILE >/dev/null 2>&1 809 902 if [ $? -ne 0 ]; then … … 821 914 return 1 822 915 fi 916 egrep "CRIT.*POLICY \[ReadOnly\] -L-I----T-.*${BASE}/a/b/l_y" $LOGFILE >/dev/null 2>&1 917 if [ $? -ne 0 ]; then 918 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/l_y"; 919 return 1 920 fi 823 921 egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/b" $LOGFILE >/dev/null 2>&1 824 922 if [ $? -ne 0 ]; then … … 826 924 return 1 827 925 fi 926 egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/b/z" $LOGFILE >/dev/null 2>&1 927 if [ $? -ne 0 ]; then 928 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/z"; 929 return 1 930 fi 828 931 egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/c/y" $LOGFILE >/dev/null 2>&1 829 932 if [ $? -ne 0 ]; then … … 832 935 fi 833 936 tmp=`grep CRIT $LOGFILE | wc -l` 834 if [ $tmp -ne 5]; then937 if [ $tmp -ne 11 ]; then 835 938 [ -z "$verbose" ] || log_msg_fail "policy count"; 836 939 return 1 837 940 fi 941 for ff in x y z; do 942 ./samhain --list-file "${BASE}/a/a/${ff}" -d "$PW_DIR/.samhain_file" > "$PW_DIR/.samhain_tmp" 943 diff "$PW_DIR/.samhain_tmp" "${BASE}/a/a/${ff}" >/dev/null 944 if [ $? -ne 0 ]; then 945 [ -z "$verbose" ] || log_msg_fail "diff $PW_DIR/.samhain_tmp ${BASE}/a/a/${ff}" 946 return 1 947 fi 948 done 949 838 950 return 0 839 951 } … … 1028 1140 chmod 0755 "${BASE}/${ff}" 1029 1141 for gg in $TFILES; do 1030 echo " This is a test file" > "${BASE}/${ff}/${gg}"1142 echo "1 This is a test file" > "${BASE}/${ff}/${gg}" 1031 1143 chmod 0644 "${BASE}/${ff}/${gg}" 1144 ln -s "${BASE}/${ff}/${gg}" "${BASE}/${ff}/l_${gg}" 1032 1145 done 1146 echo "2 This is a test file" >> "${BASE}/${ff}/y" 1147 echo "2 This is a test file" >> "${BASE}/${ff}/z" 1148 echo "3 This is a test file" >> "${BASE}/${ff}/z" 1033 1149 done 1034 1150 }
Note:
See TracChangeset
for help on using the changeset viewer.