When I run test.sh in my home machine I get a failure in the "cleanup" tests. When I run it anywhere else it passes. This confused me for a while until I discovered that ecryptfs is causing the disk-usage figures (from stat) to be somewhat larger, and is therefore changing the cleanup results.

This doesn't just affect ecryptfs, of course, but any filesystem that has different overheads.

That's not the bug, although it's annoying.

The bug is that the test directory cannot be located outside the source directory, even though it's 99% set up to do so. There's just one line that doesn't allow it.

This patch fixes that bug and adds a comment to prevent others wasting their time trying to figure it out like I did.

Thanks

Andrew
Fix bug testing with ecryptfs.

The test script assumes that zero-length files take up zero disk space,
that the block size is 4k, and that the disk usage will be the file size
rounded up to the nearest block size. Unfortunately these were not true
for ecryptfs.

Additionally, running the test.sh from another directory did not work
due to a bad location assumption in another test.
---
 test.sh |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test.sh b/test.sh
index f1362f8..69dfa1b 100755
--- a/test.sh
+++ b/test.sh
@@ -564,7 +564,7 @@ base_suite() {
 
 link_suite() {
     if [ `dirname $COMPILER` = . ]; then
-        ln -s ../ccache $COMPILER
+        ln -s "$CCACHE" $COMPILER
         CCACHE_COMPILE="./$COMPILER"
         base_tests
         rm -f $COMPILER
@@ -1632,6 +1632,11 @@ cleanup_suite() {
         fi
     done
 
+    # Warning: this test is known to fail on filesystems that have
+    # unusual block sizes, including ecryptfs.  The workaround is
+    # to place the test directory elsewhere:
+    #     cd /tmp
+    #     CCACHE=$DIR/ccache $DIR/test.sh
     testname="forced cleanup, size limit"
     $CCACHE -C >/dev/null
     prepare_cleanup_test $CCACHE_DIR/a
-- 
1.7.9.5

_______________________________________________
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache

Reply via email to