diff options
author | Christopher Baines <mail@cbaines.net> | 2017-08-22 11:15:39 +0100 |
---|---|---|
committer | Christopher Baines <christopher.baines@digital.cabinet-office.gov.uk> | 2019-05-30 18:18:19 +0100 |
commit | b47d6046efa0763c9626ac8d8e99725a3b525351 (patch) | |
tree | fe656f9365908bf20ab7106788e71da7a0158ecb /gnu/tests | |
parent | 975b46da4ec5950adcab56a189d42aa2fbbfdd3e (diff) | |
download | gnu-guix-b47d6046efa0763c9626ac8d8e99725a3b525351.tar gnu-guix-b47d6046efa0763c9626ac8d8e99725a3b525351.tar.gz |
services: Add elasticsearch.
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/databases.scm | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm index e0544bbcd2..eb6f3ec5cc 100644 --- a/gnu/tests/databases.scm +++ b/gnu/tests/databases.scm @@ -31,7 +31,8 @@ #:export (%test-memcached %test-mongodb %test-postgresql - %test-mysql)) + %test-mysql + %test-elasticsearch)) (define %memcached-os (simple-operating-system @@ -319,3 +320,57 @@ (name "mysql") (description "Start the MySQL service.") (value (run-mysql-test)))) + + +;;; +;;; The Elasticsearch service. +;;; + +(define %elasticsearch-os + (simple-operating-system + (service elasticsearch-service-type))) + +(define (run-elasticsearch-test) + "Run tests in %ELASTICSEARCH-OS." + (define os + (marionette-operating-system + %elasticsearch-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (memory-size 512))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-64) + (gnu build marionette)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "elasticsearch") + + (test-assert "service running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'elasticsearch)) + marionette)) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "elasticsearch-test" test)) + +(define %test-elasticsearch + (system-test + (name "elasticsearch") + (description "Start the Elasticsearch service.") + (value (run-elasticsearch-test)))) |