diff options
author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-09-15 18:20:38 +0200 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-09-15 18:47:00 +0200 |
commit | e9ff5d51e3297089e66c124195e1f1b42dbded65 (patch) | |
tree | ce3993c90b76a2275b57bf3231628966897ee122 /gnu/tests | |
parent | 43cdc8a07517e936812782c313fe145bcf5c7ed3 (diff) | |
parent | b696fb41bc0dfcb7130a5aa6d69aff2ae191c283 (diff) | |
download | guix-e9ff5d51e3297089e66c124195e1f1b42dbded65.tar guix-e9ff5d51e3297089e66c124195e1f1b42dbded65.tar.gz |
Merge branch 'master' into gnome-team.
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/ganeti.scm | 9 | ||||
-rw-r--r-- | gnu/tests/guix.scm | 81 |
2 files changed, 85 insertions, 5 deletions
diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index b5624b7598..29eb354044 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -165,9 +165,9 @@ (marionette-eval '(begin (setenv "PATH" "/run/current-system/profile/bin") - (invoke "herd" "stop" "ganeti-wconfd") - (invoke "herd" "disable" "ganeti-wconfd") - (invoke "herd" "force-start" "ganeti-wconfd")) + (and (zero? (system* "herd" "stop" "ganeti-wconfd")) + (zero? (system* "herd" "disable" "ganeti-wconfd")) + (zero? (system* "herd" "force-start" "ganeti-wconfd")))) marionette)) ;; Verify that the cluster is healthy. @@ -230,7 +230,8 @@ "debootstrap+default\nguix+default\n" (marionette-eval '(begin - (use-modules (ice-9 popen)) + (use-modules (ice-9 popen) + (ice-9 textual-ports)) (let* ((port (open-pipe* OPEN_READ #$(file-append ganeti "/sbin/gnt-os") diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index ad0980a10c..240ded4825 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -37,7 +37,8 @@ #:use-module (ice-9 match) #:export (%test-guix-build-coordinator %test-guix-data-service - %test-nar-herder)) + %test-nar-herder + %test-bffe)) ;;; ;;; Guix Build Coordinator @@ -325,3 +326,81 @@ host all all ::1/128 trust")))))) (name "nar-herder") (description "Connect to a running Nar Herder server.") (value (run-nar-herder-test)))) + + +;;; +;;; Build Farm Front-end +;;; + +(define %bffe-os + (simple-operating-system + (service dhcp-client-service-type) + (service guix-build-coordinator-service-type) + (service bffe-service-type + (bffe-configuration + (arguments + #~(list + #:web-server-args + '(#:port 8767 + #:controller-args + (#:title "Test title")))))))) + +(define (run-bffe-test) + (define os + (marionette-operating-system + %bffe-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define forwarded-port 8767) + + (define vm + (virtual-machine + (operating-system os) + (memory-size 1024) + (port-forwardings `((,forwarded-port . 8767))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (test-runner-current (system-test-runner #$output)) + (test-begin "bffe") + + (test-assert "service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'bffe) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + (test-equal "http-get" + 200 + (let-values + (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/" forwarded-port) + #:decode-body? #t))) + (response-code response))) + + (test-end)))) + + (gexp->derivation "bffe-test" test)) + +(define %test-bffe + (system-test + (name "bffe") + (description "Connect to a running Build Farm Front-end.") + (value (run-bffe-test)))) |