derivations: Adjust tests for Stow environments.

Fixes <https://bugs.gnu.org/30250>.
Reported by Jorge <jorge+list@disroot.org>.

* tests/derivations.scm ("add-to-store, flat")
("add-to-store, recursive"): Call 'readlink*'.
This commit is contained in:
Ludovic Courtès 2018-01-30 21:33:34 +01:00
parent 129332ab20
commit 9d6fae65f3
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -96,7 +96,10 @@
(test-skip (if %store 0 12)) (test-skip (if %store 0 12))
(test-assert "add-to-store, flat" (test-assert "add-to-store, flat"
(let* ((file (search-path %load-path "language/tree-il/spec.scm")) ;; Use 'readlink*' in case spec.scm is a symlink, as is the case when Guile
;; was installed with Stow.
(let* ((file (readlink*
(search-path %load-path "language/tree-il/spec.scm")))
(drv (add-to-store %store "flat-test" #f "sha256" file))) (drv (add-to-store %store "flat-test" #f "sha256" file)))
(and (eq? 'regular (stat:type (stat drv))) (and (eq? 'regular (stat:type (stat drv)))
(valid-path? %store drv) (valid-path? %store drv)
@ -104,7 +107,9 @@
(call-with-input-file drv get-bytevector-all))))) (call-with-input-file drv get-bytevector-all)))))
(test-assert "add-to-store, recursive" (test-assert "add-to-store, recursive"
(let* ((dir (dirname (search-path %load-path "language/tree-il/spec.scm"))) (let* ((dir (dirname
(readlink* (search-path %load-path
"language/tree-il/spec.scm"))))
(drv (add-to-store %store "dir-tree-test" #t "sha256" dir))) (drv (add-to-store %store "dir-tree-test" #t "sha256" dir)))
(and (eq? 'directory (stat:type (stat drv))) (and (eq? 'directory (stat:type (stat drv)))
(valid-path? %store drv) (valid-path? %store drv)