mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
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>
This commit is contained in:
parent
3414e3d994
commit
ef42ecb8cb
1 changed files with 13 additions and 1 deletions
|
|
@ -190,7 +190,19 @@
|
|||
initial-gap middle-gap final-gap)
|
||||
(call-with-temporary-directory
|
||||
(lambda (store)
|
||||
(let ((source (string-append store "/source")))
|
||||
(let* ((source (string-append store "/source"))
|
||||
(store-st (stat store))
|
||||
(store-bksz (stat:blksize store-st))
|
||||
;; the test checks that space is actually saved
|
||||
;; by the holes, but this isn't the case if
|
||||
;; the size of each allocated block is large enough to swamp the savings.
|
||||
;;
|
||||
;; So, on large-block systems (e.g. Asahi tmpfs) we need
|
||||
;; to scale the gaps so this is true again.
|
||||
(scale (max 1 (/ store-bksz 4096)))
|
||||
(initial-gap (* initial-gap scale))
|
||||
(middle-gap (* middle-gap scale))
|
||||
(final-gap (* final-gap scale)))
|
||||
(call-with-output-file source
|
||||
(lambda (port)
|
||||
(seek port initial-gap SEEK_CUR)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue