# Path: zfs_autobackup/LogStub.py
# class LogStub:
#     """Just a stub, usually overriden in subclasses."""
# 
#     # simple logging stubs
#     def debug(self, txt):
#         print("DEBUG  : " + txt)
# 
#     def verbose(self, txt):
#         print("VERBOSE: " + txt)
# 
#     def warning(self, txt):
#         print("WARNING: " + txt)
# 
#     def error(self, txt):
#         print("ERROR  : " + txt)
# 
# Path: zfs_autobackup/ExecuteNode.py
# class ExecuteError(Exception):
#     pass


from basetest import *
from zfs_autobackup.LogStub import LogStub
from zfs_autobackup.ExecuteNode import ExecuteError
            r = shelltest("zfs list -H -o name -r -t all " + TEST_POOLS)
            self.assertEqual(r, """
test_source1
test_source1/fs1
test_source1/fs1@test-20101111000001
test_source1/fs1/sub
test_source1/fs1/sub@test-20101111000001
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20101111000001
test_source2/fs3
test_source2/fs3/sub
test_target1
""")

        with self.subTest("second snapshot, no changes, no snapshot"):
            node.consistent_snapshot(node.selected_datasets(property_name="autobackup:test",exclude_paths=[], exclude_received=False, exclude_unchanged=False, min_change=200000), "test-20101111000002", 1)
            r = shelltest("zfs list -H -o name -r -t all " + TEST_POOLS)
            self.assertEqual(r, """
test_source1
test_source1/fs1
test_source1/fs1@test-20101111000001
test_source1/fs1/sub
test_source1/fs1/sub@test-20101111000001
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20101111000001
test_source2/fs3

# Path: zfs_autobackup/LogStub.py
# class LogStub:
#     """Just a stub, usually overriden in subclasses."""
# 
#     # simple logging stubs
#     def debug(self, txt):
#         print("DEBUG  : " + txt)
# 
#     def verbose(self, txt):
#         print("VERBOSE: " + txt)
# 
#     def warning(self, txt):
#         print("WARNING: " + txt)
# 
#     def error(self, txt):
#         print("ERROR  : " + txt)
# 
# Path: zfs_autobackup/ExecuteNode.py
# class ExecuteError(Exception):
#     pass


# Path: tests/test_zfsnode.py
from basetest import *
from zfs_autobackup.LogStub import LogStub
from zfs_autobackup.ExecuteNode import ExecuteError

            r = shelltest("zfs list -H -o name -r -t all " + TEST_POOLS)
            self.assertEqual(r, """
test_source1
test_source1/fs1
test_source1/fs1@test-20101111000001
test_source1/fs1/sub
test_source1/fs1/sub@test-20101111000001
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20101111000001
test_source2/fs3
test_source2/fs3/sub
test_target1
""")

        with self.subTest("second snapshot, no changes, no snapshot"):
            node.consistent_snapshot(node.selected_datasets(property_name="autobackup:test",exclude_paths=[], exclude_received=False, exclude_unchanged=False, min_change=200000), "test-20101111000002", 1)
            r = shelltest("zfs list -H -o name -r -t all " + TEST_POOLS)
            self.assertEqual(r, """
test_source1
test_source1/fs1
test_source1/fs1@test-20101111000001
test_source1/fs1/sub
test_source1/fs1/sub@test-20101111000001
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20101111000001
test_source2/fs3

test_source2/fs3/sub