summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-24 06:31:28 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-24 06:31:28 +0000
commit3b9946d214fabebd4c72d278d579de21677b7d0c (patch)
tree1a313b918d271edfbe4a26dd09bc1bb104fdf119
parentcf261678220d5fd9fe5683cf937f185719ae4d8e (diff)
downloadrdiff-backup-3b9946d214fabebd4c72d278d579de21677b7d0c.tar.gz
Refactored fs_abilities, also don't quote if case-insensitive->case-insensitive
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@647 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/testing/finaltest.py22
-rw-r--r--rdiff-backup/testing/fs_abilitiestest.py16
-rw-r--r--rdiff-backup/testing/regressiontest.py6
-rw-r--r--rdiff-backup/testing/restoretest.py2
4 files changed, 25 insertions, 21 deletions
diff --git a/rdiff-backup/testing/finaltest.py b/rdiff-backup/testing/finaltest.py
index 65f38e5..79f788c 100644
--- a/rdiff-backup/testing/finaltest.py
+++ b/rdiff-backup/testing/finaltest.py
@@ -47,7 +47,7 @@ class PathSetter(unittest.TestCase):
def reset_schema(self):
self.rb_schema = (SourceDir +
- "/../rdiff-backup -v3 --no-compare-inode "
+ "/../rdiff-backup -v5 --no-compare-inode "
"--remote-schema './chdir-wrapper2 %s' ")
def refresh(self, *rp_list):
@@ -78,9 +78,11 @@ class PathSetter(unittest.TestCase):
"""
arglist = []
if time: arglist.extend(["--current-time", str(time)])
- arglist.append(self.src_prefix + args[0])
+ if args[0][0] == "/": arglist.append(args[0])
+ else: arglist.append(self.src_prefix + args[0])
if len(args) > 1:
- arglist.append(self.dest_prefix + args[1])
+ if args[1][0] == "/": arglist.append(args[1])
+ else: arglist.append(self.dest_prefix + args[1])
assert len(args) == 2
arg_string = ' '.join(map(lambda s: "'%s'" % (s,), arglist))
@@ -229,34 +231,34 @@ class Final(PathSetter):
Myrm("testfiles/procoutput")
procout = rpath.RPath(Globals.local_connection, 'testfiles/procoutput')
self.set_connections(None, None, None, None)
- self.exec_rb(10000, '../../../../../../proc', procout.path)
+ self.exec_rb(10000, '/proc', procout.path)
time.sleep(1)
- self.exec_rb(20000, '../../../../../../proc', procout.path)
+ self.exec_rb(20000, '/proc', procout.path)
time.sleep(1)
self.exec_rb(30000, Local.inc1rp.path, procout.path)
assert CompareRecursive(Local.inc1rp, procout)
time.sleep(1)
- self.exec_rb(40000, '../../../../../../proc', procout.path)
+ self.exec_rb(40000, '/proc', procout.path)
def testProcRemote(self):
"""Test mirroring proc remote"""
Myrm("testfiles/procoutput")
procout = rpath.RPath(Globals.local_connection, 'testfiles/procoutput')
self.set_connections(None, None, "test2/tmp/", "../../")
- self.exec_rb(10000, '../../../../../../proc', procout.path)
+ self.exec_rb(10000, '/proc', procout.path)
time.sleep(1)
- self.exec_rb(20000, '../../../../../../proc', procout.path)
+ self.exec_rb(20000, '/proc', procout.path)
time.sleep(1)
self.exec_rb(30000, Local.inc1rp.path, procout.path)
assert CompareRecursive(Local.inc1rp, procout)
time.sleep(1)
- self.exec_rb(40000, '../../../../../../proc', procout.path)
+ self.exec_rb(40000, '/proc', procout.path)
def testProcRemote2(self):
"""Test mirroring proc, this time when proc is remote, dest local"""
Myrm("testfiles/procoutput")
self.set_connections("test1/", "../", None, None)
- self.exec_rb(None, '../../../../../../proc', 'testfiles/procoutput')
+ self.exec_rb(None, '/proc', 'testfiles/procoutput')
def testWindowsMode(self):
"""Test backup with quoting enabled
diff --git a/rdiff-backup/testing/fs_abilitiestest.py b/rdiff-backup/testing/fs_abilitiestest.py
index 87737f0..4f265d2 100644
--- a/rdiff-backup/testing/fs_abilitiestest.py
+++ b/rdiff-backup/testing/fs_abilitiestest.py
@@ -15,6 +15,7 @@ class FSAbilitiesTest(unittest.TestCase):
dir_to_test = "testfiles"
eas = acls = 1
chars_to_quote = ""
+ extended_filenames = 1
case_sensitive = 1
ownership = (os.getuid() == 0)
hardlinks = fsync_dirs = 1
@@ -26,6 +27,7 @@ class FSAbilitiesTest(unittest.TestCase):
# Describes MS-Windows style file system
#dir_to_test = "/mnt/fat"
#eas = acls = 0
+ #extended_filenames = 0
#chars_to_quote = "^a-z0-9_ -"
#ownership = hardlinks = 0
#fsync_dirs = 1
@@ -62,7 +64,6 @@ class FSAbilitiesTest(unittest.TestCase):
assert fsa.read_only == 0, fsa.read_only
assert fsa.eas == self.eas, fsa.eas
assert fsa.acls == self.acls, fsa.acls
- assert fsa.chars_to_quote == self.chars_to_quote, fsa.chars_to_quote
assert fsa.ownership == self.ownership, fsa.ownership
assert fsa.hardlinks == self.hardlinks, fsa.hardlinks
assert fsa.fsync_dirs == self.fsync_dirs, fsa.fsync_dirs
@@ -70,13 +71,14 @@ class FSAbilitiesTest(unittest.TestCase):
assert fsa.resource_forks == self.resource_forks, fsa.resource_forks
assert fsa.carbonfile == self.carbonfile, fsa.carbonfile
assert fsa.high_perms == self.high_perms, fsa.high_perms
+ assert fsa.extended_filenames == self.extended_filenames
- ctq_rp = new_dir.append("chars_to_quote")
- assert ctq_rp.lstat()
- fp = ctq_rp.open('rb')
- chars_to_quote = fp.read()
- assert not fp.close()
- assert chars_to_quote == self.chars_to_quote, chars_to_quote
+ #ctq_rp = new_dir.append("chars_to_quote")
+ #assert ctq_rp.lstat()
+ #fp = ctq_rp.open('rb')
+ #chars_to_quote = fp.read()
+ #assert not fp.close()
+ #assert chars_to_quote == self.chars_to_quote, chars_to_quote
new_dir.delete()
diff --git a/rdiff-backup/testing/regressiontest.py b/rdiff-backup/testing/regressiontest.py
index 427ed83..fd67f59 100644
--- a/rdiff-backup/testing/regressiontest.py
+++ b/rdiff-backup/testing/regressiontest.py
@@ -1,6 +1,6 @@
import unittest, os
from commontest import *
-from rdiff_backup import Globals, SetConnections, log, rpath, backup
+from rdiff_backup import Globals, SetConnections, log, rpath, backup, fs_abilities
"""Regression tests
@@ -13,7 +13,7 @@ testfiles
Globals.set('change_source_perms', 1)
Globals.counter = 0
Globals.security_level = "override"
-log.Log.setverbosity(3)
+log.Log.setverbosity(5)
def get_local_rp(extension):
@@ -406,7 +406,7 @@ class MirrorTest(PathSetter):
Main.misc_setup([rpin, rpout])
Main.backup_check_dirs(rpin, rpout)
Main.backup_set_rbdir(rpin, rpout)
- Main.backup_set_fs_globals(rpin, rpout)
+ rpout.conn.fs_abilities.backup_set_globals(rpin)
Main.backup_final_init(rpout)
Main.backup_set_select(rpin)
backup.Mirror(rpin, rpout)
diff --git a/rdiff-backup/testing/restoretest.py b/rdiff-backup/testing/restoretest.py
index 5f939f9..395becb 100644
--- a/rdiff-backup/testing/restoretest.py
+++ b/rdiff-backup/testing/restoretest.py
@@ -2,7 +2,7 @@ import unittest
from commontest import *
from rdiff_backup import log, restore, Globals, rpath, TempFile
-Log.setverbosity(3)
+Log.setverbosity(5)
lc = Globals.local_connection
tempdir = rpath.RPath(Globals.local_connection, "testfiles/output")
restore_base_rp = rpath.RPath(Globals.local_connection,