From 64196dc34733a6faa2e5bf475c8040cdf8f4be2e Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 22 Sep 2002 17:17:52 +0000 Subject: 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 --- rdiff-backup/testing/rpathtest.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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): -- cgit v1.2.1