aboutsummaryrefslogtreecommitdiff
path: root/tests/builders.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-23 23:41:26 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-24 00:01:34 +0100
commit12d720fd1a9c43019f2d5afa051b45c7633b3ab0 (patch)
treeb79f77aadfa44872d5c5aaf69ca99d6756f57c92 /tests/builders.scm
parent49685cae2bbe0384d4e0e46d38e9d0e1327e5225 (diff)
downloadguix-12d720fd1a9c43019f2d5afa051b45c7633b3ab0.tar
guix-12d720fd1a9c43019f2d5afa051b45c7633b3ab0.tar.gz
tests: Factorize the network reachability test.
* guix/tests.scm (network-reachable?): New procedure. * tests/builders.scm (network-reachable?): Remove. Replace references to it with calls to the new 'network-reachable?' procedure. * tests/derivations.scm (%coreutils): Use 'network-reachable?' instead of 'getaddrinfo'. * tests/packages.scm: Likewise. * tests/union.scm: Likewise.
Diffstat (limited to 'tests/builders.scm')
-rw-r--r--tests/builders.scm7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index e5acc3e038..3c2a3edc8e 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -56,16 +56,13 @@
(package-native-search-paths package)))
(@@ (gnu packages commencement) %boot0-inputs)))
-(define network-reachable?
- (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)))
-
(define url-fetch*
(store-lower url-fetch))
(test-begin "builders")
-(unless network-reachable? (test-skip 1))
+(unless (network-reachable?) (test-skip 1))
(test-assert "url-fetch"
(let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
"ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
@@ -97,7 +94,7 @@
(test-assert "gnu-build-system"
(build-system? gnu-build-system))
-(unless network-reachable? (test-skip 1))
+(unless (network-reachable?) (test-skip 1))
(test-assert "gnu-build"
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(hash (nix-base32-string->bytevector