Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Oct 15, 2024
1 parent 1dd36b7 commit 9dd46c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/test_zfsautobackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def test_defaults(self):

with self.subTest("bare defaults, allow empty"):
with mocktime("20101111000001"):
self.assertFalse(ZfsAutobackup("test test_target1 --allow-empty --no-progress".split(" ")).run())
self.assertFalse(
ZfsAutobackup("test test_target1 --allow-empty --no-progress --no-bookmarks".split(" ")).run())

r = shelltest("zfs list -H -o name -r -t snapshot,filesystem " + TEST_POOLS)
self.assertMultiLineEqual(r, """
Expand Down Expand Up @@ -173,41 +174,41 @@ def test_defaults(self):
self.assertFalse(
ZfsAutobackup("test test_target1 --allow-empty --verbose --no-progress".split(" ")).run())

with mocktime("20111211000001"):
with mocktime("20111212000000"):
self.assertFalse(ZfsAutobackup(
"test test_target1 --allow-empty --verbose --keep-source 1y1y --keep-target 1d1y --no-progress".split(
"test test_target1 --allow-empty --verbose --keep-source 1d1y --keep-target 1d1y --no-progress".split(
" ")).run())

r = shelltest("zfs list -H -o name -r -t snapshot,filesystem " + TEST_POOLS)
self.assertMultiLineEqual(r, """
self.assertMultiLineEqual("""
test_source1
test_source1/fs1
test_source1/fs1@test-20111211000000
test_source1/fs1@test-20111211000001
test_source1/fs1@test-20111212000000
test_source1/fs1/sub
test_source1/fs1/sub@test-20111211000000
test_source1/fs1/sub@test-20111211000001
test_source1/fs1/sub@test-20111212000000
test_source2
test_source2/fs2
test_source2/fs2/sub
test_source2/fs2/sub@test-20111211000000
test_source2/fs2/sub@test-20111211000001
test_source2/fs2/sub@test-20111212000000
test_source2/fs3
test_source2/fs3/sub
test_target1
test_target1/test_source1
test_target1/test_source1/fs1
test_target1/test_source1/fs1@test-20111211000000
test_target1/test_source1/fs1@test-20111211000001
test_target1/test_source1/fs1@test-20111212000000
test_target1/test_source1/fs1/sub
test_target1/test_source1/fs1/sub@test-20111211000000
test_target1/test_source1/fs1/sub@test-20111211000001
test_target1/test_source1/fs1/sub@test-20111212000000
test_target1/test_source2
test_target1/test_source2/fs2
test_target1/test_source2/fs2/sub
test_target1/test_source2/fs2/sub@test-20111211000000
test_target1/test_source2/fs2/sub@test-20111211000001
""")
test_target1/test_source2/fs2/sub@test-20111212000000
""", r)

def test_ignore_othersnaphots(self):

Expand Down
3 changes: 3 additions & 0 deletions tests/test_zfsautobackup40.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,6 @@ def test_migrate_from_mismatching_snapshotname(self):
test_target1/test_source2/fs2/sub
test_target1/test_source2/fs2/sub@test-20101111000000
""")

# TODO
# - check if holds and no-holds function ok when bookmarks are enabled

0 comments on commit 9dd46c9

Please sign in to comment.