summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-01-21 17:41:11 +0100
committerLudovic Courtès <ludo@gnu.org>2019-01-21 23:09:55 +0100
commitf9e8a12379c6fefc9e5c3c7fc3926599bbefc013 (patch)
tree471d175466beecb53c7e0c8398dc7a85a17fc0a5 /tests
parentde9fbe9cdcf5f8deb08becfc54b523084fd67bda (diff)
store: Rename '&nix-error' to '&store-error'.
* guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm42
-rw-r--r--tests/gexp.scm4
-rw-r--r--tests/guix-daemon.sh8
-rw-r--r--tests/packages.scm2
-rw-r--r--tests/store.scm46
5 files changed, 51 insertions, 51 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 5f294c18278..c0601c0e88d 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -185,9 +185,9 @@
185 (set-build-options %store 185 (set-build-options %store
186 #:use-substitutes? #f 186 #:use-substitutes? #f
187 #:keep-going? #t) 187 #:keep-going? #t)
188 (guard (c ((nix-protocol-error? c) 188 (guard (c ((store-protocol-error? c)
189 (and (= 100 (nix-protocol-error-status c)) 189 (and (= 100 (store-protocol-error-status c))
190 (string-contains (nix-protocol-error-message c) 190 (string-contains (store-protocol-error-message c)
191 (derivation-file-name d1)) 191 (derivation-file-name d1))
192 (not (valid-path? %store (derivation->output-path d1))) 192 (not (valid-path? %store (derivation->output-path d1)))
193 (valid-path? %store (derivation->output-path d2))))) 193 (valid-path? %store (derivation->output-path d2)))))
@@ -222,8 +222,8 @@
222 222
223(test-assert "unknown built-in builder" 223(test-assert "unknown built-in builder"
224 (let ((drv (derivation %store "ohoh" "builtin:does-not-exist" '()))) 224 (let ((drv (derivation %store "ohoh" "builtin:does-not-exist" '())))
225 (guard (c ((nix-protocol-error? c) 225 (guard (c ((store-protocol-error? c)
226 (string-contains (nix-protocol-error-message c) "failed"))) 226 (string-contains (store-protocol-error-message c) "failed")))
227 (build-derivations %store (list drv)) 227 (build-derivations %store (list drv))
228 #f))) 228 #f)))
229 229
@@ -253,8 +253,8 @@
253 . ,(object->string (%local-url)))) 253 . ,(object->string (%local-url))))
254 #:hash-algo 'sha256 254 #:hash-algo 'sha256
255 #:hash (sha256 (random-bytevector 100))))) ;wrong 255 #:hash (sha256 (random-bytevector 100))))) ;wrong
256 (guard (c ((nix-protocol-error? c) 256 (guard (c ((store-protocol-error? c)
257 (string-contains (nix-protocol-error-message c) "failed"))) 257 (string-contains (store-protocol-error-message c) "failed")))
258 (build-derivations %store (list drv)) 258 (build-derivations %store (list drv))
259 #f)))) 259 #f))))
260 260
@@ -268,8 +268,8 @@
268 . ,(object->string (%local-url)))) 268 . ,(object->string (%local-url))))
269 #:hash-algo 'sha256 269 #:hash-algo 'sha256
270 #:hash (sha256 (random-bytevector 100))))) 270 #:hash (sha256 (random-bytevector 100)))))
271 (guard (c ((nix-protocol-error? c) 271 (guard (c ((store-protocol-error? c)
272 (string-contains (nix-protocol-error-message (pk c)) "failed"))) 272 (string-contains (store-protocol-error-message (pk c)) "failed")))
273 (build-derivations %store (list drv)) 273 (build-derivations %store (list drv))
274 #f)))) 274 #f))))
275 275
@@ -279,8 +279,8 @@
279 (drv (derivation %store "world" 279 (drv (derivation %store "world"
280 "builtin:download" '() 280 "builtin:download" '()
281 #:env-vars `(("url" . ,(object->string url)))))) 281 #:env-vars `(("url" . ,(object->string url))))))
282 (guard (c ((nix-protocol-error? c) 282 (guard (c ((store-protocol-error? c)
283 (string-contains (nix-protocol-error-message c) "failed"))) 283 (string-contains (store-protocol-error-message c) "failed")))
284 (build-derivations %store (list drv)) 284 (build-derivations %store (list drv))
285 #f))) 285 #f)))
286 286
@@ -607,7 +607,7 @@
607 `("-c" ,(string-append "echo " txt "> $out")) 607 `("-c" ,(string-append "echo " txt "> $out"))
608 #:inputs `((,%bash) (,txt)) 608 #:inputs `((,%bash) (,txt))
609 #:allowed-references '()))) 609 #:allowed-references '())))
610 (guard (c ((nix-protocol-error? c) 610 (guard (c ((store-protocol-error? c)
611 ;; There's no specific error message to check for. 611 ;; There's no specific error message to check for.
612 #t)) 612 #t))
613 (build-derivations %store (list drv)) 613 (build-derivations %store (list drv))
@@ -625,7 +625,7 @@
625 `("-c" ,"echo $out > $out") 625 `("-c" ,"echo $out > $out")
626 #:inputs `((,%bash)) 626 #:inputs `((,%bash))
627 #:allowed-references '()))) 627 #:allowed-references '())))
628 (guard (c ((nix-protocol-error? c) 628 (guard (c ((store-protocol-error? c)
629 ;; There's no specific error message to check for. 629 ;; There's no specific error message to check for.
630 #t)) 630 #t))
631 (build-derivations %store (list drv)) 631 (build-derivations %store (list drv))
@@ -644,7 +644,7 @@
644 `("-c" ,(string-append "echo " txt "> $out")) 644 `("-c" ,(string-append "echo " txt "> $out"))
645 #:inputs `((,%bash) (,txt)) 645 #:inputs `((,%bash) (,txt))
646 #:disallowed-references (list txt)))) 646 #:disallowed-references (list txt))))
647 (guard (c ((nix-protocol-error? c) 647 (guard (c ((store-protocol-error? c)
648 ;; There's no specific error message to check for. 648 ;; There's no specific error message to check for.
649 #t)) 649 #t))
650 (build-derivations %store (list drv)) 650 (build-derivations %store (list drv))
@@ -765,8 +765,8 @@
765 (builder '(begin (sleep 100) (mkdir %output) #t)) 765 (builder '(begin (sleep 100) (mkdir %output) #t))
766 (drv (build-expression->derivation store "silent" builder)) 766 (drv (build-expression->derivation store "silent" builder))
767 (out-path (derivation->output-path drv))) 767 (out-path (derivation->output-path drv)))
768 (guard (c ((nix-protocol-error? c) 768 (guard (c ((store-protocol-error? c)
769 (and (string-contains (nix-protocol-error-message c) 769 (and (string-contains (store-protocol-error-message c)
770 "failed") 770 "failed")
771 (not (valid-path? store out-path))))) 771 (not (valid-path? store out-path)))))
772 (build-derivations store (list drv)) 772 (build-derivations store (list drv))
@@ -779,8 +779,8 @@
779 (builder '(begin (sleep 100) (mkdir %output) #t)) 779 (builder '(begin (sleep 100) (mkdir %output) #t))
780 (drv (build-expression->derivation store "slow" builder)) 780 (drv (build-expression->derivation store "slow" builder))
781 (out-path (derivation->output-path drv))) 781 (out-path (derivation->output-path drv)))
782 (guard (c ((nix-protocol-error? c) 782 (guard (c ((store-protocol-error? c)
783 (and (string-contains (nix-protocol-error-message c) 783 (and (string-contains (store-protocol-error-message c)
784 "failed") 784 "failed")
785 (not (valid-path? store out-path))))) 785 (not (valid-path? store out-path)))))
786 (build-derivations store (list drv)) 786 (build-derivations store (list drv))
@@ -942,11 +942,11 @@
942 #f)) ; fail! 942 #f)) ; fail!
943 (drv (build-expression->derivation %store "fail" builder)) 943 (drv (build-expression->derivation %store "fail" builder))
944 (out-path (derivation->output-path drv))) 944 (out-path (derivation->output-path drv)))
945 (guard (c ((nix-protocol-error? c) 945 (guard (c ((store-protocol-error? c)
946 ;; Note that the output path may exist at this point, but it 946 ;; Note that the output path may exist at this point, but it
947 ;; is invalid. 947 ;; is invalid.
948 (and (string-match "build .* failed" 948 (and (string-match "build .* failed"
949 (nix-protocol-error-message c)) 949 (store-protocol-error-message c))
950 (not (valid-path? %store out-path))))) 950 (not (valid-path? %store out-path)))))
951 (build-derivations %store (list drv)) 951 (build-derivations %store (list drv))
952 #f))) 952 #f)))
diff --git a/tests/gexp.scm b/tests/gexp.scm
index c4b437cd498..cee2c966102 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -919,7 +919,7 @@
919 (chdir #$output) 919 (chdir #$output)
920 (symlink #$%bootstrap-guile "guile")) 920 (symlink #$%bootstrap-guile "guile"))
921 #:allowed-references '())))) 921 #:allowed-references '()))))
922 (guard (c ((nix-protocol-error? c) #t)) 922 (guard (c ((store-protocol-error? c) #t))
923 (build-derivations %store (list drv)) 923 (build-derivations %store (list drv))
924 #f))) 924 #f)))
925 925
@@ -943,7 +943,7 @@
943 (chdir #$output) 943 (chdir #$output)
944 (symlink #$%bootstrap-guile "guile")) 944 (symlink #$%bootstrap-guile "guile"))
945 #:disallowed-references (list %bootstrap-guile))))) 945 #:disallowed-references (list %bootstrap-guile)))))
946 (guard (c ((nix-protocol-error? c) #t)) 946 (guard (c ((store-protocol-error? c) #t))
947 (build-derivations %store (list drv)) 947 (build-derivations %store (list drv))
948 #f))) 948 #f)))
949 949
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index 9ae6e0b77a6..4c19a55722f 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -1,5 +1,5 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> 2# Copyright © 2012, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
3# 3#
4# This file is part of GNU Guix. 4# This file is part of GNU Guix.
5# 5#
@@ -109,7 +109,7 @@ guile -c "
109 109
110 (define (build-without-failing drv) 110 (define (build-without-failing drv)
111 (lambda (store) 111 (lambda (store)
112 (guard (c ((nix-protocol-error? c) (values #t store))) 112 (guard (c ((store-protocol-error? c) (values #t store)))
113 (build-derivations store (list drv)) 113 (build-derivations store (list drv))
114 (values #f store)))) 114 (values #f store))))
115 115
@@ -177,9 +177,9 @@ client_code='
177 `("-e" ,build) 177 `("-e" ,build)
178 #:inputs `((,bash) (,build)) 178 #:inputs `((,bash) (,build))
179 #:env-vars `(("x" . ,(random-text)))))) 179 #:env-vars `(("x" . ,(random-text))))))
180 (exit (guard (c ((nix-protocol-error? c) 180 (exit (guard (c ((store-protocol-error? c)
181 (->bool 181 (->bool
182 (string-contains (pk (nix-protocol-error-message c)) 182 (string-contains (pk (store-protocol-error-message c))
183 "failed")))) 183 "failed"))))
184 (build-derivations store (list drv)) 184 (build-derivations store (list drv))
185 #f))))' 185 #f))))'
diff --git a/tests/packages.scm b/tests/packages.scm
index ed635d90116..29e5e4103cb 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -570,7 +570,7 @@
570 (symlink %output (string-append %output "/self")) 570 (symlink %output (string-append %output "/self"))
571 #t))))) 571 #t)))))
572 (d (package-derivation %store p))) 572 (d (package-derivation %store p)))
573 (guard (c ((nix-protocol-error? c) #t)) 573 (guard (c ((store-protocol-error? c) #t))
574 (build-derivations %store (list d)) 574 (build-derivations %store (list d))
575 #f))) 575 #f)))
576 576
diff --git a/tests/store.scm b/tests/store.scm
index 5ff9308d7d6..e28c0c5aaa6 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -63,9 +63,9 @@
63(test-equal "connection handshake error" 63(test-equal "connection handshake error"
64 EPROTO 64 EPROTO
65 (let ((port (%make-void-port "rw"))) 65 (let ((port (%make-void-port "rw")))
66 (guard (c ((nix-connection-error? c) 66 (guard (c ((store-connection-error? c)
67 (and (eq? port (nix-connection-error-file c)) 67 (and (eq? port (store-connection-error-file c))
68 (nix-connection-error-code c)))) 68 (store-connection-error-code c))))
69 (open-connection #f #:port port) 69 (open-connection #f #:port port)
70 'broken))) 70 'broken)))
71 71
@@ -120,7 +120,7 @@
120 120
121(test-assert "valid-path? error" 121(test-assert "valid-path? error"
122 (with-store s 122 (with-store s
123 (guard (c ((nix-protocol-error? c) #t)) 123 (guard (c ((store-protocol-error? c) #t))
124 (valid-path? s "foo") 124 (valid-path? s "foo")
125 #f))) 125 #f)))
126 126
@@ -133,7 +133,7 @@
133 (with-store s 133 (with-store s
134 (let-syntax ((true-if-error (syntax-rules () 134 (let-syntax ((true-if-error (syntax-rules ()
135 ((_ exp) 135 ((_ exp)
136 (guard (c ((nix-protocol-error? c) #t)) 136 (guard (c ((store-protocol-error? c) #t))
137 exp #f))))) 137 exp #f)))))
138 (and (true-if-error (valid-path? s "foo")) 138 (and (true-if-error (valid-path? s "foo"))
139 (true-if-error (valid-path? s "bar")) 139 (true-if-error (valid-path? s "bar"))
@@ -274,7 +274,7 @@
274(test-assert "references/substitutes missing reference info" 274(test-assert "references/substitutes missing reference info"
275 (with-store s 275 (with-store s
276 (set-build-options s #:use-substitutes? #f) 276 (set-build-options s #:use-substitutes? #f)
277 (guard (c ((nix-protocol-error? c) #t)) 277 (guard (c ((store-protocol-error? c) #t))
278 (let* ((b (add-to-store s "bash" #t "sha256" 278 (let* ((b (add-to-store s "bash" #t "sha256"
279 (search-bootstrap-binary "bash" 279 (search-bootstrap-binary "bash"
280 (%current-system)))) 280 (%current-system))))
@@ -422,7 +422,7 @@
422 %store "foo" `(display ,s) 422 %store "foo" `(display ,s)
423 #:guile-for-build 423 #:guile-for-build
424 (package-derivation s %bootstrap-guile (%current-system))))) 424 (package-derivation s %bootstrap-guile (%current-system)))))
425 (guard (c ((nix-protocol-error? c) #t)) 425 (guard (c ((store-protocol-error? c) #t))
426 (build-derivations %store (list d)))))))) 426 (build-derivations %store (list d))))))))
427 "Here’s a Greek letter: λ.")) 427 "Here’s a Greek letter: λ."))
428 428
@@ -442,7 +442,7 @@
442 (display "lambda: λ\n")) 442 (display "lambda: λ\n"))
443 #:guile-for-build 443 #:guile-for-build
444 (package-derivation %store %bootstrap-guile)))) 444 (package-derivation %store %bootstrap-guile))))
445 (guard (c ((nix-protocol-error? c) #t)) 445 (guard (c ((store-protocol-error? c) #t))
446 (build-derivations %store (list d)))))))) 446 (build-derivations %store (list d))))))))
447 "garbage: �lambda: λ")) 447 "garbage: �lambda: λ"))
448 448
@@ -620,12 +620,12 @@
620 #:fallback? #f 620 #:fallback? #f
621 #:substitute-urls (%test-substitute-urls)) 621 #:substitute-urls (%test-substitute-urls))
622 (and (has-substitutes? s o) 622 (and (has-substitutes? s o)
623 (guard (c ((nix-protocol-error? c) 623 (guard (c ((store-protocol-error? c)
624 ;; XXX: the daemon writes "hash mismatch in downloaded 624 ;; XXX: the daemon writes "hash mismatch in downloaded
625 ;; path", but the actual error returned to the client 625 ;; path", but the actual error returned to the client
626 ;; doesn't mention that. 626 ;; doesn't mention that.
627 (pk 'corrupt c) 627 (pk 'corrupt c)
628 (not (zero? (nix-protocol-error-status c))))) 628 (not (zero? (store-protocol-error-status c)))))
629 (build-derivations s (list d)) 629 (build-derivations s (list d))
630 #f)))))) 630 #f))))))
631 631
@@ -646,7 +646,7 @@
646 (set-build-options s #:use-substitutes? #t 646 (set-build-options s #:use-substitutes? #t
647 #:substitute-urls (%test-substitute-urls)) 647 #:substitute-urls (%test-substitute-urls))
648 (and (has-substitutes? s o) 648 (and (has-substitutes? s o)
649 (guard (c ((nix-protocol-error? c) 649 (guard (c ((store-protocol-error? c)
650 ;; The substituter failed as expected. Now make 650 ;; The substituter failed as expected. Now make
651 ;; sure that #:fallback? #t works correctly. 651 ;; sure that #:fallback? #t works correctly.
652 (set-build-options s 652 (set-build-options s
@@ -712,9 +712,9 @@
712 (dump (call-with-bytevector-output-port 712 (dump (call-with-bytevector-output-port
713 (cute export-paths %store (list file2) <>)))) 713 (cute export-paths %store (list file2) <>))))
714 (delete-paths %store (list file0 file1 file2)) 714 (delete-paths %store (list file0 file1 file2))
715 (guard (c ((nix-protocol-error? c) 715 (guard (c ((store-protocol-error? c)
716 (and (not (zero? (nix-protocol-error-status c))) 716 (and (not (zero? (store-protocol-error-status c)))
717 (string-contains (nix-protocol-error-message c) 717 (string-contains (store-protocol-error-message c)
718 "not valid")))) 718 "not valid"))))
719 ;; Here we get an exception because DUMP does not include FILE0 and 719 ;; Here we get an exception because DUMP does not include FILE0 and
720 ;; FILE1, which are dependencies of FILE2. 720 ;; FILE1, which are dependencies of FILE2.
@@ -816,10 +816,10 @@
816 (bytevector-u8-set! dump index (logxor #xff byte))) 816 (bytevector-u8-set! dump index (logxor #xff byte)))
817 817
818 (and (not (file-exists? file)) 818 (and (not (file-exists? file))
819 (guard (c ((nix-protocol-error? c) 819 (guard (c ((store-protocol-error? c)
820 (pk 'c c) 820 (pk 'c c)
821 (and (not (zero? (nix-protocol-error-status c))) 821 (and (not (zero? (store-protocol-error-status c)))
822 (string-contains (nix-protocol-error-message c) 822 (string-contains (store-protocol-error-message c)
823 "corrupt")))) 823 "corrupt"))))
824 (let* ((source (open-bytevector-input-port dump)) 824 (let* ((source (open-bytevector-input-port dump))
825 (imported (import-paths %store source))) 825 (imported (import-paths %store source)))
@@ -906,10 +906,10 @@
906 (begin 906 (begin
907 (write (random-text) entropy-port) 907 (write (random-text) entropy-port)
908 (force-output entropy-port) 908 (force-output entropy-port)
909 (guard (c ((nix-protocol-error? c) 909 (guard (c ((store-protocol-error? c)
910 (pk 'determinism-exception c) 910 (pk 'determinism-exception c)
911 (and (not (zero? (nix-protocol-error-status c))) 911 (and (not (zero? (store-protocol-error-status c)))
912 (string-contains (nix-protocol-error-message c) 912 (string-contains (store-protocol-error-message c)
913 "deterministic")))) 913 "deterministic"))))
914 ;; This one will produce a different result. Since we're in 914 ;; This one will produce a different result. Since we're in
915 ;; 'check' mode, this must fail. 915 ;; 'check' mode, this must fail.
@@ -945,10 +945,10 @@
945 #:guile-for-build 945 #:guile-for-build
946 (package-derivation store %bootstrap-guile (%current-system)))) 946 (package-derivation store %bootstrap-guile (%current-system))))
947 (file (derivation->output-path drv))) 947 (file (derivation->output-path drv)))
948 (guard (c ((nix-protocol-error? c) 948 (guard (c ((store-protocol-error? c)
949 (pk 'multiple-build c) 949 (pk 'multiple-build c)
950 (and (not (zero? (nix-protocol-error-status c))) 950 (and (not (zero? (store-protocol-error-status c)))
951 (string-contains (nix-protocol-error-message c) 951 (string-contains (store-protocol-error-message c)
952 "deterministic")))) 952 "deterministic"))))
953 ;; This one will produce a different result on the second run. 953 ;; This one will produce a different result on the second run.
954 (current-build-output-port (current-error-port)) 954 (current-build-output-port (current-error-port))