summaryrefslogtreecommitdiff
path: root/tests/builders.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-13 22:06:45 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-13 22:06:45 +0100
commitad1ebab379dbd68e006197e8609c67de4734dbde (patch)
tree5e3caea6b72967fdfe4b1d823b28717c6f5a0719 /tests/builders.scm
parent5fb868033fd8620eb6339df33fac00df21027790 (diff)
tests: Skip network-dependent tests when the network is unreachable.
* tests/builders.scm (network-reachable?): New variable. ("url-fetch", "gnu-build"): Skip unless NETWORK-REACHABLE?. * tests/derivations.scm (%coreutils): Check for network access. ("build-expression->derivation with one input"): Skip when %COREUTILS is #f. * tests/guix-package.sh: Skip installation of GNU Make when the network is unreachable. * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/union.scm ("union-build"): Likewise.
Diffstat (limited to 'tests/builders.scm')
-rw-r--r--tests/builders.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index 12841d56902..6035032d5d0 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -50,9 +50,13 @@
50 (list name (package-derivation %store package)))) 50 (list name (package-derivation %store package))))
51 (@@ (distro packages base) %boot0-inputs)))) 51 (@@ (distro packages base) %boot0-inputs))))
52 52
53(define network-reachable?
54 (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)))
55
53 56
54(test-begin "builders") 57(test-begin "builders")
55 58
59(unless network-reachable? (test-skip 1))
56(test-assert "url-fetch" 60(test-assert "url-fetch"
57 (let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz" 61 (let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
58 "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")) 62 "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
@@ -69,6 +73,7 @@
69 (and (build-system? gnu-build-system) 73 (and (build-system? gnu-build-system)
70 (eq? gnu-build (build-system-builder gnu-build-system)))) 74 (eq? gnu-build (build-system-builder gnu-build-system))))
71 75
76(unless network-reachable? (test-skip 1))
72(test-assert "gnu-build" 77(test-assert "gnu-build"
73 (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") 78 (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
74 (hash (nix-base32-string->bytevector 79 (hash (nix-base32-string->bytevector