;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu tests databases) #:use-module (gnu tests) #:use-module (gnu system) #:use-module (gnu system file-systems) #:use-module (gnu system shadow) #:u
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2014-11-20 23:36:02 +0100
committerAndreas Enge <andreas@enge.fr>2014-11-21 18:01:21 +0100
commitd1de5ff3b1ee28bfe651cf5b63ff0e3282ee9aa4 (patch)
tree398deff5fe5dcfcfb98cd88b175982fa9993027a /.gitignore
parent9723ce5886e0c291e5337c3328f34d335f77fa88 (diff)
downloadguix-d1de5ff3b1ee28bfe651cf5b63ff0e3282ee9aa4.tar.gz
guix-d1de5ff3b1ee28bfe651cf5b63ff0e3282ee9aa4.zip
gnu: xcb-proto: Update to 1.11.
* gnu/packages/xorg.scm (xcb-proto): Update to 1.11.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions
bin/mongo") "test" "--eval" "db.testCollection.insert({data: 'test-data'})")) (test-equal "test find" "test-data" (let* ((port (open-pipe* OPEN_READ (string-append #$mongodb "/bin/mongo") "test" "--quiet" "--eval" "db.testCollection.findOne().data")) (output (read-line port)) (status (close-pipe port))) output)) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation "mongodb-test" test)) (define %test-mongodb (system-test (name "mongodb") (description "Connect to a running MONGODB server.") (value (run-mongodb-test)))) ;;; ;;; The PostgreSQL service. ;;; (define %postgresql-os (simple-operating-system (service postgresql-service-type (postgresql-configuration (postgresql postgresql-10))))) (define (run-postgresql-test) "Run tests in %POSTGRESQL-OS." (define os (marionette-operating-system %postgresql-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 "postgresql") (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'postgres)) marionette)) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation "postgresql-test" test)) (define %test-postgresql (system-test (name "postgresql") (description "Start the PostgreSQL service.") (value (run-postgresql-test)))) ;;; ;;; The MySQL service. ;;; (define %mysql-os (simple-operating-system (service mysql-service-type))) (define* (run-mysql-test) "Run tests in %MYSQL-OS." (define os (marionette-operating-system %mysql-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-11) (srfi srfi-64) (gnu build marionette)) (define marionette (make-marionette (list #$vm))) (mkdir #$output) (chdir #$output) (test-begin "mysql") (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd)) (match (start-service 'mysql) (#f #f) (('service response-parts ...) (match (assq-ref response-parts 'running) ((pid) (number? pid)))))) marionette)) (test-assert "mysql_upgrade completed" (wait-for-file "/var/lib/mysql/mysql_upgrade_info" marionette)) (test-eq "create database" 0 (marionette-eval '(begin (system* #$(file-append mariadb "/bin/mysql") "-e" "CREATE DATABASE guix;")) marionette)) (test-eq "create table" 0 (marionette-eval '(begin (system* #$(file-append mariadb "/bin/mysql") "guix" "-e" "CREATE TABLE facts (id INT, data VARCHAR(12));")) marionette)) (test-eq "insert data" 0 (marionette-eval '(begin (system* #$(file-append mariadb "/bin/mysql") "guix" "-e" "INSERT INTO facts VALUES (1, 'awesome')")) marionette)) (test-equal "retrieve data" "awesome\n" (marionette-eval '(begin (use-modules (ice-9 popen)) (let* ((port (open-pipe* OPEN_READ #$(file-append mariadb "/bin/mysql") "guix" "-NB" "-e" "SELECT data FROM facts WHERE id=1;")) (output (get-string-all port))) (close-pipe port) output)) marionette)) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation "mysql-test" test)) (define %test-mysql (system-test (name "mysql") (description "Start the MySQL service.") (value (run-mysql-test))))