From c9e2b0b16e3efe319d437d9a96c8ce65ed145e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 27 Mar 2014 23:53:00 +0100 Subject: [PATCH] daemon: Add tests for substitutes and --no-substitutes. * tests/guix-daemon.sh: Add substituter tests. --- tests/guix-daemon.sh | 56 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh index 698516490b..a73c9e22e3 100644 --- a/tests/guix-daemon.sh +++ b/tests/guix-daemon.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012 Ludovic Courtès +# Copyright © 2012, 2014 Ludovic Courtès # # This file is part of GNU Guix. # @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon. +# Test the daemon and its interaction with 'guix substitute-binary'. # set -e @@ -25,5 +25,53 @@ set -e guix-daemon --version guix build --version -guix build -e '(@ (gnu packages bootstrap) %bootstrap-guile)' -guix build coreutils -n +drv="`guix build emacs -d`" +out="`guile -c ' \ + (use-modules (guix) (gnu packages emacs)) \ + (define store (open-connection)) \ + (display (derivation->output-path (package-derivation store emacs)))'`" + +hash_part="`basename $out | cut -c 1-32`" +narinfo="$hash_part.narinfo" +substitute_dir="`echo $GUIX_BINARY_SUBSTITUTE_URL | sed -'es,file://,,g'`" + +cat > "$substitute_dir/nix-cache-info"< "$substitute_dir/$narinfo"<