aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/databases.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests/databases.scm')
-rw-r--r--gnu/tests/databases.scm57
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))))