summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-08-26 15:34:29 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-08-26 15:34:29 +0200
commit4028fd395e6d7f80f7bbeb4ff616b6b89b0bf654 (patch)
tree17bac0c3211a872d3a0292cae20347718ecdd5f7 /tests
parent9d1cc6bc69d53bf8ad45ac94bc3c268125f86359 (diff)
parent72e2815d18ad688b0a16ce3b3efba1172423cec4 (diff)
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm8
-rw-r--r--tests/grafts.scm34
-rw-r--r--tests/guix-download.sh5
-rw-r--r--tests/system.scm4
4 files changed, 47 insertions, 4 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index cf88a9db80..5873abdd41 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -355,6 +355,14 @@
(equal? (gexp->sexp* exp) ;native
(gexp->sexp* exp "mips64el-linux")))))
+(test-assert "gexp list splicing + ungexp-splicing"
+ (let* ((inner (gexp (ungexp-native glibc)))
+ (exp (gexp (list (ungexp-splicing (list inner))))))
+ (and (equal? `((,glibc "out")) (gexp-native-inputs exp))
+ (null? (gexp-inputs exp))
+ (equal? (gexp->sexp* exp) ;native
+ (gexp->sexp* exp "mips64el-linux")))))
+
(test-equal "output list"
2
(let ((exp (gexp (begin (mkdir (ungexp output))
diff --git a/tests/grafts.scm b/tests/grafts.scm
index 08f05c0f75..abb074d628 100644
--- a/tests/grafts.scm
+++ b/tests/grafts.scm
@@ -28,7 +28,9 @@
#:use-module (gnu packages bootstrap)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-64)
- #:use-module (rnrs io ports))
+ #:use-module (rnrs bytevectors)
+ #:use-module (rnrs io ports)
+ #:use-module (ice-9 vlist))
(define %store
(open-connection-for-tests))
@@ -442,4 +444,34 @@
(and (file-exists? (string-append out "/p2/replacement"))
(file-exists? (string-append out "/p2/p1/replacement")))))))
+(define buffer-size
+ ;; Must be equal to REQUEST-SIZE in 'replace-store-references'.
+ (expt 2 20))
+
+(test-equal "replace-store-references, <http://bugs.gnu.org/28212>"
+ (string-append (make-string (- buffer-size 47) #\a)
+ "/gnu/store/" (make-string 32 #\8)
+ "-SoMeTHiNG"
+ (list->string (map integer->char (iota 77 33))))
+
+ ;; Create input data where the right-hand-size of the dash ("-something"
+ ;; here) goes beyond the end of the internal buffer of
+ ;; 'replace-store-references'.
+ (let* ((content (string-append (make-string (- buffer-size 47) #\a)
+ "/gnu/store/" (make-string 32 #\7)
+ "-something"
+ (list->string
+ (map integer->char (iota 77 33)))))
+ (replacement (alist->vhash
+ `((,(make-string 32 #\7)
+ . ,(string->utf8 (string-append
+ (make-string 32 #\8)
+ "-SoMeTHiNG")))))))
+ (call-with-output-string
+ (lambda (output)
+ ((@@ (guix build graft) replace-store-references)
+ (open-input-string content) output
+ replacement
+ "/gnu/store")))))
+
(test-end)
diff --git a/tests/guix-download.sh b/tests/guix-download.sh
index ebc853c7fa..30f55fbe2b 100644
--- a/tests/guix-download.sh
+++ b/tests/guix-download.sh
@@ -29,12 +29,15 @@ then false; else true; fi
if guix download unknown://some/where;
then false; else true; fi
-if guix download not/a/uri;
+if guix download /does-not-exist
then false; else true; fi
# This one should succeed.
guix download "file://$abs_top_srcdir/README"
+# And this one, without the URI scheme.
+guix download "$abs_top_srcdir/README"
+
# This one too, even if it cannot talk to the daemon.
output="t-download-$$"
trap 'rm -f "$output"' EXIT
diff --git a/tests/system.scm b/tests/system.scm
index ca34409be9..a661544a5f 100644
--- a/tests/system.scm
+++ b/tests/system.scm
@@ -36,7 +36,7 @@
(host-name "komputilo")
(timezone "Europe/Berlin")
(locale "en_US.utf8")
- (bootloader (grub-configuration (device "/dev/sdX")))
+ (bootloader (grub-configuration (target "/dev/sdX")))
(file-systems (cons %root-fs %base-file-systems))
(users %base-user-accounts)))
@@ -51,7 +51,7 @@
(host-name "komputilo")
(timezone "Europe/Berlin")
(locale "en_US.utf8")
- (bootloader (grub-configuration (device "/dev/sdX")))
+ (bootloader (grub-configuration (target "/dev/sdX")))
(mapped-devices (list %luks-device))
(file-systems (cons (file-system
(inherit %root-fs)