Commit 3f7a30f8 authored by ben's avatar ben

Added socket test and test for socket too long bug


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@211 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 6779e148
......@@ -133,6 +133,33 @@ class CheckSyms(RPathTest):
link.delete()
class CheckSockets(RPathTest):
"""Check reading and making sockets"""
def testMake(self):
"""Create socket, then read it"""
sock = RPath(self.lc, self.mainprefix, ("socket",))
assert not sock.lstat()
sock.mksock()
assert sock.issock()
sock.delete()
def testLongSock(self):
"""Test making a socket with a long name
On some systems, the name of a socket is restricted, and
cannot be as long as a regular file. When this happens, a
SkipFileException should be raised.
"""
sock = RPath(self.lc, self.mainprefix, ("socketaoeusthaoeaoeutnhaonseuhtansoeuthasoneuthasoeutnhasonuthaoensuhtasoneuhtsanouhonetuhasoneuthsaoenaonsetuaosenuhtaoensuhaoeu",))
assert not sock.lstat()
try: sock.mksock()
except SkipFileException: pass
else: print "Warning, making long socket did not fail"
sock.setdata()
if sock.lstat(): sock.delete()
class TouchDelete(RPathTest):
"""Check touching and deletion of files"""
def testTouch(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment