From 1fb75128a5202b406622da6272bc809c46d1f439 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 25 Sep 2021 18:36:04 +0200 Subject: tests: Adjust to SRFI-64 as found in Guile 3.0.7. In Guile 3.0.7, 'test-runner-current' is set to #f upon 'test-end'. Consequently, the previous strategy, where we'd call 'test-runner-current' after 'test-end', no longer works. Instead, set the test runner in each test right before 'test-begin'. * gnu/build/marionette.scm (system-test-runner): New procedure. * gnu/tests/audio.scm (run-mpd-test): Replace (exit (= ...)) idiom by (test-runner-current (system-test-runner)). * gnu/tests/base.scm (run-basic-test) (run-cleanup-test, run-mcron-test, run-nss-mdns-test): Likewise. * gnu/tests/ci.scm (run-laminar-test): Likewise. * gnu/tests/cups.scm (run-cups-test): Likewise. * gnu/tests/databases.scm (run-memcached-test) (run-postgresql-test, run-mysql-test): Likewise. * gnu/tests/desktop.scm (run-elogind-test): Likewise. * gnu/tests/dict.scm (run-dicod-test): Likewise. * gnu/tests/docker.scm (run-docker-test): Likewise. (run-docker-system-test): Likewise. * gnu/tests/file-sharing.scm (run-transmission-daemon-test): Likewise. * gnu/tests/ganeti.scm (run-ganeti-test): Likewise. * gnu/tests/guix.scm (run-guix-build-coordinator-test): Likewise. (run-guix-data-service-test): Likewise. * gnu/tests/ldap.scm (run-ldap-test): Likewise. * gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test-base): Likewise. * gnu/tests/mail.scm (run-opensmtpd-test) (run-exim-test, run-dovecot-test, run-getmail-test): Likewise. * gnu/tests/messaging.scm (run-xmpp-test) (run-bitlbee-test, run-quassel-test): Likewise. * gnu/tests/monitoring.scm (run-prometheus-node-exporter-server-test) (run-zabbix-server-test): Likewise. * gnu/tests/networking.scm (run-inetd-test, run-openvswitch-test) (run-dhcpd-test, run-tor-test, run-iptables-test, run-ipfs-test): Likewise. * gnu/tests/nfs.scm (run-nfs-test) (run-nfs-server-test, run-nfs-root-fs-test): Likewise. * gnu/tests/package-management.scm (run-nix-test): Likewise. * gnu/tests/reconfigure.scm (run-switch-to-system-test) (run-upgrade-services-test, run-install-bootloader-test): Likewise. * gnu/tests/rsync.scm (run-rsync-test): Likewise. * gnu/tests/security-token.scm (run-pcscd-test): Likewise. * gnu/tests/singularity.scm (run-singularity-test): Likewise. * gnu/tests/ssh.scm (run-ssh-test): Likewise. * gnu/tests/telephony.scm (run-jami-test): Likewise. * gnu/tests/version-control.scm (run-cgit-test): Likewise. (run-git-http-test, run-gitolite-test, run-gitile-test): Likewise. * gnu/tests/virtualization.scm (run-libvirt-test, run-childhurd-test): Likewise. * gnu/tests/web.scm (run-webserver-test, run-php-fpm-test) (run-hpcguix-web-server-test, run-tailon-test, run-patchwork-test): Likewise. --- gnu/tests/audio.scm | 4 ++-- gnu/tests/base.scm | 16 ++++++++-------- gnu/tests/ci.scm | 6 +++--- gnu/tests/cups.scm | 4 ++-- gnu/tests/databases.scm | 12 ++++++------ gnu/tests/desktop.scm | 6 +++--- gnu/tests/dict.scm | 6 +++--- gnu/tests/docker.scm | 8 ++++---- gnu/tests/file-sharing.scm | 4 ++-- gnu/tests/ganeti.scm | 4 ++-- gnu/tests/guix.scm | 8 ++++---- gnu/tests/ldap.scm | 4 ++-- gnu/tests/linux-modules.scm | 10 ++++++++-- gnu/tests/mail.scm | 18 +++++++++--------- gnu/tests/messaging.scm | 14 +++++++------- gnu/tests/monitoring.scm | 9 ++++----- gnu/tests/networking.scm | 24 ++++++++++++------------ gnu/tests/nfs.scm | 14 +++++++------- gnu/tests/package-management.scm | 5 ++--- gnu/tests/reconfigure.scm | 12 ++++++------ gnu/tests/rsync.scm | 4 ++-- gnu/tests/security-token.scm | 4 ++-- gnu/tests/singularity.scm | 6 +++--- gnu/tests/ssh.scm | 6 +++--- gnu/tests/telephony.scm | 4 ++-- gnu/tests/version-control.scm | 18 +++++++++--------- gnu/tests/virtualization.scm | 10 +++++----- gnu/tests/web.scm | 23 +++++++++++------------ 28 files changed, 133 insertions(+), 130 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm index 7bf7d4ef146..0124fa36a0b 100644 --- a/gnu/tests/audio.scm +++ b/gnu/tests/audio.scm @@ -51,6 +51,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "mpd") (test-assert "service is running" @@ -70,8 +71,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 9429a10b754..81be8de1cfb 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -97,6 +97,7 @@ Otherwise assume that there is no password for root." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "basic") #$(and initialization @@ -505,8 +506,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)) @@ -645,6 +645,7 @@ in a loop. See .") (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "cleanup") (test-assert "dirty service worked" @@ -657,8 +658,7 @@ in a loop. See .") (scandir "/tmp")) marionette)) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + (test-end)))) (gexp->derivation "cleanup" test)) @@ -716,6 +716,7 @@ non-ASCII names from /tmp.") (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "mcron") (test-assert "service running" @@ -752,8 +753,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 +824,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 +903,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 a8b39fcd019..b7970017fcb 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 +;;; Copyright © 2017, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Christopher Baines ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2018 Pierre-Antoine Rouby @@ -73,6 +73,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "laminar") (test-assert "service running" @@ -116,8 +117,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 4e922e5023c..fd6d87d2bf6 100644 --- a/gnu/tests/cups.scm +++ b/gnu/tests/cups.scm @@ -57,6 +57,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "cups") ;; Wait for the web interface to become ready. @@ -80,8 +81,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 c8d11e10c0b..ba2bb182b92 100644 --- a/gnu/tests/databases.scm +++ b/gnu/tests/databases.scm @@ -64,6 +64,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "memcached") ;; Wait for memcached to be up and running. @@ -115,8 +116,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)) @@ -182,6 +182,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "postgresql") (test-assert "service running" @@ -241,8 +242,7 @@ (string-contains output "1"))) marionette)) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + (test-end)))) (gexp->derivation "postgresql-test" test)) @@ -286,6 +286,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "mysql") (test-assert "service running" @@ -341,8 +342,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 6aa22fd49b7..67e530d392d 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 +;;; Copyright © 2017, 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,6 +46,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "elogind") ;; Log in as root on tty1, and check what 'loginctl' returns. @@ -83,8 +84,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 c50e3cd6daa..51343be7de8 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 +;;; Copyright © 2017, 2018, 2021 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur ;;; ;;; This file is part of GNU Guix. @@ -82,6 +82,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "dicod") ;; Wait for the service to be started. @@ -117,8 +118,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 92611b0a8db..45b5d375ea9 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -79,6 +79,7 @@ inside %DOCKER-OS." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "docker") (test-assert "service running" @@ -143,8 +144,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)) @@ -224,6 +224,7 @@ inside %DOCKER-OS." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "docker") (test-assert "service running" @@ -288,8 +289,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 9a8ee6a5932..7dd2a847f0b 100644 --- a/gnu/tests/file-sharing.scm +++ b/gnu/tests/file-sharing.scm @@ -94,6 +94,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "transmission-daemon") ;; Make sure the "transmission" user and group have been created. @@ -259,8 +260,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 b64a332dde6..be70d1117a1 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -120,6 +120,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "ganeti") ;; Ganeti uses the Shepherd to start/stop daemons, so make sure @@ -248,8 +249,7 @@ "destroy" "--yes-do-it")) marionette)) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 1))))) + (test-end)))) (gexp->derivation (string-append "ganeti-" hypervisor "-test") test)) diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index af7d8f0b217..7e3bc8c1f5b 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -77,6 +77,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "guix-build-coordinator") (test-assert "service running" @@ -99,8 +100,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)) @@ -202,6 +202,7 @@ host all all ::1/128 trust")))))) (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "guix-data-service") (test-assert "service running" @@ -235,8 +236,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/ldap.scm b/gnu/tests/ldap.scm index 197c1bfb282..e149972027b 100644 --- a/gnu/tests/ldap.scm +++ b/gnu/tests/ldap.scm @@ -72,6 +72,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "ldap") ;; Set up LDAP directory server @@ -148,8 +149,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 fc8945b77f2..200c1510082 100644 --- a/gnu/tests/linux-modules.scm +++ b/gnu/tests/linux-modules.scm @@ -76,23 +76,29 @@ 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)) (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 eb8952b33a8..ae6417c119c 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 ;;; Copyright © 2017 Carlo Zancanaro -;;; Copyright © 2017, 2020 Ludovic Courtès +;;; Copyright © 2017, 2020, 2021 Ludovic Courtès ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2018 Clément Lassieur ;;; Copyright © 2019 Christopher Baines @@ -88,6 +88,7 @@ match from any for local action inbound (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "opensmptd") (test-assert "service is running" @@ -157,8 +158,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)) @@ -233,6 +233,7 @@ acl_check_data: (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "exim") (test-assert "service is running" @@ -285,8 +286,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)) @@ -341,6 +341,7 @@ Subject: Hello Nice to meet you!") (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "dovecot") ;; Wait for dovecot to be up and running. @@ -399,8 +400,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)) @@ -492,6 +492,7 @@ Subject: Hello Nice to meet you!") (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "getmail") ;; Wait for dovecot to be up and running. @@ -577,8 +578,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 176e3d08cb5..db9516a4858 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 -;;; Copyright © 2017, 2018 Ludovic Courtès +;;; Copyright © 2017, 2018, 2021 Ludovic Courtès ;;; Copyright © 2018 Efraim Flashner ;;; ;;; This file is part of GNU Guix. @@ -101,6 +101,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "xmpp") ;; Wait for XMPP service to be up and running. @@ -128,8 +129,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)) @@ -194,6 +194,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "bitlbee") (test-assert "service started" @@ -231,8 +232,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)) @@ -267,6 +267,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "quassel") (test-assert "service started" @@ -281,8 +282,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 8630f5818cf..5039e227658 100644 --- a/gnu/tests/monitoring.scm +++ b/gnu/tests/monitoring.scm @@ -66,6 +66,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin #$name) (test-assert "prometheus-node-exporter running" @@ -87,8 +88,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)) @@ -168,6 +168,7 @@ cat ~a | sudo -u zabbix psql zabbix; (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin #$name) ;; XXX: Shepherd reads the config file *before* binding its control @@ -296,9 +297,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 453e63f52d9..fc2060b3ec4 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -107,6 +107,7 @@ port 7, and a dict service on port 2628." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "inetd") ;; Make sure the PID file is created. @@ -137,8 +138,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)) @@ -207,6 +207,7 @@ port 7, and a dict service on port 2628." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "openvswitch") ;; Make sure the bridge is created. @@ -244,8 +245,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)) @@ -307,6 +307,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 { (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "dhcpd") (test-assert "pid file exists" @@ -339,8 +340,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)) @@ -402,6 +402,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 { (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "tor") ;; Test the usual Tor service. @@ -433,8 +434,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)) @@ -529,6 +529,7 @@ COMMIT (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "iptables") (test-equal "iptables-save dumps the same rules that were loaded" @@ -557,8 +558,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)) @@ -625,6 +625,7 @@ COMMIT (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "ipfs") ;; Test the IPFS service. @@ -644,8 +645,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 a0c091eadb1..7b6aa51cac8 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 +;;; Copyright © 2016, 2017, 2020, 2021 Ludovic Courtès ;;; Copyright © 2016 John Darrington ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2017 Tobias Geerinckx-Rice @@ -95,6 +95,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "rpc-daemon") ;; Wait for the rpcbind daemon to be up and running. @@ -130,8 +131,7 @@ '(zero? (system* "rpcinfo" "-p")) marionette)) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + (test-end)))) (gexp->derivation name test)) @@ -201,6 +201,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "nfs-daemon") (marionette-eval '(begin @@ -252,8 +253,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)) @@ -313,6 +313,7 @@ directories can be mounted.") (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "start-nfs-boot-test") ;;; Start up NFS server host. @@ -401,8 +402,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 087eaf923e6..7033f040dd2 100644 --- a/gnu/tests/package-management.scm +++ b/gnu/tests/package-management.scm @@ -63,6 +63,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin #$name) ;; XXX: Shepherd reads the config file *before* binding its control @@ -105,9 +106,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 001b5d185a9..b97fedcf6bb 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm @@ -82,6 +82,7 @@ generation of the system profile." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "switch-to-system") (let ((generations-prior (system-generations marionette))) @@ -112,8 +113,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)))) @@ -156,6 +156,7 @@ Shepherd (PID 1) by unloading obsolete services and loading new services." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "upgrade-services") (let ((services-prior (running-services marionette))) @@ -176,8 +177,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" @@ -223,6 +223,7 @@ bootloader's configuration file." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "install-bootloader") (test-assert "no prior menu entry for system generation" @@ -236,8 +237,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 24e60d9d9d6..2227edf30d5 100644 --- a/gnu/tests/rsync.scm +++ b/gnu/tests/rsync.scm @@ -57,6 +57,7 @@ PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "rsync") ;; Wait for rsync to be up and running. @@ -106,8 +107,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 1169a4b9fd0..d28d23a1ae5 100644 --- a/gnu/tests/security-token.scm +++ b/gnu/tests/security-token.scm @@ -47,6 +47,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "pcscd") (test-assert "pcscd is alive" @@ -59,8 +60,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 1fc2773a002..ac2dec19b8f 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 +;;; Copyright © 2019, 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -75,6 +75,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "singularity") (test-assert "singularity exec /bin/guile (as root)" @@ -126,8 +127,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 10438ad22a9..7442bd1c2e7 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 +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2017 Marius Bakke ;;; @@ -111,6 +111,7 @@ root with an empty password." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "ssh-daemon") ;; Wait for sshd to be up and running. @@ -209,8 +210,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 aeb6500c470..2d44d001656 100644 --- a/gnu/tests/telephony.scm +++ b/gnu/tests/telephony.scm @@ -141,6 +141,7 @@ accounts provisioning feature of the service." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "jami") (test-assert "service is running" @@ -341,8 +342,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 a7cde1f1632..c45c2d297c2 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 -;;; Copyright © 2017, 2018, 2020 Ludovic Courtès +;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2018 Christopher Baines ;;; @@ -135,6 +135,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "cgit") ;; XXX: Shepherd reads the config file *before* binding its control @@ -210,8 +211,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)) @@ -273,6 +273,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "git-http") ;; Wait for nginx to be up and running. @@ -302,8 +303,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)) @@ -370,6 +370,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "gitolite") ;; Wait for sshd to be up and running. @@ -410,8 +411,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)) @@ -475,6 +475,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "gitile") ;; XXX: Shepherd reads the config file *before* binding its control @@ -540,8 +541,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 9f9d3a5e269..73f19db4e54 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 -;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Pierre Langlois ;;; @@ -76,6 +76,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "libvirt") (test-assert "service running" @@ -107,8 +108,7 @@ "-c" "qemu:///system" "connect")) marionette)) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + (test-end)))) (gexp->derivation "libvirt-test" test)) @@ -196,6 +196,7 @@ (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "childhurd") (test-assert "service running" @@ -250,8 +251,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 518c9c1ff37..c9b6f17f074 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2020 Ludovic Courtès +;;; Copyright © 2017, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2019 Christopher Baines ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2018 Pierre-Antoine Rouby @@ -116,6 +116,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin #$name) (test-assert #$(string-append name " service running") @@ -150,8 +151,7 @@ HTTP-PORT." marionette))) '()) - (test-end) - (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + (test-end)))) (gexp->derivation (string-append name "-test") test)) @@ -312,6 +312,7 @@ HTTP-PORT, along with php-fpm." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "php-fpm") (test-assert "php-fpm running" @@ -350,9 +351,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)) @@ -397,6 +396,7 @@ HTTP-PORT, along with php-fpm." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin #$name) (test-assert "hpcguix-web running" @@ -422,8 +422,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)) @@ -489,6 +488,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "tailon") (test-assert "service running" @@ -512,8 +512,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)) @@ -633,6 +632,7 @@ HTTP-PORT." (mkdir #$output) (chdir #$output) + (test-runner-current (system-test-runner)) (test-begin "patchwork") (test-assert "patchwork-postgresql-user-and-service started" @@ -667,8 +667,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)) -- cgit v1.3 From 89b05442933d92f4b21c3294455a498e8333727d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 26 Sep 2021 23:20:56 +0200 Subject: tests: Reduce boilerplate for users of 'system-test-runner'. * gnu/tests/audio.scm, gnu/tests/base.scm, gnu/tests/ci.scm, gnu/tests/cups.scm, gnu/tests/databases.scm, gnu/tests/desktop.scm, gnu/tests/dict.scm, gnu/tests/docker.scm, gnu/tests/file-sharing.scm, gnu/tests/ganeti.scm, gnu/tests/guix.scm, gnu/tests/ldap.scm, gnu/tests/linux-modules.scm, gnu/tests/mail.scm, gnu/tests/messaging.scm, gnu/tests/monitoring.scm, gnu/tests/networking.scm, gnu/tests/nfs.scm, gnu/tests/package-management.scm, gnu/tests/reconfigure.scm, gnu/tests/rsync.scm, gnu/tests/security-token.scm, gnu/tests/singularity.scm, gnu/tests/ssh.scm, gnu/tests/telephony.scm, gnu/tests/version-control.scm, gnu/tests/virtualization.scm, gnu/tests/web.scm: Remove (mkdir #$output) (chdir #$output) and pass #$output as argument to 'system-test-runner'. --- gnu/tests/audio.scm | 5 +---- gnu/tests/base.scm | 15 +++------------ gnu/tests/ci.scm | 5 +---- gnu/tests/cups.scm | 5 +---- gnu/tests/databases.scm | 15 +++------------ gnu/tests/desktop.scm | 5 +---- gnu/tests/dict.scm | 5 +---- gnu/tests/docker.scm | 10 ++-------- gnu/tests/file-sharing.scm | 5 +---- gnu/tests/ganeti.scm | 5 +---- gnu/tests/guix.scm | 10 ++-------- gnu/tests/ldap.scm | 5 +---- gnu/tests/linux-modules.scm | 5 +---- gnu/tests/mail.scm | 20 ++++---------------- gnu/tests/messaging.scm | 15 +++------------ gnu/tests/monitoring.scm | 10 ++-------- gnu/tests/networking.scm | 30 ++++++------------------------ gnu/tests/nfs.scm | 15 +++------------ gnu/tests/package-management.scm | 5 +---- gnu/tests/reconfigure.scm | 15 +++------------ gnu/tests/rsync.scm | 5 +---- gnu/tests/security-token.scm | 5 +---- gnu/tests/singularity.scm | 5 +---- gnu/tests/ssh.scm | 5 +---- gnu/tests/telephony.scm | 5 +---- gnu/tests/version-control.scm | 20 ++++---------------- gnu/tests/virtualization.scm | 10 ++-------- gnu/tests/web.scm | 25 +++++-------------------- 28 files changed, 57 insertions(+), 228 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm index 0124fa36a0b..8aa6d1e8187 100644 --- a/gnu/tests/audio.scm +++ b/gnu/tests/audio.scm @@ -48,10 +48,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "mpd") (test-assert "service is running" diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 81be8de1cfb..4bc35988743 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -94,10 +94,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)) + (test-runner-current (system-test-runner #$output)) (test-begin "basic") #$(and initialization @@ -642,10 +639,7 @@ in a loop. See .") (define marionette (make-marionette (list #$(virtual-machine os)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "cleanup") (test-assert "dirty service worked" @@ -713,10 +707,7 @@ non-ASCII names from /tmp.") (define marionette (make-marionette (list #$(virtual-machine os)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "mcron") (test-assert "service running" diff --git a/gnu/tests/ci.scm b/gnu/tests/ci.scm index b7970017fcb..5294514c667 100644 --- a/gnu/tests/ci.scm +++ b/gnu/tests/ci.scm @@ -70,10 +70,7 @@ HTTP-PORT." ;; port 8080 in the host. (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "laminar") (test-assert "service running" diff --git a/gnu/tests/cups.scm b/gnu/tests/cups.scm index fd6d87d2bf6..4c7d78b7c85 100644 --- a/gnu/tests/cups.scm +++ b/gnu/tests/cups.scm @@ -54,10 +54,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "cups") ;; Wait for the web interface to become ready. diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm index ba2bb182b92..ead8593854c 100644 --- a/gnu/tests/databases.scm +++ b/gnu/tests/databases.scm @@ -61,10 +61,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "memcached") ;; Wait for memcached to be up and running. @@ -179,10 +176,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "postgresql") (test-assert "service running" @@ -283,10 +277,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "mysql") (test-assert "service running" diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm index 67e530d392d..57069c0edee 100644 --- a/gnu/tests/desktop.scm +++ b/gnu/tests/desktop.scm @@ -43,10 +43,7 @@ (define marionette (make-marionette '(#$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "elogind") ;; Log in as root on tty1, and check what 'loginctl' returns. diff --git a/gnu/tests/dict.scm b/gnu/tests/dict.scm index 51343be7de8..4d9702360c8 100644 --- a/gnu/tests/dict.scm +++ b/gnu/tests/dict.scm @@ -79,10 +79,7 @@ (define %dico-socket (socket PF_INET SOCK_STREAM 0)) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "dicod") ;; Wait for the service to be started. diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index 45b5d375ea9..bc119988b76 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -76,10 +76,7 @@ inside %DOCKER-OS." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "docker") (test-assert "service running" @@ -221,10 +218,7 @@ inside %DOCKER-OS." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "docker") (test-assert "service running" diff --git a/gnu/tests/file-sharing.scm b/gnu/tests/file-sharing.scm index 7dd2a847f0b..d1343e2ebaa 100644 --- a/gnu/tests/file-sharing.scm +++ b/gnu/tests/file-sharing.scm @@ -91,10 +91,7 @@ (port-forwardings `((9091 . ,%transmission-daemon-rpc-port))))))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "transmission-daemon") ;; Make sure the "transmission" user and group have been created. diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index be70d1117a1..6d3f0320369 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -117,10 +117,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "ganeti") ;; Ganeti uses the Shepherd to start/stop daemons, so make sure diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index 7e3bc8c1f5b..69cac7c1aa0 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -74,10 +74,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "guix-build-coordinator") (test-assert "service running" @@ -199,10 +196,7 @@ host all all ::1/128 trust")))))) (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "guix-data-service") (test-assert "service running" diff --git a/gnu/tests/ldap.scm b/gnu/tests/ldap.scm index e149972027b..d5403b35399 100644 --- a/gnu/tests/ldap.scm +++ b/gnu/tests/ldap.scm @@ -69,10 +69,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "ldap") ;; Set up LDAP directory server diff --git a/gnu/tests/linux-modules.scm b/gnu/tests/linux-modules.scm index 200c1510082..69cb0132670 100644 --- a/gnu/tests/linux-modules.scm +++ b/gnu/tests/linux-modules.scm @@ -88,10 +88,7 @@ that MODULES are actually loaded." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "loadable-kernel-modules") (test-assert "script successfully evaluated" (marionette-eval diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm index ae6417c119c..f13751b72fa 100644 --- a/gnu/tests/mail.scm +++ b/gnu/tests/mail.scm @@ -85,10 +85,7 @@ match from any for local action inbound code (read-reply-code port)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "opensmptd") (test-assert "service is running" @@ -230,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "exim") (test-assert "service is running" @@ -338,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "dovecot") ;; Wait for dovecot to be up and running. @@ -489,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "getmail") ;; Wait for dovecot to be up and running. diff --git a/gnu/tests/messaging.scm b/gnu/tests/messaging.scm index db9516a4858..202a1c2f73c 100644 --- a/gnu/tests/messaging.scm +++ b/gnu/tests/messaging.scm @@ -98,10 +98,7 @@ (else (error "file didn't show up" file))))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "xmpp") ;; Wait for XMPP service to be up and running. @@ -191,10 +188,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "bitlbee") (test-assert "service started" @@ -264,10 +258,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "quassel") (test-assert "service started" diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm index 5039e227658..ae0a8e0845e 100644 --- a/gnu/tests/monitoring.scm +++ b/gnu/tests/monitoring.scm @@ -63,10 +63,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin #$name) (test-assert "prometheus-node-exporter running" @@ -165,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin #$name) ;; XXX: Shepherd reads the config file *before* binding its control diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index fc2060b3ec4..cebba7c7ca2 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -104,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "inetd") ;; Make sure the PID file is created. @@ -204,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "openvswitch") ;; Make sure the bridge is created. @@ -304,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "dhcpd") (test-assert "pid file exists" @@ -399,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "tor") ;; Test the usual Tor service. @@ -526,10 +514,7 @@ COMMIT (loop (read-line in))))))))) marionette)) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "iptables") (test-equal "iptables-save dumps the same rules that were loaded" @@ -622,10 +607,7 @@ COMMIT marionette)) (marionette-eval '(use-modules (guix ipfs)) marionette) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "ipfs") ;; Test the IPFS service. diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm index 7b6aa51cac8..7b7dd8c3608 100644 --- a/gnu/tests/nfs.scm +++ b/gnu/tests/nfs.scm @@ -92,10 +92,7 @@ (error "Socket didn't show up: " ,file)))) marionette)) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "rpc-daemon") ;; Wait for the rpcbind daemon to be up and running. @@ -198,10 +195,7 @@ (define marionette (make-marionette (list #$(virtual-machine os)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "nfs-daemon") (marionette-eval '(begin @@ -310,10 +304,7 @@ directories can be mounted.") (use-modules (gnu build marionette) (srfi srfi-64)) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "start-nfs-boot-test") ;;; Start up NFS server host. diff --git a/gnu/tests/package-management.scm b/gnu/tests/package-management.scm index 7033f040dd2..fe897944d0b 100644 --- a/gnu/tests/package-management.scm +++ b/gnu/tests/package-management.scm @@ -60,10 +60,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin #$name) ;; XXX: Shepherd reads the config file *before* binding its control diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm index b97fedcf6bb..2fd7c6854d1 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm @@ -79,10 +79,7 @@ generation of the system profile." entries))) marionette)) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "switch-to-system") (let ((generations-prior (system-generations marionette))) @@ -153,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "upgrade-services") (let ((services-prior (running-services marionette))) @@ -220,10 +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)) + (test-runner-current (system-test-runner #$output)) (test-begin "install-bootloader") (test-assert "no prior menu entry for system generation" diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm index 2227edf30d5..91f2b41cec5 100644 --- a/gnu/tests/rsync.scm +++ b/gnu/tests/rsync.scm @@ -54,10 +54,7 @@ PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "rsync") ;; Wait for rsync to be up and running. diff --git a/gnu/tests/security-token.scm b/gnu/tests/security-token.scm index d28d23a1ae5..07270c0bfd7 100644 --- a/gnu/tests/security-token.scm +++ b/gnu/tests/security-token.scm @@ -44,10 +44,7 @@ (define marionette (make-marionette (list #$(virtual-machine os)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "pcscd") (test-assert "pcscd is alive" diff --git a/gnu/tests/singularity.scm b/gnu/tests/singularity.scm index ac2dec19b8f..f4b9776b48b 100644 --- a/gnu/tests/singularity.scm +++ b/gnu/tests/singularity.scm @@ -72,10 +72,7 @@ (define marionette (make-marionette (list #$(virtual-machine os)))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "singularity") (test-assert "singularity exec /bin/guile (as root)" diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm index 7442bd1c2e7..791ff7b73f4 100644 --- a/gnu/tests/ssh.scm +++ b/gnu/tests/ssh.scm @@ -108,10 +108,7 @@ root with an empty password." ('denied (loop rest))))))))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "ssh-daemon") ;; Wait for sshd to be up and running. diff --git a/gnu/tests/telephony.scm b/gnu/tests/telephony.scm index 2d44d001656..998bdbccf92 100644 --- a/gnu/tests/telephony.scm +++ b/gnu/tests/telephony.scm @@ -138,10 +138,7 @@ accounts provisioning feature of the service." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "jami") (test-assert "service is running" diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index c45c2d297c2..092591f40d5 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -132,10 +132,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "cgit") ;; XXX: Shepherd reads the config file *before* binding its control @@ -270,10 +267,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "git-http") ;; Wait for nginx to be up and running. @@ -367,10 +361,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "gitolite") ;; Wait for sshd to be up and running. @@ -472,10 +463,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "gitile") ;; XXX: Shepherd reads the config file *before* binding its control diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm index 73f19db4e54..628cd0549b1 100644 --- a/gnu/tests/virtualization.scm +++ b/gnu/tests/virtualization.scm @@ -73,10 +73,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "libvirt") (test-assert "service running" @@ -193,10 +190,7 @@ (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "childhurd") (test-assert "service running" diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index c9b6f17f074..dd55aedf05d 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -113,10 +113,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin #$name) (test-assert #$(string-append name " service running") @@ -309,10 +306,7 @@ HTTP-PORT, along with php-fpm." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "php-fpm") (test-assert "php-fpm running" @@ -393,10 +387,7 @@ HTTP-PORT, along with php-fpm." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin #$name) (test-assert "hpcguix-web running" @@ -485,10 +476,7 @@ HTTP-PORT." ;; port 8080 in the host. (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "tailon") (test-assert "service running" @@ -629,10 +617,7 @@ HTTP-PORT." (define marionette (make-marionette (list #$vm))) - (mkdir #$output) - (chdir #$output) - - (test-runner-current (system-test-runner)) + (test-runner-current (system-test-runner #$output)) (test-begin "patchwork") (test-assert "patchwork-postgresql-user-and-service started" -- cgit v1.3 From 502925655d1a51aad544804c8ef492a5d24e1776 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 27 Sep 2021 19:22:56 +0000 Subject: services: database: Change postgresql default socket. Adapt to the postgresql default socket directory set to /var/run/postgresql. * gnu/services/databases.scm ()[socket-directory]: Set to /var/run/postgresql. (): Ditto. * gnu/tests/databases.scm (run-postgresql-test): Adapt it. --- gnu/services/databases.scm | 4 ++-- gnu/tests/databases.scm | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index eba88cdb68c..8d266c1cba7 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -116,7 +116,7 @@ host all all ::1/128 md5")) (ident-file postgresql-config-file-ident-file (default %default-postgres-ident)) (socket-directory postgresql-config-file-socket-directory - (default #false)) + (default "/var/run/postgresql")) (extra-config postgresql-config-file-extra-config (default '()))) @@ -364,7 +364,7 @@ and stores the database cluster in @var{data-directory}." postgresql-role-configuration make-postgresql-role-configuration postgresql-role-configuration? (host postgresql-role-configuration-host ;string - (default "/tmp")) + (default "/var/run/postgresql")) (log postgresql-role-configuration-log ;string (default "/var/log/postgresql_roles.log")) (roles postgresql-role-configuration-roles diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm index ead8593854c..a20de1a8c79 100644 --- a/gnu/tests/databases.scm +++ b/gnu/tests/databases.scm @@ -228,8 +228,7 @@ (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) -- cgit v1.3 From d27e871ebb4ca84e291782c8d875976e921deccc Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 27 Sep 2021 20:07:16 +0000 Subject: tests: base: Fix the screendump test. * gnu/tests/base.scm (run-basic-test): Look for the screendump capture where it has been saved, in the output directory. --- gnu/tests/base.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 4bc35988743..9198a3e2676 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -484,10 +484,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 -- cgit v1.3 From 5ec0c48fd457c9f68f0cbaa3b7dec9dc780b17ae Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 6 Oct 2021 07:18:01 +0000 Subject: tests: gitile: Increase VM memory size. * gnu/tests/version-control.scm (run-gitile-test): Increase memory size to 1024 MiB. --- gnu/tests/version-control.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/tests') diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index 092591f40d5..fd3dba88ba0 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -449,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)) -- cgit v1.3 From 8c801194b548d1f2d6f47dfcdd5611ae72e29759 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 12 Oct 2021 14:01:56 -0400 Subject: gnu: glibc: Look for the current timezone in /etc/localtime. Fixes . Reported by podiki on #guix. Previously, glibc 2.33 would look for /gnu/store/...-glibc-2.33/etc/localtime instead of /etc/localtime. * gnu/packages/base.scm (glibc)[arguments]: Remove #:make-flags. [phases]: In 'pre-configure', modify 'inet/Makefile' instead of 'sunrpc/Makefile' since this is where these bits are in 2.33. (glibc-2.31)[arguments]: Add 'set-etc-rpc-installation-directory' phase. (glibc-2.30): Inherit from GLIBC-2.31. * gnu/tests/base.scm (run-basic-test)["libc honors /etc/localtime"]: New test. Signed-off-by: Maxim Cournoyer --- gnu/packages/base.scm | 25 ++++++++++++++++--------- gnu/tests/base.scm | 11 +++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 9c45f524dc4..68f238a2fed 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -775,11 +775,6 @@ the store.") '("--disable-werror") '())) - ;; Arrange so that /etc/rpc & co. go to $out/etc. - #:make-flags (list (string-append "sysconfdir=" - (assoc-ref %outputs "out") - "/etc")) - #:tests? #f ; XXX #:phases (modify-phases %standard-phases (add-before @@ -793,8 +788,7 @@ the store.") (bash (or (assoc-ref inputs "static-bash") (assoc-ref native-inputs "static-bash")))) ;; Install the rpc data base file under `$out/etc/rpc'. - ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ]; - (substitute* "sunrpc/Makefile" + (substitute* "inet/Makefile" (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix) (string-append out "/etc/rpc" suffix "\n")) (("^install-others =.*$") @@ -950,11 +944,24 @@ with the Linux kernel.") "glibc-2.31-hurd-clock_gettime_monotonic.patch" "glibc-hurd-signal-sa-siginfo.patch" "glibc-hurd-mach-print.patch" - "glibc-hurd-gettyent.patch")))))) + "glibc-hurd-gettyent.patch")))) + (arguments + (substitute-keyword-arguments (package-arguments glibc) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'configure 'set-etc-rpc-installation-directory + (lambda* (#:key outputs #:allow-other-keys) + ;; Install the rpc data base file under `$out/etc/rpc'. + (let ((out (assoc-ref outputs "out"))) + (substitute* "sunrpc/Makefile" + (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix) + (string-append out "/etc/rpc" suffix "\n")) + (("^install-others =.*$") + (string-append "install-others = " out "/etc/rpc\n")))))))))))) (define-public glibc-2.30 (package - (inherit glibc) + (inherit glibc-2.31) (version "2.30") (native-inputs ;; This fails with a build error in libc-tls.c when using GCC 10. Use an diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 9198a3e2676..38d4317e526 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)) @@ -196,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 ; (begin -- cgit v1.3 From 4efc08d895274ee39e6e6e5c49121fb05a0281b6 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 23 Nov 2021 08:37:58 +0000 Subject: tests: Fix installation tests. Use a CEST timezone as this is the assumed timezone in the run-basic-test procedure. * gnu/tests/install.scm (%encrypted-root-not-boot-os, %btrfs-root-on-subvolume-os): Use a CEST timezone. --- gnu/tests/install.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 38785ae0bdb..a4b8b6655cc 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) -- cgit v1.3 From 05c747ea6bdffd6b9c425c7f8b3d3860ae3d7861 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 1 Dec 2021 19:20:24 +0100 Subject: tests: install: Use the swap-space record. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following error: In gnu/services/base.scm: 2228:56 4 (_ #< type: dce bv: #vu8(17 17 17 17 34 34 51 51 …>) In gnu/build/file-systems.scm: 239:13 3 (swap-space->flags-bit-mask #< type: dce bv: #vu8…>) In ice-9/boot-9.scm: 1685:16 2 (raise-exception _ #:continuable? _) 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure swap-space-priority: Wrong type argument: #< type: dce bv: #vu8(17 17 17 17 34 34 51 51 68 68 18 52 86 120 154 188)> * gnu/tests/install.scm (installation-target-os-for-gui-tests): Use the swap-space record. --- gnu/tests/install.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index a4b8b6655cc..9602efebe7e 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -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))))) -- cgit v1.3