summaryrefslogtreecommitdiff
path: root/tests/publish.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-08-01 17:42:09 +0200
committerLudovic Courtès <ludo@gnu.org>2016-08-01 17:58:56 +0200
commit089b167812624cc69aac95d5a1b69688e3f97117 (patch)
tree2255fe27e3356307e33c20c2281d60bbfbec293b /tests/publish.scm
parent66c65aafa73f9ca816825abb7f84b353f7bcfdf6 (diff)
publish: Do not compress already-compressed files.
* guix/scripts/publish.scm (narinfo-string): Force %NO-COMPRESSION when STORE-PATH matches 'compressed-file?'. * guix/utils.scm (compressed-file?): New procedure. * tests/publish.scm ("/*.narinfo for a compressed file"): New test.
Diffstat (limited to 'tests/publish.scm')
-rw-r--r--tests/publish.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/publish.scm b/tests/publish.scm
index 4dc807505c2..7499553aeb5 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -200,6 +200,20 @@ References: ~%"
200 (_ #f))) 200 (_ #f)))
201 (recutils->alist body))))) 201 (recutils->alist body)))))
202 202
203(unless (zlib-available?)
204 (test-skip 1))
205(test-equal "/*.narinfo for a compressed file"
206 '("none" "nar") ;compression-less nar
207 ;; Assume 'guix publish -C' is already running on port 6799.
208 (let* ((item (add-text-to-store %store "fake.tar.gz"
209 "This is a fake compressed file."))
210 (url (string-append "http://localhost:6799/"
211 (store-path-hash-part item) ".narinfo"))
212 (body (http-get-port url))
213 (info (recutils->alist body)))
214 (list (assoc-ref info "Compression")
215 (dirname (assoc-ref info "URL")))))
216
203(test-equal "/nar/ with properly encoded '+' sign" 217(test-equal "/nar/ with properly encoded '+' sign"
204 "Congrats!" 218 "Congrats!"
205 (let ((item (add-text-to-store %store "fake-gtk+" "Congrats!"))) 219 (let ((item (add-text-to-store %store "fake-gtk+" "Congrats!")))