From ad2542e930bb3f21b34e6bf733602575f5ef1c96 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Thu, 25 Jun 2020 17:43:40 +0200 Subject: [PATCH] more tests --- test_zfsautobackup.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/test_zfsautobackup.py b/test_zfsautobackup.py index ea0d564..64fb58b 100644 --- a/test_zfsautobackup.py +++ b/test_zfsautobackup.py @@ -631,11 +631,32 @@ test_target1/test_source2/fs2/sub test_target1/test_source2/fs2/sub@test-20101111000000 """) + def test_test(self): + + with patch('time.strftime', return_value="20101111000000"): + self.assertFalse(ZfsAutobackup("test test_target1 --verbose --test".split(" ")).run()) + + r=shelltest("zfs list -H -o name -r -t all "+TEST_POOLS) + self.assertMultiLineEqual(r,""" +test_source1 +test_source1/fs1 +test_source1/fs1/sub +test_source2 +test_source2/fs2 +test_source2/fs2/sub +test_source2/fs3 +test_source2/fs3/sub +test_target1 +""") + + ########################### -# TODO: --raw --ignore-transfer-errors --test --verbose/etc -# -# more unfinished stuff below: +# TODO: def test_raw(self): self.skipTest("todo: later when travis supports zfs 0.8") + + 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)")