fixes and more tests

This commit is contained in:
Edwin Eefting 2020-07-08 17:07:21 +02:00
parent 8176326126
commit a6cdd4b89e
2 changed files with 16 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class TestZfsNode(unittest2.TestCase):
#free up space
r=shelltest("rm /test_target1/waste")
r=shelltest("zpool sync")
r=shelltest("zfs umount test_target1")
#should resume and succeed
with io.StringIO() as buf:

View File

@ -1,5 +1,7 @@
from basetest import *
import time
import contextlib
import io
@ -11,6 +13,19 @@ class TestZfsAutobackup(unittest2.TestCase):
def test_defaults(self):
with self.subTest("no datasets selected"):
#should resume and succeed
with io.StringIO() as buf:
with contextlib.redirect_stderr(buf):
with patch('time.strftime', return_value="20101111000000"):
self.assertTrue(ZfsAutobackup("nonexisting test_target1 --verbose --debug".split(" ")).run())
print(buf.getvalue())
#did we really resume?
self.assertIn("No source filesystems selected", buf.getvalue())
with self.subTest("defaults with full verbose and debug"):
with patch('time.strftime', return_value="20101111000000"):