[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Rdiff-backup-commits] Changes to rdiff-backup/testing/FilenameMappingte
From: |
Ben Escoto |
Subject: |
[Rdiff-backup-commits] Changes to rdiff-backup/testing/FilenameMappingtest.py |
Date: |
Fri, 04 Nov 2005 21:54:05 -0500 |
Index: rdiff-backup/testing/FilenameMappingtest.py
diff -u rdiff-backup/testing/FilenameMappingtest.py:1.2
rdiff-backup/testing/FilenameMappingtest.py:1.3
--- rdiff-backup/testing/FilenameMappingtest.py:1.2 Tue Jul 22 10:44:50 2003
+++ rdiff-backup/testing/FilenameMappingtest.py Sat Nov 5 02:54:03 2005
@@ -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"""
@@ -28,5 +28,32 @@
assert len(qrp.index) == 1, qrp.index
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()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Rdiff-backup-commits] Changes to rdiff-backup/testing/FilenameMappingtest.py,
Ben Escoto <=