me
/
guix
Archived
1
0
Fork 0

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'.
master
Ludovic Courtès 2021-09-26 23:20:56 +02:00
parent 7d72829448
commit 89b0544293
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
28 changed files with 57 additions and 228 deletions

View File

@ -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"

View File

@ -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 <http://bugs.gnu.org/26931>.")
(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"

View File

@ -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"

View File

@ -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.

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -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"

View File

@ -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.

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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"

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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"

View File

@ -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)"

View File

@ -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.

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"