mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-13 22:47:12 +03:00
fixes
This commit is contained in:
parent
c678ae5f9a
commit
a64168bee2
@ -1,7 +1,7 @@
|
|||||||
from basetest import *
|
from .basetest import *
|
||||||
|
|
||||||
|
|
||||||
class TestZfsNode(unittest2.TestCase):
|
class TestExternalFailures(unittest2.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
prepare_zpools()
|
prepare_zpools()
|
||||||
@ -259,8 +259,28 @@ test_target1/test_source2/fs2/sub@test-20101111000002
|
|||||||
with patch('time.strftime', return_value="20101111000001"):
|
with patch('time.strftime', return_value="20101111000001"):
|
||||||
self.assertTrue(ZfsAutobackup("test test_target1 --verbose --allow-empty".split(" ")).run())
|
self.assertTrue(ZfsAutobackup("test test_target1 --verbose --allow-empty".split(" ")).run())
|
||||||
|
|
||||||
############# TODO:
|
#UPDATE: offcourse the one thing that wasn't tested had a bug :( (in ExecuteNode.run()).
|
||||||
def test_ignoretransfererrors(self):
|
def test_ignoretransfererrors(self):
|
||||||
|
|
||||||
self.skipTest(
|
self.skipTest("Not sure how to implement a test for this without some serious hacking and patching.")
|
||||||
"todo: create some kind of situation where zfs recv exits with an error but transfer is still ok (happens in practice with acltype)")
|
|
||||||
|
# #recreate target pool without any features
|
||||||
|
# # shelltest("zfs set compress=on test_source1; zpool destroy test_target1; zpool create test_target1 -o feature@project_quota=disabled /dev/ram2")
|
||||||
|
#
|
||||||
|
# with patch('time.strftime', return_value="20101111000000"):
|
||||||
|
# self.assertFalse(ZfsAutobackup("test test_target1 --verbose --allow-empty --no-progress".split(" ")).run())
|
||||||
|
#
|
||||||
|
# r = shelltest("zfs list -H -o name -r -t all test_target1")
|
||||||
|
#
|
||||||
|
# self.assertMultiLineEqual(r, """
|
||||||
|
# test_target1
|
||||||
|
# test_target1/test_source1
|
||||||
|
# test_target1/test_source1/fs1
|
||||||
|
# test_target1/test_source1/fs1@test-20101111000002
|
||||||
|
# test_target1/test_source1/fs1/sub
|
||||||
|
# test_target1/test_source1/fs1/sub@test-20101111000002
|
||||||
|
# test_target1/test_source2
|
||||||
|
# test_target1/test_source2/fs2
|
||||||
|
# test_target1/test_source2/fs2/sub
|
||||||
|
# test_target1/test_source2/fs2/sub@test-20101111000002
|
||||||
|
# """)
|
||||||
|
@ -23,8 +23,7 @@ class ZfsAutobackup:
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=self.HEADER,
|
description=self.HEADER,
|
||||||
epilog='When a filesystem fails, zfs_backup will continue and report the number of failures at that end. '
|
epilog='Full manual at: https://github.com/psy0rz/zfs_autobackup')
|
||||||
'Also the exit code will indicate the number of failures. Full manual at: https://github.com/psy0rz/zfs_autobackup')
|
|
||||||
parser.add_argument('--ssh-config', default=None, help='Custom ssh client config')
|
parser.add_argument('--ssh-config', default=None, help='Custom ssh client config')
|
||||||
parser.add_argument('--ssh-source', default=None,
|
parser.add_argument('--ssh-source', default=None,
|
||||||
help='Source host to get backup from. (user@hostname) Default %(default)s.')
|
help='Source host to get backup from. (user@hostname) Default %(default)s.')
|
||||||
|
@ -489,8 +489,8 @@ class ZfsDataset:
|
|||||||
if self.zfs_node.readonly:
|
if self.zfs_node.readonly:
|
||||||
self.force_exists = True
|
self.force_exists = True
|
||||||
|
|
||||||
# check if transfer was really ok (exit codes have been wrong before due to bugs in zfs-utils and can be
|
# check if transfer was really ok (exit codes have been wrong before due to bugs in zfs-utils and some
|
||||||
# ignored by some parameters)
|
# errors should be ignored, thats where the ignore_exitcodes is for.)
|
||||||
if not self.exists:
|
if not self.exists:
|
||||||
self.error("error during transfer")
|
self.error("error during transfer")
|
||||||
raise (Exception("Target doesn't exist after transfer, something went wrong."))
|
raise (Exception("Target doesn't exist after transfer, something went wrong."))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user