Commit 0fdde0d3 authored by bescoto's avatar bescoto

Refactored fs_abilities, also don't quote if case-insensitive->case-insensitive


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@647 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 94a72093
......@@ -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
......
......@@ -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()
......
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)
......
......@@ -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,
......
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