Don't check st_nlink value for mkdir
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 3 Aug 2017 11:07:30 +0000 (13:07 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Thu, 3 Aug 2017 11:08:40 +0000 (13:08 +0200)
Some filesystems don't track this for directories.

Fixes: #180.
ChangeLog.rst
test/test_examples.py
test/test_syscalls.c

index c233bcd342297e9efd273d07a16c7024cfaf6095..c697cbedb74f05ba9396d08477ad11674c9ffaea 100644 (file)
@@ -10,6 +10,8 @@ Unreleased Changes
 * Fixed a symbol versioning problem that resulted in very strange
   failures (segfaults, unexpected behavior) in different situations.
 
+* Fixed a test failure when /tmp is on btrfs.  
+
 libfuse 3.1.0 (2017-07-08)
 ==========================
 
index 5234a7d0d6c8245b470d54261d9fda20305cb7fe..0a2f3fd39a195f9a0176aea07bb5759e3d38b49e 100755 (executable)
@@ -266,6 +266,7 @@ def tst_mkdir(mnt_dir):
     fstat = os.stat(fullname)
     assert stat.S_ISDIR(fstat.st_mode)
     assert os.listdir(fullname) ==  []
+    # Some filesystem (e.g. BTRFS) don't track st_nlink for directories
     assert fstat.st_nlink in (1,2)
     assert dirname in os.listdir(mnt_dir)
 
index 281f2189ccf821effd6d5f5b3d7956dd55302e87..e30cfc19d3f8afc15d940759570af21e5afdd992 100644 (file)
@@ -1329,7 +1329,9 @@ static int test_mkdir(void)
        if (res == -1)
                return -1;
        err += check_mode(testdir, 0755);
-       err += check_nlink(testdir, 2);
+       /* Some file systems (like btrfs) don't track link
+          count for directories */
+       //err += check_nlink(testdir, 2);
        err += check_dir_contents(testdir, dir_contents);
        res = rmdir(testdir);
        if (res == -1) {