diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-11-05 02:54:03 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-11-05 02:54:03 +0000 |
commit | 6fa3fef60bf51b664da9d13b174137a32a4ee8a0 (patch) | |
tree | 41f03d6453d6fffca00f8914dd49a741f3e20669 /rdiff-backup/testing | |
parent | 828d9e44d4417ca9ee3831919d6023492805b7a9 (diff) | |
download | rdiff-backup-6fa3fef60bf51b664da9d13b174137a32a4ee8a0.tar.gz |
Fix for quoted filenames too long
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@670 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r-- | rdiff-backup/testing/FilenameMappingtest.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/rdiff-backup/testing/FilenameMappingtest.py b/rdiff-backup/testing/FilenameMappingtest.py index e364c59..1bc1b6c 100644 --- a/rdiff-backup/testing/FilenameMappingtest.py +++ b/rdiff-backup/testing/FilenameMappingtest.py @@ -1,6 +1,6 @@ import unittest from commontest import * -from rdiff_backup import FilenameMapping +from rdiff_backup import FilenameMapping, rpath, Globals class FilenameMappingTest(unittest.TestCase): """Test the FilenameMapping class, for quoting filenames""" @@ -29,4 +29,31 @@ class FilenameMappingTest(unittest.TestCase): assert (qrp.index[0] == "mirror_metadata.1969-12-31T21:33:20-07:00.data.gz") + def testLongFilenames(self): + """See if long quoted filenames cause crash""" + MakeOutputDir() + outrp = rpath.RPath(Globals.local_connection, "testfiles/output") + inrp = rpath.RPath(Globals.local_connection, "testfiles/quotetest") + re_init_dir(inrp) + long_filename = "A"*200 # when quoted should cause overflow + longrp = inrp.append(long_filename) + longrp.touch() + shortrp = inrp.append("B") + shortrp.touch() + + rdiff_backup(1, 1, inrp.path, outrp.path, 100000, + extra_options = "--override-chars-to-quote A") + + longrp_out = outrp.append(long_filename) + assert not longrp_out.lstat() + shortrp_out = outrp.append('B') + assert shortrp_out.lstat() + + rdiff_backup(1, 1, "testfiles/empty", outrp.path, 200000) + shortrp_out.setdata() + assert not shortrp_out.lstat() + rdiff_backup(1, 1, inrp.path, outrp.path, 300000) + shortrp_out.setdata() + assert shortrp_out.lstat() + if __name__ == "__main__": unittest.main() |