Commit f75a6d77 authored by bescoto's avatar bescoto

Added testConfig1 test for perm changer


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@532 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 2e3af5a2
......@@ -17,6 +17,13 @@ log.Log.setverbosity(7)
def get_local_rp(extension):
return rpath.RPath(Globals.local_connection, "testfiles/" + extension)
def re_init_dir(rp):
"""Delete directory if present, then recreate"""
if rp.lstat():
Myrm(rp.path)
rp.setdata()
rp.mkdir()
class Local:
"""This is just a place to put increments relative to the local
connection"""
......@@ -162,10 +169,7 @@ class IncrementTest1(unittest.TestCase):
"""Test backing up a directory with quoted hardlinks in it"""
hldir = rpath.RPath(Globals.local_connection,
"testfiles/quoted_hardlinks")
if hldir.lstat():
Myrm(hldir.path)
hldir.setdata()
hldir.mkdir()
re_init_dir(hldir)
hl1 = hldir.append("HardLink1")
hl1.touch()
hl2 = hldir.append("HardLink2")
......@@ -187,10 +191,7 @@ class IncrementTest1(unittest.TestCase):
"""
sockdir = rpath.RPath(Globals.local_connection, "testfiles/sockettest")
if sockdir.lstat():
Myrm(sockdir.path)
sockdir.setdata()
sockdir.mkdir()
re_init_dir(sockdir)
tmp_sock = sockdir.append("sock")
tmp_sock.mksock()
sock1 = sockdir.append("Long_socket_name---------------------------------------------------------------------------------------------------")
......@@ -253,6 +254,29 @@ class IncrementTest1(unittest.TestCase):
'testfiles/no_write_out2',
'testfiles/empty'])
def testConfig1(self):
"""Test certain backing up/restoring directory of certain structure
Some version (0.13.4 and earlier) had a PermChanger that
choked when run on a structure like this.
"""
def make_confdir():
confdir = rpath.RPath(Globals.local_connection,
"testfiles/conf1test")
re_init_dir(confdir)
dir1 = confdir.append('dir')
dir1.mkdir()
dir1_1 = dir1.append('1-dir')
dir1_1.mkdir()
reg1_1_1 = dir1_1.append('reg')
reg1_1_1.touch()
reg1_2 = dir1.append('2-reg')
reg1_2.touch()
make_confdir()
BackupRestoreSeries(1, 1, ['testfiles/conf1test', 'testfiles/empty'])
class MirrorTest(PathSetter):
"""Test some mirroring functions"""
......
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