Revision
932
Author
wsiegrist@apple.com
Date
2011-02-08 16:00:16 -0800 (Tue, 08 Feb 2011)

Log Message

Add tests for root path ignore feature

Modified Paths

Diff

Modified: branches/PR-8817822/testing/darwintrace/run-tests.sh (931 => 932)


--- branches/PR-8817822/testing/darwintrace/run-tests.sh	2011-02-08 23:32:52 UTC (rev 931)
+++ branches/PR-8817822/testing/darwintrace/run-tests.sh	2011-02-09 00:00:16 UTC (rev 932)
@@ -50,9 +50,11 @@
 done
 set -e
 
+
 echo "========== TEST: close() Safety =========="
 $CLOSETEST
 
+
 echo "========== TEST: open() Trace =========="
 for FILE in /System/Library/LaunchDaemons/*.plist;
 do
@@ -63,6 +65,7 @@
   test $C -eq 1
 done
 
+
 echo "========== TEST: readlink() Trace =========="
 for FILE in $(find /System/Library/Frameworks/*Foundation.framework -type l | xargs);
 do
@@ -72,6 +75,33 @@
   test $C -eq 1
 done
 
+
+echo "========== TEST: ROOT Ignores =========="
+export DARWINTRACE_IGNORE_ROOTS=""
+export DSTROOT="/System/Library/LaunchAgents"
+for FILE in /var/log/*.log;
+do
+	cat $FILE >> /dev/null;
+	RP=$($REALPATH $FILE);
+	LOGPAT="cat\[[0-9]+\][[:space:]]open[[:space:]]${RP}"
+	C=$(grep -cE $LOGPAT $DARWINTRACE_LOG)
+  test $C -eq 1
+done
+
+for FILE in /System/Library/LaunchAgents/com.apple.*;
+do
+	cat $FILE >> /dev/null;
+	RP=$($REALPATH $FILE);
+	LOGPAT="cat\[[0-9]+\][[:space:]]open[[:space:]]${RP}"
+  set +e
+	C=$(grep -cE $LOGPAT $DARWINTRACE_LOG)
+  set -e
+  test $C -eq 0
+done
+unset DARWINTRACE_IGNORE_ROOTS
+unset DSTROOT
+
+
 echo "========== TEST: Redirection =========="
 mkdir -p $ROOT/$PREFIX
 mkdir -p $ROOT/usr/lib