Skip to content

Commit

Permalink
test whether borg extract can process unusual filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Aug 8, 2015
1 parent 616d16a commit 27d64a2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions borg/testsuite/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ def test_sparse_file(self):
if sparse_support and hasattr(st, 'st_blocks'):
self.assert_true(st.st_blocks * 512 < total_len / 10) # is output sparse?

def test_unusual_filenames(self):
filenames = ['normal', 'with some blanks', '(with_parens)', 'umlauts_äöüß', ]
for filename in filenames:
filename = os.path.join(self.input_path, filename)
with open(filename, 'wb') as fd:
pass
self.cmd('init', self.repository_location)
self.cmd('create', self.repository_location + '::test', 'input')
for filename in filenames:
with changedir('output'):
self.cmd('extract', self.repository_location + '::test', os.path.join('input', filename))
self.assert_true(os.path.exists(os.path.join('output', 'input', filename)))

def test_repository_swap_detection(self):
self.create_test_files()
os.environ['BORG_PASSPHRASE'] = 'passphrase'
Expand Down

0 comments on commit 27d64a2

Please sign in to comment.