summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2016-07-28 11:08:55 +0200
committerAndreas Enge <andreas@enge.fr>2016-07-28 11:08:55 +0200
commite309c7561043361afe63cc9435e620323f870a61 (patch)
treecd6fe073ba840bb68f446933ece44b45d8eb5ec7 /tests
parent1bb163b0dd07c8f2cfd7e91f1e428075cd3d5ed2 (diff)
parente335b82c4eba13fe873db2d680d399469931c10f (diff)
downloadguix-e309c7561043361afe63cc9435e620323f870a61.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-environment.sh4
-rw-r--r--tests/profiles.scm10
-rw-r--r--tests/publish.scm12
-rw-r--r--tests/pypi.scm16
4 files changed, 40 insertions, 2 deletions
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index 0b5123ab45..68343520b0 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -57,6 +57,10 @@ else
     test $? = 42
 fi
 
+# Make sure 'GUIX_ENVIRONMENT' points to the profile.
+guix environment --bootstrap --ad-hoc guile-bootstrap --pure \
+     -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"'
+
 case "`uname -m`" in
     x86_64)
 	# On x86_64, we should be able to create a 32-bit environment.
diff --git a/tests/profiles.scm b/tests/profiles.scm
index fc1dfd2bfc..028d7b6fb4 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -207,6 +207,16 @@
                                        #:hooks '())))
     (return (derivation-inputs drv))))
 
+(test-assert "package->manifest-entry defaults to \"out\""
+  (let ((outputs (package-outputs packages:glibc)))
+    (equal? (manifest-entry-output
+             (package->manifest-entry (package
+                                        (inherit packages:glibc)
+                                        (outputs (reverse outputs)))))
+            (manifest-entry-output
+             (package->manifest-entry packages:glibc))
+            "out")))
+
 (test-assertm "profile-manifest, search-paths"
   (mlet* %store-monad
       ((guile ->   (package
diff --git a/tests/publish.scm b/tests/publish.scm
index 0ba33487bd..4dc807505c 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -58,8 +58,16 @@
     (lambda (response body) body)))
 
 (define (http-get-port uri)
-  (call-with-values (lambda () (http-get uri #:streaming? #t))
-    (lambda (response port) port)))
+  (let ((socket (open-socket-for-uri uri)))
+    ;; Make sure to use an unbuffered port so that we can then peek at the
+    ;; underlying file descriptor via 'call-with-gzip-input-port'.
+    (setvbuf socket _IONBF)
+    (call-with-values
+        (lambda ()
+          (http-get uri #:port socket #:streaming? #t))
+      (lambda (response port)
+        (setvbuf port _IONBF)
+        port))))
 
 (define (publish-uri route)
   (string-append "http://localhost:6789" route))
diff --git a/tests/pypi.scm b/tests/pypi.scm
index 379c288394..01d8a575ab 100644
--- a/tests/pypi.scm
+++ b/tests/pypi.scm
@@ -73,6 +73,22 @@ baz > 13.37")
 
 (test-begin "pypi")
 
+(test-equal "guix-package->pypi-name, old URL style"
+  "psutil"
+  (guix-package->pypi-name
+   (dummy-package "foo"
+                  (source (dummy-origin
+                           (uri
+                            "https://pypi.io/packages/source/p/psutil/psutil-4.3.0.tar.gz"))))))
+
+(test-equal "guix-package->pypi-name, new URL style"
+  "certbot"
+  (guix-package->pypi-name
+   (dummy-package "foo"
+                  (source (dummy-origin
+                           (uri
+                            "https://pypi.python.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
+
 (test-assert "pypi->guix-package"
   ;; Replace network resources with sample data.
   (mock ((guix import utils) url-fetch