summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-28 18:36:51 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-28 18:36:51 +0000
commit9da6efdb9f5a84a4463e1587d5c02b19c9c7a17a (patch)
tree5490ededb80d725185b3490559b7e48ab4365359 /rdiff-backup/testing
parent0845027e12bcb65389d28bb87e3a2ba5f862a78d (diff)
downloadrdiff-backup-9da6efdb9f5a84a4463e1587d5c02b19c9c7a17a.tar.gz
Mostly another unreadable regress fix
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@463 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r--rdiff-backup/testing/regresstest.py4
-rw-r--r--rdiff-backup/testing/roottest.py23
2 files changed, 25 insertions, 2 deletions
diff --git a/rdiff-backup/testing/regresstest.py b/rdiff-backup/testing/regresstest.py
index a94f4ae..4920a7e 100644
--- a/rdiff-backup/testing/regresstest.py
+++ b/rdiff-backup/testing/regresstest.py
@@ -132,8 +132,8 @@ class RegressTest(unittest.TestCase):
"""Change attributes in directory, so regress will request fp"""
subdir = self.output_rp.append('unreadable_dir')
assert subdir.lstat()
- filerp = subdir.append('to_be_unreadable')
- filerp.chmod(0)
+ rp1_1 = subdir.append('to_be_unreadable')
+ rp1_1.chmod(0)
subdir.chmod(0)
diff --git a/rdiff-backup/testing/roottest.py b/rdiff-backup/testing/roottest.py
index a498ff2..87cad2a 100644
--- a/rdiff-backup/testing/roottest.py
+++ b/rdiff-backup/testing/roottest.py
@@ -126,6 +126,23 @@ class HalfRoot(unittest.TestCase):
rp2_3.chmod(0)
return rp1, rp2
+ def cause_regress(self, rp):
+ """Change some of the above to trigger regress"""
+ rp1_1 = rp.append('foo')
+ rp1_1.chmod(04)
+ rp_new = rp.append('lala')
+ rp_new.write_string('asoentuh')
+ rp_new.chmod(0)
+ assert not os.system('chown %s %s' % (user, rp_new.path))
+ rp1_3 = rp.append('unreadable_dir')
+ rp1_3.chmod(0700)
+ rp1_3_1 = rp1_3.append('file_inside')
+ rp1_3_1.chmod(01)
+ rp1_3.chmod(0)
+
+ rbdir = rp.append('rdiff-backup-data')
+ rbdir.append('current_mirror.2000-12-31T21:33:20-07:00.data').touch()
+
def test_backup(self):
"""Test back up, simple restores"""
in_rp1, in_rp2 = self.make_dirs()
@@ -173,6 +190,12 @@ class HalfRoot(unittest.TestCase):
assert rout_perms == 0, rout_perms
assert outrp_perms == 0, outrp_perms
+ self.cause_regress(outrp)
+ cmd5 = ('su -c "rdiff-backup --check-destination-dir %s" %s' %
+ (outrp.path, user))
+ print "Executing regress: ", cmd5
+ assert not os.system(cmd5)
+
class NonRoot(unittest.TestCase):
"""Test backing up as non-root user