From 13d5e8dae5f1282eac630dea428c5fe3dc073fb4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 8 Dec 2016 14:03:33 +0100 Subject: store: 'open-connection' no longer raises '&nar-error' for protocol errors. * guix/store.scm (open-connection): Guard body against 'nar-error?' and re-raise as '&nix-connection-error'. * tests/store.scm ("connection handshake error"): New test. --- tests/store.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/store.scm b/tests/store.scm index 38b8efce96..123ea8a787 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -48,6 +48,15 @@ (test-begin "store") +(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)))) + (open-connection #f #:port port) + 'broken))) + (test-equal "store-path-hash-part" "283gqy39v3g9dxjy26rynl0zls82fmcg" (store-path-hash-part -- cgit 1.4.1