mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-06-15 02:22:06 +03:00
formatting
This commit is contained in:
parent
ce05e1ba4c
commit
6fefadf884
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
from basetest import *
|
from basetest import *
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +28,6 @@ class TestZfsNode(unittest2.TestCase):
|
|||||||
r = shelltest("zfs umount test_target1")
|
r = shelltest("zfs umount test_target1")
|
||||||
r = shelltest("zfs mount test_target1")
|
r = shelltest("zfs mount test_target1")
|
||||||
|
|
||||||
|
|
||||||
# resume initial backup
|
# resume initial backup
|
||||||
def test_initial_resume(self):
|
def test_initial_resume(self):
|
||||||
|
|
||||||
@ -51,7 +49,6 @@ class TestZfsNode(unittest2.TestCase):
|
|||||||
else:
|
else:
|
||||||
self.assertIn(": resuming", buf.getvalue())
|
self.assertIn(": resuming", buf.getvalue())
|
||||||
|
|
||||||
|
|
||||||
# should resume and succeed
|
# should resume and succeed
|
||||||
with OutputIO() as buf:
|
with OutputIO() as buf:
|
||||||
with redirect_stdout(buf):
|
with redirect_stdout(buf):
|
||||||
@ -80,7 +77,6 @@ test_target1/test_source2/fs2/sub
|
|||||||
test_target1/test_source2/fs2/sub@test-20101111000000
|
test_target1/test_source2/fs2/sub@test-20101111000000
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
# resume incremental backup
|
# resume incremental backup
|
||||||
def test_incremental_resume(self):
|
def test_incremental_resume(self):
|
||||||
|
|
||||||
@ -135,7 +131,6 @@ test_target1/test_source2/fs2/sub
|
|||||||
test_target1/test_source2/fs2/sub@test-20101111000000
|
test_target1/test_source2/fs2/sub@test-20101111000000
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
# generate an invalid resume token, and verify if its aborted automaticly
|
# generate an invalid resume token, and verify if its aborted automaticly
|
||||||
def test_initial_resumeabort(self):
|
def test_initial_resumeabort(self):
|
||||||
|
|
||||||
@ -174,7 +169,6 @@ test_target1/test_source2/fs2/sub
|
|||||||
test_target1/test_source2/fs2/sub@test-20101111000000
|
test_target1/test_source2/fs2/sub@test-20101111000000
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
# generate an invalid resume token, and verify if its aborted automaticly
|
# generate an invalid resume token, and verify if its aborted automaticly
|
||||||
def test_incremental_resumeabort(self):
|
def test_incremental_resumeabort(self):
|
||||||
|
|
||||||
@ -215,7 +209,6 @@ test_target1/test_source2/fs2/sub
|
|||||||
test_target1/test_source2/fs2/sub@test-20101111000000
|
test_target1/test_source2/fs2/sub@test-20101111000000
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
# create a resume situation, where the other side doesnt want the snapshot anymore ( should abort resume )
|
# create a resume situation, where the other side doesnt want the snapshot anymore ( should abort resume )
|
||||||
def test_abort_unwanted_resume(self):
|
def test_abort_unwanted_resume(self):
|
||||||
|
|
||||||
@ -233,7 +226,8 @@ test_target1/test_source2/fs2/sub@test-20101111000000
|
|||||||
with redirect_stdout(buf):
|
with redirect_stdout(buf):
|
||||||
# incremental, doesnt want previous anymore
|
# incremental, doesnt want previous anymore
|
||||||
with patch('time.strftime', return_value="20101111000002"):
|
with patch('time.strftime', return_value="20101111000002"):
|
||||||
self.assertFalse(ZfsAutobackup("test test_target1 --verbose --keep-target=0 --debug --allow-empty".split(" ")).run())
|
self.assertFalse(ZfsAutobackup(
|
||||||
|
"test test_target1 --verbose --keep-target=0 --debug --allow-empty".split(" ")).run())
|
||||||
|
|
||||||
print(buf.getvalue())
|
print(buf.getvalue())
|
||||||
|
|
||||||
@ -253,7 +247,6 @@ test_target1/test_source2/fs2/sub
|
|||||||
test_target1/test_source2/fs2/sub@test-20101111000002
|
test_target1/test_source2/fs2/sub@test-20101111000002
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
def test_missing_common(self):
|
def test_missing_common(self):
|
||||||
|
|
||||||
with patch('time.strftime', return_value="20101111000000"):
|
with patch('time.strftime', return_value="20101111000000"):
|
||||||
@ -266,10 +259,8 @@ 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:
|
############# TODO:
|
||||||
def test_ignoretransfererrors(self):
|
def test_ignoretransfererrors(self):
|
||||||
|
|
||||||
self.skipTest("todo: create some kind of situation where zfs recv exits with an error but transfer is still ok (happens in practice with acltype)")
|
self.skipTest(
|
||||||
|
"todo: create some kind of situation where zfs recv exits with an error but transfer is still ok (happens in practice with acltype)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user