Index: trunk/test/testrun_1.sh
===================================================================
--- trunk/test/testrun_1.sh	(revision 138)
+++ trunk/test/testrun_1.sh	(revision 169)
@@ -41,5 +41,5 @@
 testrun1_setup=0
 
-MAXTEST=13; export MAXTEST
+MAXTEST=15; export MAXTEST
 
 test_dirs () {
@@ -65,4 +65,33 @@
 	fi
     done
+}
+
+
+TESTPOLICY_15="
+[Misc]
+DigestAlgo=SHA1
+RedefReadOnly = +TXT
+[ReadOnly]
+dir=${BASE}
+"
+mod_testdata_15 () {
+    mod_testdata_1
+}
+chk_testdata_15 () {
+    chk_testdata_1
+}
+
+TESTPOLICY_14="
+[Misc]
+DigestAlgo=MD5
+RedefReadOnly = +TXT
+[ReadOnly]
+dir=${BASE}
+"
+mod_testdata_14 () {
+    mod_testdata_1
+}
+chk_testdata_14 () {
+    chk_testdata_1
 }
 
@@ -455,7 +484,10 @@
 mod_testdata_5 () {
     mod_testdata_4
-    echo "This is a xxxx file"  > "${BASE}/a/a/b/x"    # GrowingLogFiles
-    echo "This is a test file" > "${BASE}/a/a/b/y"     # GrowingLogFiles
-    echo "This is a xxxx file bad" > "${BASE}/a/a/b/z" # GrowingLogFiles
+    echo "1 This is a xxxx file" > "${BASE}/a/a/b/x"     # GrowingLogFiles
+    echo "1 This is a test file" > "${BASE}/a/a/b/y"     # GrowingLogFiles
+    echo "2 This is a test file" >> "${BASE}/a/a/b/y"    # GrowingLogFiles
+    echo "1 This is a xxxx file bad" > "${BASE}/a/a/b/z" # GrowingLogFiles
+    echo "2 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles
+    echo "3 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles
 }
 
@@ -716,5 +748,16 @@
 "
 mod_testdata_2 () {
-    mod_testdata_1;
+    # mod_testdata_1;
+    one_sec_sleep
+    touch "${BASE}/a/a/x"
+    chmod 0555 "${BASE}/a/a/y"
+    mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 
+    echo "1 This is a test file" >  "${BASE}/a/b/y";
+    echo "2 This is a test file" >> "${BASE}/a/b/y";
+    echo "4 This is a test file" >> "${BASE}/a/b/z";
+    rm "${BASE}/a/b/yy"; # mv/rm to force new inode
+    rm "${BASE}/a/b/l_y";
+    ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y";
+    echo "foobar" > "${BASE}/a/c/y"
     rm "${BASE}/a/a/c/y"
     echo "foobar" > "${BASE}/a/a/c/foo"
@@ -762,5 +805,5 @@
     fi
     tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 8 ]; then
+    if [ $tmp -ne 10 ]; then
 	[ -z "$verbose" ] || log_msg_fail "policy count";
 	return 1
@@ -769,4 +812,6 @@
 
 TESTPOLICY_1="
+[Misc]
+RedefReadOnly = +TXT
 [ReadOnly]
 dir=${BASE}
@@ -777,6 +822,22 @@
     touch "${BASE}/a/a/x"
     chmod 0555 "${BASE}/a/a/y"
-    mv "${BASE}/a/b/y"  "${BASE}/a/b/yy"; echo "This is a test file" > "${BASE}/a/b/y"; rm "${BASE}/a/b/yy"
+    mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 
+    echo "1 This is a test file" >  "${BASE}/a/b/y";
+    echo "2 This is a test file" >> "${BASE}/a/b/y";
+    echo "4 This is a test file" >> "${BASE}/a/b/z";
+    rm "${BASE}/a/b/yy"; # mv/rm to force new inode
+    rm "${BASE}/a/b/l_y";
+    ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y";
     echo "foobar" > "${BASE}/a/c/y"
