Skip to content

Commit 031b779

Browse files
maps: always use BS sized blocks
the fixed chunker also cuts BS blocks.
1 parent 7fe093a commit 031b779

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

src/borg/testsuite/chunkers/__init__.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,38 @@ def fs_supports_sparse():
7777
BS = 4096 # filesystem block size
7878

7979
# Some sparse files. X = content blocks, _ = sparse blocks.
80+
# Block size must always be BS.
81+
8082
# X__XXX____
81-
map_sparse1 = [(0 * BS, 1 * BS, True), (1 * BS, 2 * BS, False), (3 * BS, 3 * BS, True), (6 * BS, 4 * BS, False)]
83+
map_sparse1 = [
84+
(0, BS, True),
85+
(1 * BS, BS, False),
86+
(2 * BS, BS, False),
87+
(3 * BS, BS, True),
88+
(4 * BS, BS, True),
89+
(5 * BS, BS, True),
90+
(6 * BS, BS, False),
91+
(7 * BS, BS, False),
92+
(8 * BS, BS, False),
93+
(9 * BS, BS, False),
94+
]
8295

8396
# _XX___XXXX
84-
map_sparse2 = [(0 * BS, 1 * BS, False), (1 * BS, 2 * BS, True), (3 * BS, 3 * BS, False), (6 * BS, 4 * BS, True)]
97+
map_sparse2 = [
98+
(0, BS, False),
99+
(1 * BS, BS, True),
100+
(2 * BS, BS, True),
101+
(3 * BS, BS, False),
102+
(4 * BS, BS, False),
103+
(5 * BS, BS, False),
104+
(6 * BS, BS, True),
105+
(7 * BS, BS, True),
106+
(8 * BS, BS, True),
107+
(9 * BS, BS, True),
108+
]
85109

86110
# XXX
87-
map_notsparse = [(0 * BS, 3 * BS, True)]
111+
map_notsparse = [(0, BS, True), (BS, BS, True), (2 * BS, BS, True)]
88112

89113
# ___
90-
map_onlysparse = [(0 * BS, 3 * BS, False)]
114+
map_onlysparse = [(0, BS, False), (BS, BS, False), (2 * BS, BS, False)]

0 commit comments

Comments
 (0)