diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-06-08 14:46:24 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-06-08 14:46:24 +0200 |
commit | 8c3e9da13a3c92a7db308db8c0d81cb474ad7799 (patch) | |
tree | 88d06952aa5cc3a9c4991d9c43eb7950ff174fe1 /tests/publish.scm | |
parent | 5439c04ebdb7b6405f5ea2446b375f1d155a8d95 (diff) | |
parent | 0c5299200ffcd16370f047b7ccb187c60f30da34 (diff) | |
download | guix-8c3e9da13a3c92a7db308db8c0d81cb474ad7799.tar.gz guix-8c3e9da13a3c92a7db308db8c0d81cb474ad7799.zip |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/publish.scm')
-rw-r--r-- | tests/publish.scm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/publish.scm b/tests/publish.scm index 47c5eabca0..efb5698bed 100644 --- a/tests/publish.scm +++ b/tests/publish.scm @@ -41,12 +41,15 @@ #:autoload (zstd) (call-with-zstd-input-port) #:use-module (web uri) #:use-module (web client) + #:use-module (web request) #:use-module (web response) + #:use-module ((guix http-client) #:select (http-multiple-get)) #:use-module (rnrs bytevectors) #:use-module (ice-9 binary-ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) + #:use-module (srfi srfi-71) #:use-module (ice-9 threads) #:use-module (ice-9 format) #:use-module (ice-9 match) @@ -166,6 +169,26 @@ FileSize: ~a\n" (publish-uri (string-append "/" (store-path-hash-part %item) ".narinfo"))))) +(test-equal "/*.narinfo pipeline" + (make-list 500 200) + ;; Make sure clients can pipeline requests and correct responses, in the + ;; right order. See <https://issues.guix.gnu.org/54723>. + (let* ((uri (string->uri (publish-uri + (string-append "/" + (store-path-hash-part %item) + ".narinfo")))) + (_ expected (http-get uri #:streaming? #f #:decode-body? #f))) + (http-multiple-get (string->uri (publish-uri "")) + (lambda (request response port result) + (and (bytevector=? expected + (get-bytevector-n port + (response-content-length + response))) + (cons (response-code response) result))) + '() + (make-list 500 (build-request uri)) + #:batch-size 77))) + (test-equal "/*.narinfo with properly encoded '+' sign" ;; See <http://bugs.gnu.org/21888>. (let* ((item (add-text-to-store %store "fake-gtk+" "Congrats!")) |