summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-29 18:17:36 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-29 18:17:36 +0000
commit01c4a2f72bccf8a36a24d160621953e7e9755b1d (patch)
tree90079a084def4638a37a6a842b3d61e396403fc3
parent932022a0999659a6d02a076b22bfdc9c567cf87a (diff)
downloadrdiff-backup-01c4a2f72bccf8a36a24d160621953e7e9755b1d.tar.gz
Added half root unreadable dir restore test
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@414 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/testing/roottest.py33
1 files changed, 32 insertions, 1 deletions
diff --git a/rdiff-backup/testing/roottest.py b/rdiff-backup/testing/roottest.py
index ab0c580..a548767 100644
--- a/rdiff-backup/testing/roottest.py
+++ b/rdiff-backup/testing/roottest.py
@@ -46,6 +46,11 @@ class HalfRoot(unittest.TestCase):
rp1_2 = rp1.append('to be deleted')
rp1_2.write_string('aosetuhaosetnuhontu')
rp1_2.chmod(0)
+ rp1_3 = rp1.append('unreadable_dir')
+ rp1_3.mkdir()
+ rp1_3_1 = rp1_3.append('file_inside')
+ rp1_3_1.write_string('blah')
+ rp1_3.chmod(0)
rp2 = rpath.RPath(Globals.local_connection, "testfiles/root_half2")
if rp2.lstat(): Myrm(rp2.path)
@@ -53,10 +58,15 @@ class HalfRoot(unittest.TestCase):
rp2_1 = rp2.append('foo')
rp2_1.write_string('goodbye')
rp2_1.chmod(0)
+ rp2_3 = rp2.append('unreadable_dir')
+ rp2_3.mkdir()
+ rp2_3_2 = rp2_3.append('file2')
+ rp2_3_2.touch()
+ rp2_3.chmod(0)
return rp1, rp2
def test_backup(self):
- """Right now just test backing up"""
+ """Test back up, simple restores"""
in_rp1, in_rp2 = self.make_dirs()
outrp = rpath.RPath(Globals.local_connection, "testfiles/output")
if outrp.lstat(): outrp.delete()
@@ -78,6 +88,27 @@ class HalfRoot(unittest.TestCase):
outrp.setdata()
assert CompareRecursive(in_rp2, outrp)
+ rout_rp = rpath.RPath(Globals.local_connection,
+ "testfiles/restore_out")
+ Myrm(rout_rp.path)
+ cmd3 = cmd_schema % (10000,
+ "-r 10000 %s/unreadable_dir" % (outrp.path,),
+ remote_schema, rout_rp.path)
+ print "Executing restore: ", cmd3
+ assert not os.system(cmd3)
+ rout_rp.setdata()
+ assert rout_rp.getperms() == 0, rout_rp.getperms()
+
+ Myrm(rout_rp.path)
+ cmd4 = cmd_schema % (10000,
+ "-r now %s/unreadable_dir" % (outrp.path,),
+ remote_schema, rout_rp.path)
+ print "Executing restore: ", cmd4
+ assert not os.system(cmd4)
+ rout_rp.setdata()
+ assert rout_rp.getperms() == 0, rout_rp.getperms()
+
+
class NonRoot(unittest.TestCase):
"""Test backing up as non-root user