more tests

This commit is contained in:
Edwin Eefting 2020-06-15 21:13:19 +02:00
parent 37a9f49d8d
commit fc853622dd

@ -186,8 +186,6 @@ test_target1/test_source2/fs2/sub@test-20101111000000
def test_nosnapshot(self):
# r=shelltest("zfs snapshot test_source1/fs1@othersimple")
# r=shelltest("zfs snapshot test_source1/fs1@otherdate-20001111000000")
with patch('time.strftime', return_value="20101111000000"):
self.assertFalse(ZfsAutobackup("test test_target1 --verbose --no-snapshot".split(" ")).run())
@ -212,8 +210,6 @@ test_target1/test_source2/fs2
def test_nosend(self):
# r=shelltest("zfs snapshot test_source1/fs1@othersimple")
# r=shelltest("zfs snapshot test_source1/fs1@otherdate-20001111000000")
with patch('time.strftime', return_value="20101111000000"):
self.assertFalse(ZfsAutobackup("test test_target1 --verbose --no-send".split(" ")).run())
@ -234,4 +230,37 @@ test_source2/fs2/sub@test-20101111000000
test_source2/fs3
test_source2/fs3/sub
test_target1
""")
def test_ignorereplicated(self):
r=shelltest("zfs snapshot test_source1/fs1@otherreplication")
with patch('time.strftime', return_value="20101111000000"):
self.assertFalse(ZfsAutobackup("test test_target1 --verbose --ignore-replicated".split(" ")).run())
r=shelltest("zfs list -H -o name -r -t all")
#(only parents are created )
#TODO: it probably shouldn't create these
self.assertMultiLineEqual(r,"""
test_source1
test_source1/fs1
test_source1/fs1@otherreplication
test_source1/fs1/sub
test_source1/fs1/sub@test-20101111000000
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20101111000000
test_source2/fs3
test_source2/fs3/sub
test_target1
test_target1/test_source1
test_target1/test_source1/fs1
test_target1/test_source1/fs1/sub
test_target1/test_source1/fs1/sub@test-20101111000000
test_target1/test_source2
test_target1/test_source2/fs2
test_target1/test_source2/fs2/sub
test_target1/test_source2/fs2/sub@test-20101111000000
""")