[bug#33259,6/8] pack: Add test for 'self-contained-tarball' with localstatedir.

Message ID 20181104221036.4776-6-ludo@gnu.org
State Accepted
Commit 1ff53787dbd4b1846ae523aef86ada3996de5e6d
Headers show
Series 'guix pack': Better '--localstatedir' handling and more tests | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Ludovic Courtès Nov. 4, 2018, 10:10 p.m. UTC
* tests/pack.scm ("self-contained-tarball + localstatedir"): New test.
---
 tests/pack.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Danny Milosavljevic Nov. 6, 2018, 11:01 a.m. UTC | #1
LGTM!

Patch

diff --git a/tests/pack.scm b/tests/pack.scm
index 63fef70c64..22321a3e46 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -89,6 +89,29 @@ 
 ;; quite inexpensively; see <https://bugs.gnu.org/32184>.
 
 (with-external-store store
+  (unless store (test-skip 1))
+  (test-assertm "self-contained-tarball + localstatedir" store
+    (mlet* %store-monad
+        ((guile   (set-guile-for-build (default-guile)))
+         (profile (profile-derivation (packages->manifest
+                                       (list %bootstrap-guile))
+                                      #:hooks '()
+                                      #:locales? #f))
+         (tarball (self-contained-tarball "tar-pack" profile
+                                          #:localstatedir? #t))
+         (check   (gexp->derivation
+                   "check-tarball"
+                   #~(let ((bin (string-append "." #$profile "/bin")))
+                       (setenv "PATH"
+                               (string-append #$%tar-bootstrap "/bin"))
+                       (system* "tar" "xvf" #$tarball)
+                       (mkdir #$output)
+                       (exit
+                        (and (file-exists? "var/guix/db/db.sqlite")
+                             (string=? (string-append #$%bootstrap-guile "/bin")
+                                       (readlink bin))))))))
+      (built-derivations (list check))))
+
   (unless store (test-skip 1))
   (test-assertm "docker-image + localstatedir" store
     (mlet* %store-monad