summaryrefslogtreecommitdiff
path: root/rdiff-backup
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-09-22 17:17:52 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-09-22 17:17:52 +0000
commit64196dc34733a6faa2e5bf475c8040cdf8f4be2e (patch)
tree64e4946ef514e4ca2659cacbeae1c28cf438e106 /rdiff-backup
parentfa50cc19153c3ff87828c9a5ad9e83257c0b3737 (diff)
downloadrdiff-backup-64196dc34733a6faa2e5bf475c8040cdf8f4be2e.tar.gz
Added socket test and test for socket too long bug
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@211 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup')
-rw-r--r--rdiff-backup/testing/rpathtest.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/rdiff-backup/testing/rpathtest.py b/rdiff-backup/testing/rpathtest.py
index 6924892..952abd1 100644
--- a/rdiff-backup/testing/rpathtest.py
+++ b/rdiff-backup/testing/rpathtest.py
@@ -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):