summaryrefslogtreecommitdiff
path: root/tests/pack.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-04 17:16:22 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-06 23:21:24 +0100
commit598a6b87cc6636aee9dec57ae95922da0a6e31e8 (patch)
tree067e7667432888368a1262c3b7187dc068e84f2b /tests/pack.scm
parentf5a2fb1bfbb620a6ce23ac0e7e15132cae9207da (diff)
pack: Squashfs backend now honors '--localstatedir'.
* guix/scripts/pack.scm (squashfs-image)[database]: New variable. [build]: Add (gnu build install) to the closure. Call 'install-database-and-gc-roots' when DATABASE is true, and invoke mksquashfs once more. * tests/pack.scm ("squashfs-image + localstatedir"): New test.
Diffstat (limited to 'tests/pack.scm')
-rw-r--r--tests/pack.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/pack.scm b/tests/pack.scm
index bfff802d8ac..0c9e4ffa7ff 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -28,6 +28,7 @@
28 #:use-module (guix tests) 28 #:use-module (guix tests)
29 #:use-module (guix gexp) 29 #:use-module (guix gexp)
30 #:use-module (gnu packages bootstrap) 30 #:use-module (gnu packages bootstrap)
31 #:use-module ((gnu packages compression) #:select (squashfs-tools-next))
31 #:use-module (srfi srfi-64)) 32 #:use-module (srfi srfi-64))
32 33
33(define %store 34(define %store
@@ -126,6 +127,41 @@
126 (string=? (string-append #$profile "/bin/guile") 127 (string=? (string-append #$profile "/bin/guile")
127 (pk 'guilelink (readlink "bin/Guile")))) 128 (pk 'guilelink (readlink "bin/Guile"))))
128 (mkdir #$output))))))) 129 (mkdir #$output)))))))
130 (built-derivations (list check))))
131
132 (unless store (test-skip 1))
133 (test-assertm "squashfs-image + localstatedir" store
134 (mlet* %store-monad
135 ((guile (set-guile-for-build (default-guile)))
136 (profile (profile-derivation (packages->manifest
137 (list %bootstrap-guile))
138 #:hooks '()
139 #:locales? #f))
140 (image (squashfs-image "squashfs-pack" profile
141 #:symlinks '(("/bin" -> "bin"))
142 #:localstatedir? #t))
143 (check (gexp->derivation
144 "check-tarball"
145 (with-imported-modules '((guix build utils))
146 #~(begin
147 (use-modules (guix build utils)
148 (ice-9 match))
149
150 (define bin
151 (string-append "." #$profile "/bin"))
152
153 (setenv "PATH"
154 (string-append #$squashfs-tools-next "/bin"))
155 (invoke "unsquashfs" #$image)
156 (with-directory-excursion "squashfs-root"
157 (when (and (file-exists? (string-append bin
158 "/guile"))
159 (file-exists? "var/guix/db/db.sqlite")
160 (string=? (string-append #$%bootstrap-guile "/bin")
161 (pk 'binlink (readlink bin)))
162 (string=? (string-append #$profile "/bin")
163 (pk 'guilelink (readlink "bin"))))
164 (mkdir #$output))))))))
129 (built-derivations (list check))))) 165 (built-derivations (list check)))))
130 166
131(test-end) 167(test-end)