tests/hghave: test that a fifo actually can be created on the filesystem
authorMads Kiilerich <mads@kiilerich.com>
Fri, 15 Jun 2012 00:02:27 +0200
changeset 16969 6d1673107143
parent 16968 456f457e376d
child 16970 8be2a28cc782
tests/hghave: test that a fifo actually can be created on the filesystem Some tests were failing on FAT filesystems.
tests/hghave.py
--- a/tests/hghave.py	Fri Jun 15 00:02:27 2012 +0200
+++ b/tests/hghave.py	Fri Jun 15 00:02:27 2012 +0200
@@ -100,7 +100,15 @@
         return False
 
 def has_fifo():
-    return getattr(os, "mkfifo", None) is not None
+    if getattr(os, "mkfifo", None) is None:
+        return False
+    name = tempfile.mktemp(dir='.', prefix=tempprefix)
+    try:
+        os.mkfifo(name)
+        os.unlink(name)
+        return True
+    except OSError:
+        return False
 
 def has_cacheable_fs():
     from mercurial import util