;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Nikita Karetnikov ;;; Copyright © 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-substitute) #:use-module (guix scripts substitute) #:use-module (guix base64) #:use-module (guix hash) #:use-module (guix serialization)
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimoun <zimon.toutoune@gmail.com>2022-11-17 03:50:33 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-11-24 12:32:06 +0100
commitffd5e53e8729702c6db237817df1a2c7da24c20b (patch)
tree8fabd61a8ee83e0f9dd2c65bb4836d540f696dc2 /gnu/packages
parentefc663040bc6a8eadc7856713aa306afaf04488e (diff)
downloadguix-ffd5e53e8729702c6db237817df1a2c7da24c20b.tar.gz
guix-ffd5e53e8729702c6db237817df1a2c7da24c20b.zip
gnu: r-biodb: Update to 1.6.0.
* gnu/packages/bioconductor.scm (r-biodb): Update to 1.6.0.
Diffstat (limited to 'gnu/packages')
"StoreDir: ~a\nWantMassQuery: 0\n" (%store-prefix)))) (call-with-output-file (string-append narinfo-directory "/" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ".narinfo") (cut display narinfo <>)) ;; Prepare the nar. (call-with-output-file (string-append narinfo-directory "/example.out") (cut display "Substitutable data." <>)) (call-with-output-file (string-append narinfo-directory "/example.nar") (cute write-file (string-append narinfo-directory "/example.out") <>)) (set! (@@ (guix scripts substitute) %allow-unauthenticated-substitutes?) #f)) thunk (lambda () (delete-file-recursively cache-directory))))) (define-syntax-rule (with-narinfo narinfo body ...) (call-with-narinfo narinfo (lambda () body ...))) ;; Transmit these options to 'guix substitute'. (set! (@@ (guix scripts substitute) %cache-urls) (list (getenv "GUIX_BINARY_SUBSTITUTE_URL"))) (test-equal "query narinfo without signature" "" ; not substitutable (with-narinfo %narinfo (string-trim-both (with-output-to-string (lambda () (with-input-from-string (string-append "have " (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") (lambda () (guix-substitute "--query")))))))) (test-equal "query narinfo with invalid hash" ;; The hash in the signature differs from the hash of %NARINFO. "" (with-narinfo (string-append %narinfo "Signature: " (signature-field "different body") "\n") (string-trim-both (with-output-to-string (lambda () (with-input-from-string (string-append "have " (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") (lambda () (guix-substitute "--query")))))))) (test-equal "query narinfo signed with authorized key" (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") (with-narinfo (string-append %narinfo "Signature: " (signature-field %narinfo) "\n") (string-trim-both (with-output-to-string (lambda () (with-input-from-string (string-append "have " (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") (lambda () (guix-substitute "--query")))))))) (test-equal "query narinfo signed with unauthorized key" "" ; not substitutable (with-narinfo (string-append %narinfo "Signature: " (signature-field %narinfo #:public-key %wrong-public-key) "\n") (string-trim-both (with-output-to-string (lambda () (with-input-from-string (string-append "have " (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") (lambda () (guix-substitute "--query")))))))) (test-quit "substitute, no signature" "lacks a signature" (with-narinfo %narinfo (guix-substitute "--substitute" (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") "foo"))) (test-quit "substitute, invalid hash" "hash" ;; The hash in the signature differs from the hash of %NARINFO. (with-narinfo (string-append %narinfo "Signature: " (signature-field "different body") "\n") (guix-substitute "--substitute" (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") "foo"))) (test-quit "substitute, unauthorized key" "unauthorized" (with-narinfo (string-append %narinfo "Signature: " (signature-field %narinfo #:public-key %wrong-public-key) "\n") (guix-substitute "--substitute" (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") "foo"))) (test-equal "substitute, authorized key" "Substitutable data." (with-narinfo (string-append %narinfo "Signature: " (signature-field %narinfo)) (dynamic-wind (const #t) (lambda () (guix-substitute "--substitute" (string-append (%store-prefix) "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") "substitute-retrieved") (call-with-input-file "substitute-retrieved" get-string-all)) (lambda () (false-if-exception (delete-file "substitute-retrieved")))))) (test-end "substitute") (exit (= (test-runner-fail-count (test-runner-current)) 0)) ;;; Local Variables: ;;; eval: (put 'with-narinfo 'scheme-indent-function 1) ;;; eval: (put 'test-quit 'scheme-indent-function 2) ;;; End: