Commit 611cdb3c authored by bescoto's avatar bescoto

Added test for long socket handling


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@294 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent ee9e1ac1
...@@ -158,6 +158,33 @@ class IncrementTest1(unittest.TestCase): ...@@ -158,6 +158,33 @@ class IncrementTest1(unittest.TestCase):
InternalBackup(1, 1, "testfiles/longfilenames1", Local.rpout.path, 100) InternalBackup(1, 1, "testfiles/longfilenames1", Local.rpout.path, 100)
InternalBackup(1, 1, "testfiles/longfilenames2", Local.rpout.path, 200) InternalBackup(1, 1, "testfiles/longfilenames2", Local.rpout.path, 200)
def test_long_socket(self):
"""Test backing up a directory with long sockets in them
For some reason many unicies don't allow sockets with long
names to be made in the usual way.
"""
sockdir = rpath.RPath(Globals.local_connection, "testfiles/sockettest")
if sockdir.lstat():
Myrm(sockdir.path)
sockdir.setdata()
sockdir.mkdir()
tmp_sock = sockdir.append("sock")
tmp_sock.mksock()
sock1 = sockdir.append("Long_socket_name---------------------------------------------------------------------------------------------------")
self.assertRaises(rpath.SkipFileException, sock1.mksock)
rpath.rename(tmp_sock, sock1)
assert sock1.issock()
sock2 = sockdir.append("Medium_socket_name--------------------------------------------------------------")
sock2.mksock()
Myrm(Local.rpout.path)
InternalBackup(1, 1, sockdir.path, Local.rpout.path,
current_time = 1)
InternalBackup(1, 1, "testfiles/empty", Local.rpout.path,
current_time = 10000)
def testNoWrite(self): def testNoWrite(self):
"""Test backup/restore on dirs without write permissions""" """Test backup/restore on dirs without write permissions"""
def write_string(rp, s = ""): def write_string(rp, s = ""):
......
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