store: Rename '&nix-error' to '&store-error'.
[jackhill/guix/guix.git] / tests / store.scm
index 5ff9308..e28c0c5 100644 (file)
@@ -63,9 +63,9 @@
 (test-equal "connection handshake error"
   EPROTO
   (let ((port (%make-void-port "rw")))
-    (guard (c ((nix-connection-error? c)
-               (and (eq? port (nix-connection-error-file c))
-                    (nix-connection-error-code c))))
+    (guard (c ((store-connection-error? c)
+               (and (eq? port (store-connection-error-file c))
+                    (store-connection-error-code c))))
       (open-connection #f #:port port)
       'broken)))
 
 
 (test-assert "valid-path? error"
   (with-store s
-    (guard (c ((nix-protocol-error? c) #t))
+    (guard (c ((store-protocol-error? c) #t))
       (valid-path? s "foo")
       #f)))
 
   (with-store s
     (let-syntax ((true-if-error (syntax-rules ()
                                   ((_ exp)
-                                   (guard (c ((nix-protocol-error? c) #t))
+                                   (guard (c ((store-protocol-error? c) #t))
                                      exp #f)))))
       (and (true-if-error (valid-path? s "foo"))
            (true-if-error (valid-path? s "bar"))
 (test-assert "references/substitutes missing reference info"
   (with-store s
     (set-build-options s #:use-substitutes? #f)
-    (guard (c ((nix-protocol-error? c) #t))
+    (guard (c ((store-protocol-error? c) #t))
       (let* ((b  (add-to-store s "bash" #t "sha256"
                                (search-bootstrap-binary "bash"
                                                         (%current-system))))
                      %store "foo" `(display ,s)
                      #:guile-for-build
                      (package-derivation s %bootstrap-guile (%current-system)))))
-            (guard (c ((nix-protocol-error? c) #t))
+            (guard (c ((store-protocol-error? c) #t))
               (build-derivations %store (list d))))))))
    "Here’s a Greek letter: λ."))
 
                        (display "lambda: λ\n"))
                      #:guile-for-build
                      (package-derivation %store %bootstrap-guile))))
-            (guard (c ((nix-protocol-error? c) #t))
+            (guard (c ((store-protocol-error? c) #t))
               (build-derivations %store (list d))))))))
    "garbage: �lambda: λ"))
 
                            #:fallback? #f
                            #:substitute-urls (%test-substitute-urls))
         (and (has-substitutes? s o)
-             (guard (c ((nix-protocol-error? c)
+             (guard (c ((store-protocol-error? c)
                         ;; XXX: the daemon writes "hash mismatch in downloaded
                         ;; path", but the actual error returned to the client
                         ;; doesn't mention that.
                         (pk 'corrupt c)
-                        (not (zero? (nix-protocol-error-status c)))))
+                        (not (zero? (store-protocol-error-status c)))))
                (build-derivations s (list d))
                #f))))))
 
         (set-build-options s #:use-substitutes? #t
                            #:substitute-urls (%test-substitute-urls))
         (and (has-substitutes? s o)
-             (guard (c ((nix-protocol-error? c)
+             (guard (c ((store-protocol-error? c)
                         ;; The substituter failed as expected.  Now make
                         ;; sure that #:fallback? #t works correctly.
                         (set-build-options s
          (dump  (call-with-bytevector-output-port
                  (cute export-paths %store (list file2) <>))))
     (delete-paths %store (list file0 file1 file2))
-    (guard (c ((nix-protocol-error? c)
-               (and (not (zero? (nix-protocol-error-status c)))
-                    (string-contains (nix-protocol-error-message c)
+    (guard (c ((store-protocol-error? c)
+               (and (not (zero? (store-protocol-error-status c)))
+                    (string-contains (store-protocol-error-message c)
                                      "not valid"))))
       ;; Here we get an exception because DUMP does not include FILE0 and
       ;; FILE1, which are dependencies of FILE2.
       (bytevector-u8-set! dump index (logxor #xff byte)))
 
     (and (not (file-exists? file))
-         (guard (c ((nix-protocol-error? c)
+         (guard (c ((store-protocol-error? c)
                     (pk 'c c)
-                    (and (not (zero? (nix-protocol-error-status c)))
-                         (string-contains (nix-protocol-error-message c)
+                    (and (not (zero? (store-protocol-error-status c)))
+                         (string-contains (store-protocol-error-message c)
                                           "corrupt"))))
            (let* ((source   (open-bytevector-input-port dump))
                   (imported (import-paths %store source)))
               (begin
                 (write (random-text) entropy-port)
                 (force-output entropy-port)
-                (guard (c ((nix-protocol-error? c)
+                (guard (c ((store-protocol-error? c)
                            (pk 'determinism-exception c)
-                           (and (not (zero? (nix-protocol-error-status c)))
-                                (string-contains (nix-protocol-error-message c)
+                           (and (not (zero? (store-protocol-error-status c)))
+                                (string-contains (store-protocol-error-message c)
                                                  "deterministic"))))
                   ;; This one will produce a different result.  Since we're in
                   ;; 'check' mode, this must fail.
                      #:guile-for-build
                      (package-derivation store %bootstrap-guile (%current-system))))
               (file (derivation->output-path drv)))
-         (guard (c ((nix-protocol-error? c)
+         (guard (c ((store-protocol-error? c)
                     (pk 'multiple-build c)
-                    (and (not (zero? (nix-protocol-error-status c)))
-                         (string-contains (nix-protocol-error-message c)
+                    (and (not (zero? (store-protocol-error-status c)))
+                         (string-contains (store-protocol-error-message c)
                                           "deterministic"))))
            ;; This one will produce a different result on the second run.
            (current-build-output-port (current-error-port))