From ad1ebab379dbd68e006197e8609c67de4734dbde Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 13 Dec 2012 22:06:45 +0100 Subject: 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. --- tests/guix-package.sh | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'tests/guix-package.sh') diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 2bc8c573ec..598ea62aaa 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -31,31 +31,35 @@ test -L "$profile" && test -L "$profile-1-link" test -f "$profile/bin/guile" -guix-package -b -p "$profile" \ - -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'` -test -L "$profile-2-link" -test -f "$profile/bin/make" && test -f "$profile/bin/guile" +# Check whether we have network access. +if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null +then + guix-package -b -p "$profile" \ + -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'` + test -L "$profile-2-link" + test -f "$profile/bin/make" && test -f "$profile/bin/guile" -# Check whether `--list-installed' works. -# XXX: Change the tests when `--install' properly extracts the package -# name and version string. -installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`" -case "x$installed" in - "guile-bootstrap make-boot0") - true;; - "make-boot0 guile-bootstrap") - true;; - "*") - false;; -esac + # Check whether `--list-installed' works. + # XXX: Change the tests when `--install' properly extracts the package + # name and version string. + installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`" + case "x$installed" in + "guile-bootstrap make-boot0") + true;; + "make-boot0 guile-bootstrap") + true;; + "*") + false;; + esac -test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" + test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" -# Remove a package. -guix-package -b -p "$profile" -r "guile-bootstrap-2.0" -test -L "$profile-3-link" -test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" + # Remove a package. + guix-package -b -p "$profile" -r "guile-bootstrap-2.0" + test -L "$profile-3-link" + test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" +fi # Make sure the `:' syntax works. guix-package -b -i "libsigsegv:lib" -n -- cgit v1.2.3