summaryrefslogtreecommitdiff
path: root/tests/publish.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-01-23 17:01:07 -0500
committerMark H Weaver <mhw@netris.org>2018-01-23 17:01:07 -0500
commita102d359a68ce7219a1880e47dd6f9332cbbce3a (patch)
treed879e718f08d776ad84c456c91a349e59941d1f2 /tests/publish.scm
parent07b8ea841e1e2eda5b367f35cf68d23d0520cc4d (diff)
parentf3a13a21e50fa3751fc39e5768ea6843bfc19df2 (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/publish.scm')
-rw-r--r--tests/publish.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/publish.scm b/tests/publish.scm
index bd1a75cf00..8c88a8c93d 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -111,6 +111,10 @@
(sleep 1)
(loop (- i 1))))))
+(define %gzip-magic-bytes
+ ;; Magic bytes of gzip file.
+ #vu8(#x1f #x8b))
+
;; Wait until the two servers are ready.
(wait-until-ready 6789)
@@ -215,6 +219,18 @@ FileSize: ~a~%"
(unless (zlib-available?)
(test-skip 1))
+(test-equal "/nar/gzip/* is really gzip"
+ %gzip-magic-bytes
+ ;; Since 'gzdopen' (aka. 'call-with-gzip-input-port') transparently reads
+ ;; uncompressed gzip, the test above doesn't check whether it's actually
+ ;; gzip. This is what this test does. See <https://bugs.gnu.org/30184>.
+ (let ((nar (http-get-port
+ (publish-uri
+ (string-append "/nar/gzip/" (basename %item))))))
+ (get-bytevector-n nar (bytevector-length %gzip-magic-bytes))))
+
+(unless (zlib-available?)
+ (test-skip 1))
(test-equal "/*.narinfo with compression"
`(("StorePath" . ,%item)
("URL" . ,(string-append "nar/gzip/" (basename %item)))