diff options
| -rw-r--r-- | tests/builders.scm | 5 | ||||
| -rw-r--r-- | tests/derivations.scm | 6 | ||||
| -rw-r--r-- | tests/guix-package.sh | 46 | ||||
| -rw-r--r-- | tests/packages.scm | 2 | ||||
| -rw-r--r-- | tests/union.scm | 6 |
5 files changed, 41 insertions, 24 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 |
diff --git a/tests/derivations.scm b/tests/derivations.scm index 203bd9032f2..46bab4e19dd 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm | |||
| @@ -290,8 +290,9 @@ | |||
| 290 | 290 | ||
| 291 | (define %coreutils | 291 | (define %coreutils |
| 292 | (false-if-exception | 292 | (false-if-exception |
| 293 | (or (package-derivation %store %bootstrap-coreutils&co) | 293 | (and (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV) |
| 294 | (nixpkgs-derivation "coreutils")))) | 294 | (or (package-derivation %store %bootstrap-coreutils&co) |
| 295 | (nixpkgs-derivation "coreutils"))))) | ||
| 295 | 296 | ||
| 296 | (test-skip (if %coreutils 0 1)) | 297 | (test-skip (if %coreutils 0 1)) |
| 297 | 298 | ||
| @@ -385,6 +386,7 @@ | |||
| 385 | (and (equal? '(hello) (call-with-input-file one read)) | 386 | (and (equal? '(hello) (call-with-input-file one read)) |
| 386 | (equal? '(world) (call-with-input-file two read))))))) | 387 | (equal? '(world) (call-with-input-file two read))))))) |
| 387 | 388 | ||
| 389 | (test-skip (if %coreutils 0 1)) | ||
| 388 | (test-assert "build-expression->derivation with one input" | 390 | (test-assert "build-expression->derivation with one input" |
| 389 | (let* ((builder '(call-with-output-file %output | 391 | (let* ((builder '(call-with-output-file %output |
| 390 | (lambda (p) | 392 | (lambda (p) |
diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 2bc8c573eca..598ea62aaa1 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh | |||
| @@ -31,31 +31,35 @@ test -L "$profile" && test -L "$profile-1-link" | |||
| 31 | test -f "$profile/bin/guile" | 31 | test -f "$profile/bin/guile" |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | guix-package -b -p "$profile" \ | 34 | # Check whether we have network access. |
| 35 | -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'` | 35 | if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null |
| 36 | test -L "$profile-2-link" | 36 | then |
| 37 | test -f "$profile/bin/make" && test -f "$profile/bin/guile" | 37 | guix-package -b -p "$profile" \ |
| 38 | -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'` | ||
| 39 | test -L "$profile-2-link" | ||
| 40 | test -f "$profile/bin/make" && test -f "$profile/bin/guile" | ||
| 38 | 41 | ||
| 39 | 42 | ||
| 40 | # Check whether `--list-installed' works. | 43 | # Check whether `--list-installed' works. |
| 41 | # XXX: Change the tests when `--install' properly extracts the package | 44 | # XXX: Change the tests when `--install' properly extracts the package |
| 42 | # name and version string. | 45 | # name and version string. |
| 43 | installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`" | 46 | installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`" |
| 44 | case "x$installed" in | 47 | case "x$installed" in |
| 45 | "guile-bootstrap make-boot0") | 48 | "guile-bootstrap make-boot0") |
| 46 | true;; | 49 | true;; |
| 47 | "make-boot0 guile-bootstrap") | 50 | "make-boot0 guile-bootstrap") |
| 48 | true;; | 51 | true;; |
| 49 | "*") | 52 | "*") |
| 50 | false;; | 53 | false;; |
| 51 | esac | 54 | esac |
| 52 | 55 | ||
| 53 | test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" | 56 | test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" |
| 54 | 57 | ||
| 55 | # Remove a package. | 58 | # Remove a package. |
| 56 | guix-package -b -p "$profile" -r "guile-bootstrap-2.0" | 59 | guix-package -b -p "$profile" -r "guile-bootstrap-2.0" |
| 57 | test -L "$profile-3-link" | 60 | test -L "$profile-3-link" |
| 58 | test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" | 61 | test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" |
| 62 | fi | ||
| 59 | 63 | ||
| 60 | # Make sure the `:' syntax works. | 64 | # Make sure the `:' syntax works. |
| 61 | guix-package -b -i "libsigsegv:lib" -n | 65 | guix-package -b -i "libsigsegv:lib" -n |
diff --git a/tests/packages.scm b/tests/packages.scm index c89f6e7721d..5b0cd79b0fb 100644 --- a/tests/packages.scm +++ b/tests/packages.scm | |||
| @@ -125,6 +125,8 @@ | |||
| 125 | (let ((p (pk 'drv d (derivation-path->output-path d)))) | 125 | (let ((p (pk 'drv d (derivation-path->output-path d)))) |
| 126 | (eq? 'hello (call-with-input-file p read)))))) | 126 | (eq? 'hello (call-with-input-file p read)))))) |
| 127 | 127 | ||
| 128 | (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)) | ||
| 129 | (test-skip 1)) | ||
| 128 | (test-assert "GNU Make, bootstrap" | 130 | (test-assert "GNU Make, bootstrap" |
| 129 | ;; GNU Make is the first program built during bootstrap; we choose it | 131 | ;; GNU Make is the first program built during bootstrap; we choose it |
| 130 | ;; here so that the test doesn't last for too long. | 132 | ;; here so that the test doesn't last for too long. |
diff --git a/tests/union.scm b/tests/union.scm index 73b95c49b8a..c839855ef4c 100644 --- a/tests/union.scm +++ b/tests/union.scm | |||
| @@ -64,7 +64,11 @@ | |||
| 64 | (bin make) | 64 | (bin make) |
| 65 | (share (doc (make README)))))) | 65 | (share (doc (make README)))))) |
| 66 | 66 | ||
| 67 | (test-skip (if %store 0 1)) | 67 | (test-skip (if (and %store |
| 68 | (false-if-exception | ||
| 69 | (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))) | ||
| 70 | 0 | ||
| 71 | 1)) | ||
| 68 | 72 | ||
| 69 | (test-assert "union-build" | 73 | (test-assert "union-build" |
| 70 | (let* ((inputs (map (match-lambda | 74 | (let* ((inputs (map (match-lambda |
