summaryrefslogtreecommitdiff
path: root/tests/store-deduplication.scm
diff options
context:
space:
mode:
authorBrennan Vincent <brennan@umanwizard.com>2025-10-01 13:39:13 -0700
committerLudovic Courtès <ludo@gnu.org>2025-10-06 10:42:08 +0200
commitef42ecb8cb6c1868e57505a9593f0c0590980de1 (patch)
tree88708786497d45f12cd07c2cf0b00864ff23c2f7 /tests/store-deduplication.scm
parent3414e3d99424adadbd687033e906f8c167b8c81b (diff)
tests: Fix ‘store-deduplication.scm’ on systems with large blocks.
Fixes <https://issues.guix.gnu.org/74862>. In particular, this makes it possible to build guix on Asahi, whose tmpfs has 16KiB blocks by default. * tests/store-deduplication.scm ("copy-file/deduplicate, sparse files (holes: ~a/~a/~a)"): Scale hole sizes so the test works with blocks bigger than 4KiB. Change-Id: I92fee04f6f69d4e5bfea7443991303ad68da7b2c Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/store-deduplication.scm')
-rw-r--r--tests/store-deduplication.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/store-deduplication.scm b/tests/store-deduplication.scm
index f116ff9834e..95571e8b6f4 100644
--- a/tests/store-deduplication.scm
+++ b/tests/store-deduplication.scm
@@ -190,7 +190,19 @@
190 initial-gap middle-gap final-gap) 190 initial-gap middle-gap final-gap)
191 (call-with-temporary-directory 191 (call-with-temporary-directory
192 (lambda (store) 192 (lambda (store)
193 (let ((source (string-append store "/source"))) 193 (let* ((source (string-append store "/source"))
194 (store-st (stat store))
195 (store-bksz (stat:blksize store-st))
196 ;; the test checks that space is actually saved
197 ;; by the holes, but this isn't the case if
198 ;; the size of each allocated block is large enough to swamp the savings.
199 ;;
200 ;; So, on large-block systems (e.g. Asahi tmpfs) we need
201 ;; to scale the gaps so this is true again.
202 (scale (max 1 (/ store-bksz 4096)))
203 (initial-gap (* initial-gap scale))
204 (middle-gap (* middle-gap scale))
205 (final-gap (* final-gap scale)))
194 (call-with-output-file source 206 (call-with-output-file source
195 (lambda (port) 207 (lambda (port)
196 (seek port initial-gap SEEK_CUR) 208 (seek port initial-gap SEEK_CUR)