+    #
+    mv "${BASE}/b/x" "${BASE}/b/xx"; # mv/rm to force new inode 
+    mkdir "${BASE}/b/x"
+    rm "${BASE}/b/xx";
+    #
+    mv "${BASE}/b/y" "${BASE}/b/yy"; # mv/rm to force new inode
+    ln -s  "${BASE}/b/z" "${BASE}/b/y"
+    rm "${BASE}/b/yy";
+    #
+    rm "${BASE}/b/l_x";  echo "1 This is a test file" >  "${BASE}/b/l_x"; 
 }
 
@@ -792,4 +853,5 @@
 	if [ $tmp -ne 1 ]; then
 	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
+	    return 1
 	fi
 	#
@@ -797,13 +859,44 @@
 	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
 	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-		return 1
+		if [ "${BASE}/${ff}" != "${BASE}/b" ]; then
+		    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checksum)";
+		    return 1
+		fi
 	    fi
 	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
 	    if [ $tmp -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
+		if [ "${BASE}/${ff}" != "${BASE}/b" ]; then
+		    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
+		    return 1
+		fi
 	    fi
 	done
     done
+    #
+    #
+    #
+    egrep "CRIT.*POLICY \[ReadOnly\] ----H---T-.*${BASE}/b" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/b";
+	return 1
+    fi
+    egrep "CRIT.*POLICY \[ReadOnly\] CL-I-M--TS.*${BASE}/b/y" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/y";
+	return 1
+    fi
+    egrep "CRIT.*POLICY \[ReadOnly\] CL---M--TS.*${BASE}/b/l_x" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/l_x";
+	return 1
+    fi
+    egrep "CRIT.*POLICY \[ReadOnly\] C--IHM--TS.*${BASE}/b/x" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/x";
+	return 1
+    fi
+    #
+    #
+    #
     egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/a/x" $LOGFILE >/dev/null 2>&1
     if [ $? -ne 0 ]; then
@@ -821,4 +914,9 @@
 	return 1
     fi
+    egrep "CRIT.*POLICY \[ReadOnly\] -L-I----T-.*${BASE}/a/b/l_y" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/l_y";
+	return 1
+    fi
     egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/b" $LOGFILE >/dev/null 2>&1
     if [ $? -ne 0 ]; then
@@ -826,4 +924,9 @@
 	return 1
     fi
+    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/b/z" $LOGFILE >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/z";
+	return 1
+    fi
     egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/c/y" $LOGFILE >/dev/null 2>&1
     if [ $? -ne 0 ]; then
@@ -832,8 +935,17 @@
     fi
     tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 5 ]; then
+    if [ $tmp -ne 11 ]; then
 	[ -z "$verbose" ] || log_msg_fail "policy count";
 	return 1
     fi
+    for ff in x y z; do
+	./samhain --list-file "${BASE}/a/a/${ff}" -d "$PW_DIR/.samhain_file" > "$PW_DIR/.samhain_tmp"
+	diff "$PW_DIR/.samhain_tmp" "${BASE}/a/a/${ff}" >/dev/null
+	if [ $? -ne 0 ]; then
+	    [ -z "$verbose" ] || log_msg_fail "diff $PW_DIR/.samhain_tmp ${BASE}/a/a/${ff}"
+	    return 1
+	fi
+    done
+
     return 0
 }
@@ -1028,7 +1140,11 @@
 	chmod 0755 "${BASE}/${ff}"
 	for gg in $TFILES; do
-	    echo "This is a test file" > "${BASE}/${ff}/${gg}"
+	    echo "1 This is a test file" > "${BASE}/${ff}/${gg}"
 	    chmod 0644 "${BASE}/${ff}/${gg}"
+	    ln -s "${BASE}/${ff}/${gg}" "${BASE}/${ff}/l_${gg}"
 	done
+	echo "2 This is a test file" >> "${BASE}/${ff}/y"
+	echo "2 This is a test file" >> "${BASE}/${ff}/z"
+	echo "3 This is a test file" >> "${BASE}/${ff}/z"
     done
 }
