1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 03:51:53 +02:00

tests: Support multiple HTTP server instances.

* guix/tests/http.scm (%http-server-socket): Turn into...
(open-http-server-socket): ... this procedure.
(http-server-can-listen?): New procedure.
(http-write, %http-server-lock, %http-server-ready)
(http-open, stub-http-server): Move to 'call-with-http-server' body.
(call-with-http-server): Add #:headers parameter.
(with-http-server): Add an additional pattern with headers.
* tests/derivations.scm: Use (http-server-can-listen?) instead
of (force %http-server-socket).
* tests/lint.scm: Likewise.
This commit is contained in:
Ludovic Courtès
2017-10-12 23:19:09 +02:00
parent e37415917c
commit 6ea10db973
3 changed files with 87 additions and 72 deletions
+4 -4
View File
@@ -222,7 +222,7 @@
(build-derivations %store (list drv))
#f)))
(unless (force %http-server-socket)
(unless (http-server-can-listen?)
(test-skip 1))
(test-assert "'download' built-in builder"
(let ((text (random-text)))
@@ -238,7 +238,7 @@
get-string-all)
text))))))
(unless (force %http-server-socket)
(unless (http-server-can-listen?)
(test-skip 1))
(test-assert "'download' built-in builder, invalid hash"
(with-http-server 200 "hello, world!"
@@ -253,7 +253,7 @@
(build-derivations %store (list drv))
#f))))
(unless (force %http-server-socket)
(unless (http-server-can-listen?)
(test-skip 1))
(test-assert "'download' built-in builder, not found"
(with-http-server 404 "not found"
@@ -279,7 +279,7 @@
(build-derivations %store (list drv))
#f)))
(unless (force %http-server-socket)
(unless (http-server-can-listen?)
(test-skip 1))
(test-assert "'download' built-in builder, check mode"
;; Make sure rebuilding the 'builtin:download' derivation in check mode