diff options
author | Christopher Baines <mail@cbaines.net> | 2021-02-03 09:14:43 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-02-03 09:57:35 +0000 |
commit | e740cc614096e768813280c718f9e96343ba41b3 (patch) | |
tree | 25ade70a5d408be80f62f19c6511172aab7dcce5 /tests/publish.scm | |
parent | 1b9186828867e77af1f2ee6741063424f8256398 (diff) | |
parent | 63cf277bfacf282d2b19f00553745b2a9370eca0 (diff) | |
download | guix-e740cc614096e768813280c718f9e96343ba41b3.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/publish.scm')
-rw-r--r-- | tests/publish.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/publish.scm b/tests/publish.scm index cafd0f13a2..52101876b5 100644 --- a/tests/publish.scm +++ b/tests/publish.scm @@ -38,6 +38,7 @@ #:use-module ((guix pki) #:select (%public-key-file %private-key-file)) #:use-module (zlib) #:use-module (lzlib) + #:autoload (zstd) (call-with-zstd-input-port) #:use-module (web uri) #:use-module (web client) #:use-module (web response) @@ -54,6 +55,9 @@ (define %store (open-connection-for-tests)) +(define (zstd-supported?) + (resolve-module '(zstd) #t #f #:ensure #f)) + (define %reference (add-text-to-store %store "ref" "foo")) (define %item (add-text-to-store %store "item" "bar" (list %reference))) @@ -237,6 +241,18 @@ References: ~%" (cut restore-file <> temp))) (call-with-input-file temp read-string)))) +(unless (zstd-supported?) (test-skip 1)) +(test-equal "/nar/zstd/*" + "bar" + (call-with-temporary-output-file + (lambda (temp port) + (let ((nar (http-get-port + (publish-uri + (string-append "/nar/zstd/" (basename %item)))))) + (call-with-zstd-input-port nar + (cut restore-file <> temp))) + (call-with-input-file temp read-string)))) + (test-equal "/*.narinfo with compression" `(("StorePath" . ,%item) ("URL" . ,(string-append "nar/gzip/" (basename %item))) |