tests: Adjust 'add-file-tree-to-store' test for lack of /bin/sh.
authorLudovic Courtès <ludo@gnu.org>
Wed, 5 Sep 2018 11:58:07 +0000 (13:58 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 5 Sep 2018 11:59:10 +0000 (13:59 +0200)
* tests/store.scm (%shell): New variable.
("add-file-tree-to-store"): Use it instead of "/bin/sh".  This fixes
builds in the chroot build environment.

tests/store.scm

index 71ac575..2858369 100644 (file)
@@ -45,6 +45,9 @@
 (define %store
   (open-connection-for-tests))
 
+(define %shell
+  (or (getenv "SHELL") (getenv "CONFIG_SHELL")))
+
 \f
 (test-begin "store")
 
     ("./foo/c" directory #t)
     ("./foo/c/p" regular "file p")
     ("./foo/c/q" directory #t)
-    ("./foo/c/q/x" regular "#!/bin/sh\nexit 42")
+    ("./foo/c/q/x" regular
+     ,(string-append "#!" %shell "\nexit 42"))
     ("./foo/c/q/y" symlink "..")
     ("./foo/c/q/z" directory #t))
   (let* ((tree  `("file-tree" directory
                     ("p" regular (data ,(string->utf8 "file p")))
                     ("q" directory
                      ("x" executable
-                      (data "#!/bin/sh\nexit 42"))
+                      (data ,(string-append "#!" %shell "\nexit 42")))
                      ("y" symlink "..")
                      ("z" directory))))
                   ("bar" directory)))