mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 03:51:53 +02:00
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.
This commit is contained in:
+2
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user