summaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/audio.scm7
-rw-r--r--gnu/tests/base.scm45
-rw-r--r--gnu/tests/ci.scm9
-rw-r--r--gnu/tests/cups.scm7
-rw-r--r--gnu/tests/databases.scm24
-rw-r--r--gnu/tests/desktop.scm9
-rw-r--r--gnu/tests/dict.scm9
-rw-r--r--gnu/tests/docker.scm14
-rw-r--r--gnu/tests/file-sharing.scm7
-rw-r--r--gnu/tests/ganeti.scm7
-rw-r--r--gnu/tests/guix.scm14
-rw-r--r--gnu/tests/install.scm13
-rw-r--r--gnu/tests/ldap.scm7
-rw-r--r--gnu/tests/linux-modules.scm11
-rw-r--r--gnu/tests/mail.scm30
-rw-r--r--gnu/tests/messaging.scm23
-rw-r--r--gnu/tests/monitoring.scm15
-rw-r--r--gnu/tests/networking.scm42
-rw-r--r--gnu/tests/nfs.scm23
-rw-r--r--gnu/tests/package-management.scm8
-rw-r--r--gnu/tests/reconfigure.scm21
-rw-r--r--gnu/tests/rsync.scm7
-rw-r--r--gnu/tests/security-token.scm7
-rw-r--r--gnu/tests/singularity.scm9
-rw-r--r--gnu/tests/ssh.scm9
-rw-r--r--gnu/tests/telephony.scm7
-rw-r--r--gnu/tests/version-control.scm33
-rw-r--r--gnu/tests/virtualization.scm16
-rw-r--r--gnu/tests/web.scm36
29 files changed, 158 insertions, 311 deletions
diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm
index 7bf7d4ef14..8aa6d1e818 100644
--- a/gnu/tests/audio.scm
+++ b/gnu/tests/audio.scm
@@ -48,9 +48,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "mpd")
(test-assert "service is running"
@@ -70,8 +68,7 @@
'(system* #$(file-append mpd-mpc "/bin/mpc"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "mpd-test" test))
(define %test-mpd
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 9429a10b75..38d4317e52 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -87,6 +87,7 @@ Otherwise assume that there is no password for root."
(use-modules (gnu build marionette)
(guix build syscalls)
(srfi srfi-1)
+ (srfi srfi-19)
(srfi srfi-26)
(srfi srfi-64)
(ice-9 match))
@@ -94,9 +95,7 @@ Otherwise assume that there is no password for root."
(define marionette
(make-marionette #$command))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "basic")
#$(and initialization
@@ -198,6 +197,16 @@ info --version")
(pk 'services services)
'(root #$@(operating-system-shepherd-service-names os)))))
+ (test-equal "libc honors /etc/localtime"
+ -7200 ;CEST = GMT+2
+ ;; Assume OS is configured to have a CEST timezone.
+ (let* ((sept-2021 (time-second
+ (date->time-utc
+ (make-date 0 0 00 12 01 09 2021 7200)))))
+ (marionette-eval
+ `(tm:gmtoff (localtime ,sept-2021))
+ marionette)))
+
(test-equal "/var/log/messages is not world-readable"
#o640 ;<https://bugs.gnu.org/40405>
(begin
@@ -486,10 +495,11 @@ info --version")
(test-assert "screendump"
(begin
- (marionette-control (string-append "screendump " #$output
- "/tty1.ppm")
- marionette)
- (file-exists? "tty1.ppm")))
+ (let ((capture
+ (string-append #$output "/tty1.ppm")))
+ (marionette-control
+ (string-append "screendump " capture) marionette)
+ (file-exists? capture))))
(test-assert "screen text"
(let ((text (marionette-screen-text marionette
@@ -505,8 +515,7 @@ info --version")
"root@"
#$(operating-system-host-name os))))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation name test))
@@ -642,9 +651,7 @@ in a loop. See <http://bugs.gnu.org/26931>.")
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "cleanup")
(test-assert "dirty service worked"
@@ -657,8 +664,7 @@ in a loop. See <http://bugs.gnu.org/26931>.")
(scandir "/tmp"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "cleanup" test))
@@ -713,9 +719,7 @@ non-ASCII names from /tmp.")
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "mcron")
(test-assert "service running"
@@ -752,8 +756,7 @@ non-ASCII names from /tmp.")
result)
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation name test))
@@ -824,6 +827,7 @@ non-ASCII names from /tmp.")
(mkdir #$output)
(chdir #$output)
+ (test-runner-current (system-test-runner))
(test-begin "avahi")
(test-assert "nscd PID file is created"
@@ -902,8 +906,7 @@ non-ASCII names from /tmp.")
(= (hostent:addrtype result) AF_INET)))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "nss-mdns" test))
diff --git a/gnu/tests/ci.scm b/gnu/tests/ci.scm
index a8b39fcd01..5294514c66 100644
--- a/gnu/tests/ci.scm
+++ b/gnu/tests/ci.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018, 2019, 2020, 2021 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
@@ -70,9 +70,7 @@ HTTP-PORT."
;; port 8080 in the host.
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "laminar")
(test-assert "service running"
@@ -116,8 +114,7 @@ HTTP-PORT."
#:times 10
#:delay 5))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "laminar-test" test))
diff --git a/gnu/tests/cups.scm b/gnu/tests/cups.scm
index 4e922e5023..4c7d78b7c8 100644
--- a/gnu/tests/cups.scm
+++ b/gnu/tests/cups.scm
@@ -54,9 +54,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "cups")
;; Wait for the web interface to become ready.
@@ -80,8 +78,7 @@
#:decode-body? #t)))
(response-code response)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "cups-test" test))
diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm
index c8d11e10c0..a20de1a8c7 100644
--- a/gnu/tests/databases.scm
+++ b/gnu/tests/databases.scm
@@ -61,9 +61,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "memcached")
;; Wait for memcached to be up and running.
@@ -115,8 +113,7 @@
'(file-exists? "/var/log/memcached")
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "memcached-test" test))
@@ -179,9 +176,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "postgresql")
(test-assert "service running"
@@ -233,16 +228,14 @@
(let* ((port (open-pipe*
OPEN_READ
#$(file-append postgresql "/bin/psql")
- "-tAh" "/tmp"
- "-c" "SELECT 1 FROM pg_database WHERE
+ "-tA" "-c" "SELECT 1 FROM pg_database WHERE
datname='root'"))
(output (get-string-all port)))
(close-pipe port)
(string-contains output "1")))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "postgresql-test" test))
@@ -283,9 +276,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "mysql")
(test-assert "service running"
@@ -341,8 +332,7 @@
output))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "mysql-test" test))
diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm
index 6aa22fd49b..57069c0ede 100644
--- a/gnu/tests/desktop.scm
+++ b/gnu/tests/desktop.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -43,9 +43,7 @@
(define marionette
(make-marionette '(#$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "elogind")
;; Log in as root on tty1, and check what 'loginctl' returns.
@@ -83,8 +81,7 @@
(guest-file "/root/seats")
(guest-file "/root/users")))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "elogind" test))
diff --git a/gnu/tests/dict.scm b/gnu/tests/dict.scm
index c50e3cd6da..4d9702360c 100644
--- a/gnu/tests/dict.scm
+++ b/gnu/tests/dict.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of GNU Guix.
@@ -79,9 +79,7 @@
(define %dico-socket
(socket PF_INET SOCK_STREAM 0))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "dicod")
;; Wait for the service to be started.
@@ -117,8 +115,7 @@
(string-contains result "hello")
result))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "dicod" test))
diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm
index 92611b0a8d..bc119988b7 100644
--- a/gnu/tests/docker.scm
+++ b/gnu/tests/docker.scm
@@ -76,9 +76,7 @@ inside %DOCKER-OS."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "docker")
(test-assert "service running"
@@ -143,8 +141,7 @@ inside %DOCKER-OS."
(string->number response4))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "docker-test" test))
@@ -221,9 +218,7 @@ inside %DOCKER-OS."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "docker")
(test-assert "service running"
@@ -288,8 +283,7 @@ inside %DOCKER-OS."
"status" "guix-daemon")))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "docker-system-test" test))
diff --git a/gnu/tests/file-sharing.scm b/gnu/tests/file-sharing.scm
index 9a8ee6a593..d1343e2eba 100644
--- a/gnu/tests/file-sharing.scm
+++ b/gnu/tests/file-sharing.scm
@@ -91,9 +91,7 @@
(port-forwardings
`((9091 . ,%transmission-daemon-rpc-port)))))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "transmission-daemon")
;; Make sure the "transmission" user and group have been created.
@@ -259,8 +257,7 @@
"--auth" auth-string
"--session-info"))))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "transmission-daemon-test" test))
diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm
index 5ac2fd48dd..41996678dd 100644
--- a/gnu/tests/ganeti.scm
+++ b/gnu/tests/ganeti.scm
@@ -115,9 +115,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "ganeti")
;; Ganeti uses the Shepherd to start/stop daemons, so make sure
@@ -247,8 +245,7 @@
"destroy" "--yes-do-it"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append "ganeti-" hypervisor "-test") test))
diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm
index af7d8f0b21..69cac7c1aa 100644
--- a/gnu/tests/guix.scm
+++ b/gnu/tests/guix.scm
@@ -74,9 +74,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "guix-build-coordinator")
(test-assert "service running"
@@ -99,8 +97,7 @@
#:decode-body? #t)))
(response-code response)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "guix-build-coordinator-test" test))
@@ -199,9 +196,7 @@ host all all ::1/128 trust"))))))
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "guix-data-service")
(test-assert "service running"
@@ -235,8 +230,7 @@ host all all ::1/128 trust"))))))
#:decode-body? #t)))
(response-code response)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "guix-data-service-test" test))
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 38785ae0bd..9602efebe7 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -925,7 +925,7 @@ reboot\n")
(operating-system
(host-name "bootroot")
- (timezone "Europe/Madrid")
+ (timezone "Europe/Paris")
(locale "en_US.UTF-8")
(bootloader (bootloader-configuration
@@ -1168,7 +1168,7 @@ RAID-0 (stripe) root partition.")
(operating-system
(host-name "hurd")
- (timezone "America/Montreal")
+ (timezone "Europe/Paris")
(locale "en_US.UTF-8")
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
@@ -1679,9 +1679,12 @@ build (current-guix) and then store a couple of full system images.")
;; encryption support. The installer produces a UUID for the partition;
;; this "UUID" is explicitly set in 'gui-test-program' to the value shown
;; below.
- (swap-devices (if encrypted?
- '()
- (list (uuid "11111111-2222-3333-4444-123456789abc"))))
+ (swap-devices
+ (if encrypted?
+ '()
+ (list
+ (swap-space
+ (target (uuid "11111111-2222-3333-4444-123456789abc"))))))
(services (cons (service dhcp-client-service-type)
(operating-system-user-services %minimal-os-on-vda)))))
diff --git a/gnu/tests/ldap.scm b/gnu/tests/ldap.scm
index 197c1bfb28..d5403b3539 100644
--- a/gnu/tests/ldap.scm
+++ b/gnu/tests/ldap.scm
@@ -69,9 +69,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "ldap")
;; Set up LDAP directory server
@@ -148,8 +146,7 @@ suffix = dc=example,dc=com")))
#$(file-append coreutils "/bin/true")))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "ldap-test" test))
diff --git a/gnu/tests/linux-modules.scm b/gnu/tests/linux-modules.scm
index fc8945b77f..69cb013267 100644
--- a/gnu/tests/linux-modules.scm
+++ b/gnu/tests/linux-modules.scm
@@ -76,23 +76,26 @@ that MODULES are actually loaded."
(marionette-operating-system
base-os
#:imported-modules '((guix combinators))))
+
(define vm (virtual-machine os))
+
(define (test script)
(with-imported-modules '((gnu build marionette))
#~(begin
(use-modules (gnu build marionette)
(srfi srfi-64))
+
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
+
+ (test-runner-current (system-test-runner #$output))
(test-begin "loadable-kernel-modules")
(test-assert "script successfully evaluated"
(marionette-eval
'(primitive-load #$script)
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
+
(gexp->derivation "loadable-kernel-modules"
(test (modules-loaded?-program os module-names))))
diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm
index eb8952b33a..f13751b72f 100644
--- a/gnu/tests/mail.scm
+++ b/gnu/tests/mail.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
-;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
@@ -85,9 +85,7 @@ match from any for local action inbound
code
(read-reply-code port))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "opensmptd")
(test-assert "service is running"
@@ -157,8 +155,7 @@ match from any for local action inbound
(sleep 1) (wait (- n 1))))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "opensmtpd-test" test))
@@ -230,9 +227,7 @@ acl_check_data:
(define smtp (socket AF_INET SOCK_STREAM 0))
(define addr (make-socket-address AF_INET INADDR_LOOPBACK 1025))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "exim")
(test-assert "service is running"
@@ -285,8 +280,7 @@ acl_check_data:
(lambda (x) (not (string-prefix? "." x))))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "exim-test" test))
@@ -338,9 +332,7 @@ acl_check_data:
(define message "From: test@example.com\n\
Subject: Hello Nice to meet you!")
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "dovecot")
;; Wait for dovecot to be up and running.
@@ -399,8 +391,7 @@ Subject: Hello Nice to meet you!")
get-string-all)))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "dovecot-test" test))
@@ -489,9 +480,7 @@ Subject: Hello Nice to meet you!")
(define message "From: test@example.com\n\
Subject: Hello Nice to meet you!")
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "getmail")
;; Wait for dovecot to be up and running.
@@ -577,8 +566,7 @@ Subject: Hello Nice to meet you!")
marionette)
message))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "getmail-test" test))
diff --git a/gnu/tests/messaging.scm b/gnu/tests/messaging.scm
index 176e3d08cb..202a1c2f73 100644
--- a/gnu/tests/messaging.scm
+++ b/gnu/tests/messaging.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
@@ -98,9 +98,7 @@
(else
(error "file didn't show up" file)))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "xmpp")
;; Wait for XMPP service to be up and running.
@@ -128,8 +126,7 @@
(system* freetalk-bin "-s" #$script.ft)
(host-wait-for-file #$witness)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation name test))
@@ -191,9 +188,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "bitlbee")
(test-assert "service started"
@@ -231,8 +226,7 @@
(->bool (string-contains (pk 'message (read-line sock))
"BitlBee"))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "bitlbee-test" test))
@@ -264,9 +258,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "quassel")
(test-assert "service started"
@@ -281,8 +273,7 @@
'(file-exists? "/var/lib/quassel/quasselCert.pem")
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "quassel-test" test))
diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm
index 8630f5818c..ae0a8e0845 100644
--- a/gnu/tests/monitoring.scm
+++ b/gnu/tests/monitoring.scm
@@ -63,9 +63,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin #$name)
(test-assert "prometheus-node-exporter running"
@@ -87,8 +85,7 @@
(http-get "http://localhost:8080")))
(response-code response))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append name "-test") test))
@@ -165,9 +162,7 @@ cat ~a | sudo -u zabbix psql zabbix;
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin #$name)
;; XXX: Shepherd reads the config file *before* binding its control
@@ -296,9 +291,7 @@ zabbix||{}
(test-url "/")
(test-url "/does-not-exist" 404))
- (test-end)
-
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append name "-test") test))
diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm
index 453e63f52d..cebba7c7ca 100644
--- a/gnu/tests/networking.scm
+++ b/gnu/tests/networking.scm
@@ -104,9 +104,7 @@ port 7, and a dict service on port 2628."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "inetd")
;; Make sure the PID file is created.
@@ -137,8 +135,7 @@ port 7, and a dict service on port 2628."
(close dict)
response)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "inetd-test" test))
@@ -204,9 +201,7 @@ port 7, and a dict service on port 2628."
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "openvswitch")
;; Make sure the bridge is created.
@@ -244,8 +239,7 @@ port 7, and a dict service on port 2628."
(current-services))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "openvswitch-test" test))
@@ -304,9 +298,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "dhcpd")
(test-assert "pid file exists"
@@ -339,8 +331,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(current-services))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "dhcpd-test" test))
@@ -399,9 +390,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(current-services))))
marionette))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "tor")
;; Test the usual Tor service.
@@ -433,8 +422,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(wait-for-unix-socket "/var/run/tor/socks-sock"
marionette/unix-socks-socket)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "tor-test" test))
@@ -526,9 +514,7 @@ COMMIT
(loop (read-line in)))))))))
marionette))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "iptables")
(test-equal "iptables-save dumps the same rules that were loaded"
@@ -557,8 +543,7 @@ COMMIT
;; marionette)
;; (wait-for-tcp-port inetd-echo-port marionette #:timeout 5)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "iptables" test))
@@ -622,9 +607,7 @@ COMMIT
marionette))
(marionette-eval '(use-modules (guix ipfs)) marionette)
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "ipfs")
;; Test the IPFS service.
@@ -644,8 +627,7 @@ COMMIT
test-bv
(read-contents (add-data test-bv)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "ipfs-test" test))
(define %test-ipfs
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index a0c091eadb..7b7dd8c360 100644
--- a/gnu/tests/nfs.scm
+++ b/gnu/tests/nfs.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -92,9 +92,7 @@
(error "Socket didn't show up: " ,file))))
marionette))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "rpc-daemon")
;; Wait for the rpcbind daemon to be up and running.
@@ -130,8 +128,7 @@
'(zero? (system* "rpcinfo" "-p"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation name test))
@@ -198,9 +195,7 @@
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "nfs-daemon")
(marionette-eval
'(begin
@@ -252,8 +247,7 @@
"nfs-server:/" "/remote" "-v"))
(file-exists? "/remote/hello")))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "nfs-server-test" test))
@@ -310,9 +304,7 @@ directories can be mounted.")
(use-modules (gnu build marionette)
(srfi srfi-64))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "start-nfs-boot-test")
;;; Start up NFS server host.
@@ -401,8 +393,7 @@ directories can be mounted.")
(call-with-input-file "/export/mounts" display))
server-marionette)
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "nfs-root-fs-test" test))
diff --git a/gnu/tests/package-management.scm b/gnu/tests/package-management.scm
index 087eaf923e..fe897944d0 100644
--- a/gnu/tests/package-management.scm
+++ b/gnu/tests/package-management.scm
@@ -60,9 +60,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin #$name)
;; XXX: Shepherd reads the config file *before* binding its control
@@ -105,9 +103,7 @@ derivation {
"guix-test.nix")))
marionette))
- (test-end)
-
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append name "-test") test))
diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm
index 001b5d185a..2fd7c6854d 100644
--- a/gnu/tests/reconfigure.scm
+++ b/gnu/tests/reconfigure.scm
@@ -79,9 +79,7 @@ generation of the system profile."
entries)))
marionette))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "switch-to-system")
(let ((generations-prior (system-generations marionette)))
@@ -112,8 +110,7 @@ generation of the system profile."
"jakob")
marionette)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "switch-to-system" (test (switch-system-program os))))
@@ -153,9 +150,7 @@ Shepherd (PID 1) by unloading obsolete services and loading new services."
(map live-service-canonical-name (current-services)))
marionette))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "upgrade-services")
(let ((services-prior (running-services marionette)))
@@ -176,8 +171,7 @@ Shepherd (PID 1) by unloading obsolete services and loading new services."
(test-assert "script stopped obsolete service"
(not (memq 'dummy (running-services marionette)))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation
"upgrade-services"
@@ -220,9 +214,7 @@ bootloader's configuration file."
(second (string-split (match:substring parameter) #\=)))
(list-matches "system=[^ ]*" grub-cfg))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "install-bootloader")
(test-assert "no prior menu entry for system generation"
@@ -236,8 +228,7 @@ bootloader's configuration file."
(test-assert "menu entry created for system generation"
(member #$os (generations-in-grub-cfg marionette)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(let* ((bootloader ((compose bootloader-configuration-bootloader
operating-system-bootloader)
diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm
index 24e60d9d9d..91f2b41cec 100644
--- a/gnu/tests/rsync.scm
+++ b/gnu/tests/rsync.scm
@@ -54,9 +54,7 @@ PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "rsync")
;; Wait for rsync to be up and running.
@@ -106,8 +104,7 @@ PORT."
(read-line port))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "rsync-test" test))
diff --git a/gnu/tests/security-token.scm b/gnu/tests/security-token.scm
index 1169a4b9fd..07270c0bfd 100644
--- a/gnu/tests/security-token.scm
+++ b/gnu/tests/security-token.scm
@@ -44,9 +44,7 @@
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "pcscd")
(test-assert "pcscd is alive"
@@ -59,8 +57,7 @@
(current-services))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "pcscd" test))
diff --git a/gnu/tests/singularity.scm b/gnu/tests/singularity.scm
index 1fc2773a00..f4b9776b48 100644
--- a/gnu/tests/singularity.scm
+++ b/gnu/tests/singularity.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -72,9 +72,7 @@
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "singularity")
(test-assert "singularity exec /bin/guile (as root)"
@@ -126,8 +124,7 @@
"--debug" "run" #$image "-c" "(use-modules (json))"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "singularity-test" test))
diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm
index 10438ad22a..791ff7b73f 100644
--- a/gnu/tests/ssh.scm
+++ b/gnu/tests/ssh.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;;
@@ -108,9 +108,7 @@ root with an empty password."
('denied
(loop rest)))))))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "ssh-daemon")
;; Wait for sshd to be up and running.
@@ -209,8 +207,7 @@ root with an empty password."
(channel-request-exec channel "path-witness")
(zero? (channel-get-exit-status channel))))))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0))))))
+ (test-end)))))
(gexp->derivation name test))
diff --git a/gnu/tests/telephony.scm b/gnu/tests/telephony.scm
index aeb6500c47..998bdbccf9 100644
--- a/gnu/tests/telephony.scm
+++ b/gnu/tests/telephony.scm
@@ -138,9 +138,7 @@ accounts provisioning feature of the service."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "jami")
(test-assert "service is running"
@@ -341,8 +339,7 @@ accounts provisioning feature of the service."
account-details)))))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (if provisioning?
"jami-provisioning-test"
diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm
index a7cde1f163..fd3dba88ba 100644
--- a/gnu/tests/version-control.scm
+++ b/gnu/tests/version-control.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;;
@@ -132,9 +132,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "cgit")
;; XXX: Shepherd reads the config file *before* binding its control
@@ -210,8 +208,7 @@ HTTP-PORT."
(test-url "/test/tree/does-not-exist" 404)
(test-url "/does-not-exist" 404))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "cgit-test" test))
@@ -270,9 +267,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "git-http")
;; Wait for nginx to be up and running.
@@ -302,8 +297,7 @@ HTTP-PORT."
(call-with-input-file "/tmp/clone/README"
get-string-all)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "git-http" test))
@@ -367,9 +361,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "gitolite")
;; Wait for sshd to be up and running.
@@ -410,8 +402,7 @@ HTTP-PORT."
(test-assert "pushing, and the associated hooks"
(invoke #$(file-append git "/bin/git") "push")))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "gitolite" test))
@@ -458,7 +449,8 @@ HTTP-PORT."
(define vm
(virtual-machine
(operating-system os)
- (port-forwardings `((8081 . ,http-port)))))
+ (port-forwardings `((8081 . ,http-port)))
+ (memory-size 1024)))
(define test
(with-imported-modules '((gnu build marionette))
@@ -472,9 +464,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "gitile")
;; XXX: Shepherd reads the config file *before* binding its control
@@ -540,8 +530,7 @@ HTTP-PORT."
(test-url "/test/tree/-/does-not-exist" 404)
(test-url "/does-not-exist" 404))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "gitile-test" test))
diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm
index 9f9d3a5e26..628cd0549b 100644
--- a/gnu/tests/virtualization.scm
+++ b/gnu/tests/virtualization.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
-;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;;
@@ -73,9 +73,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "libvirt")
(test-assert "service running"
@@ -107,8 +105,7 @@
"-c" "qemu:///system" "connect"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "libvirt-test" test))
@@ -193,9 +190,7 @@
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "childhurd")
(test-assert "service running"
@@ -250,8 +245,7 @@
(open-input-pipe #$run-uname-over-ssh)))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "childhurd-test" test))
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm
index fb0713addc..4e8eceaa2b 100644
--- a/gnu/tests/web.scm
+++ b/gnu/tests/web.scm
@@ -113,9 +113,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin #$name)
(test-assert #$(string-append name " service running")
@@ -150,8 +148,7 @@ HTTP-PORT."
marionette)))
'())
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append name "-test") test))
@@ -309,9 +306,7 @@ HTTP-PORT, along with php-fpm."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "php-fpm")
(test-assert "php-fpm running"
@@ -350,9 +345,7 @@ HTTP-PORT, along with php-fpm."
(and matches
(match:substring matches 0))))))
- (test-end)
-
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "php-fpm-test" test))
@@ -394,9 +387,7 @@ HTTP-PORT, along with php-fpm."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin #$name)
(test-assert "hpcguix-web running"
@@ -422,8 +413,7 @@ HTTP-PORT, along with php-fpm."
#:times 10
#:delay 5)))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation (string-append name "-test") test))
@@ -487,9 +477,7 @@ HTTP-PORT."
;; port 8080 in the host.
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "tailon")
(test-assert "service running"
@@ -513,8 +501,7 @@ HTTP-PORT."
#:times 10
#:delay 5))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "tailon-test" test))
@@ -631,9 +618,7 @@ HTTP-PORT."
(define marionette
(make-marionette (list #$vm)))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "patchwork")
(test-assert "patchwork-postgresql-user-and-service started"
@@ -668,8 +653,7 @@ HTTP-PORT."
#:times 10
#:delay 5))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "patchwork-test" test))