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'.
This commit is contained in:
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 test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define marionette
;; 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 test
(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 test
(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 test
(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 test
(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 test
(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 marionette
(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 @@ (define test
(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 @@ (define test
(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 @@ (define marionette
(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 test
(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 test
(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 @@ (define test
(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 test
(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 @@ (define (test script)
(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 @@ (define (read-reply-code port)
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 @@ (define (read-reply-code port)
(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 @@ (define* (message-length message #:key (encoding "iso-8859-1"))
(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 @@ (define* (message-length message #:key (encoding "iso-8859-1"))
(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 @@ (define (host-wait-for-file file)
(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 test
(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 test
(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 test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define (tor-is-alive? marionette)
(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 @@ (define (dump-iptables iptables-save marionette)
(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 @@ (define (read-contents object)
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 @@ (define (wait-for-socket file)
(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 test
(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 @@ (define test
(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 test
(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 @@ (define (system-generations marionette)
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 @@ (define (running-services marionette)
(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 @@ (define (generations-in-grub-cfg marionette)
(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 @@ (define test
(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 test
(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 test
(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 @@ (define (call-with-connected-session/auth proc)
('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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 test
(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 test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define test
(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 @@ (define marionette
;; 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 @@ (define test
(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"