summaryrefslogtreecommitdiff
path: root/gnu/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests')
-rw-r--r--gnu/tests/mail.scm29
-rw-r--r--gnu/tests/networking.scm4
-rw-r--r--gnu/tests/nfs.scm36
-rw-r--r--gnu/tests/rsync.scm4
4 files changed, 30 insertions, 43 deletions
diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm
index 298918b3a7..a50fb1dbca 100644
--- a/gnu/tests/mail.scm
+++ b/gnu/tests/mail.scm
@@ -99,8 +99,8 @@ match from any for local action inbound
(test-assert "mbox is empty"
(marionette-eval
- '(and (file-exists? "/var/mail")
- (not (file-exists? "/var/mail/root")))
+ '(and (file-exists? "/var/spool/mail")
+ (not (file-exists? "/var/spool/mail/root")))
marionette))
(test-eq "accept an email"
@@ -140,16 +140,21 @@ match from any for local action inbound
(ice-9 rdelim))
(define (queue-empty?)
- (eof-object?
- (read-line
- (open-input-pipe
- (string-append #$(file-append opensmtpd "/sbin/smtpctl")
- " show queue")))))
-
- (let wait ()
- (if (queue-empty?)
- (file-exists? "/var/mail/root")
- (begin (sleep 1) (wait)))))
+ (let* ((pipe (open-pipe* OPEN_READ
+ #$(file-append opensmtpd
+ "/sbin/smtpctl")
+ "show" "queue"))
+ (line (read-line pipe)))
+ (close-pipe pipe)
+ (eof-object? line)))
+
+ (let wait ((n 20))
+ (cond ((queue-empty?)
+ (file-exists? "/var/spool/mail/root"))
+ ((zero? n)
+ (error "root mailbox didn't show up"))
+ (else
+ (sleep 1) (wait (- n 1))))))
marionette))
(test-end)
diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm
index d1234442bb..e90b247883 100644
--- a/gnu/tests/networking.scm
+++ b/gnu/tests/networking.scm
@@ -270,11 +270,11 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
(dhcpd-configuration
(config-file minimal-dhcpd-v4-config-file)
(version "4")
- (interfaces '("eth0"))))
+ (interfaces '("ens3"))))
(define %dhcpd-os
(simple-operating-system
- (static-networking-service "eth0" "192.168.1.4"
+ (static-networking-service "ens3" "192.168.1.4"
#:netmask "255.255.255.0"
#:gateway "192.168.1.1"
#:name-servers '("192.168.1.2" "192.168.1.3"))
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index 014d049ab5..00109b752e 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 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -101,6 +101,10 @@
(marionette-eval
'(begin
(use-modules (gnu services herd))
+
+ ;; Ensure 'rpcinfo' can be found below.
+ (setenv "PATH" "/run/current-system/profile/bin")
+
(start-service 'rpcbind-daemon))
marionette))
@@ -192,18 +196,6 @@
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (define (wait-for-file file)
- ;; Wait until FILE exists in the guest
- (marionette-eval
- `(let loop ((i 10))
- (cond ((file-exists? ,file)
- #t)
- ((> i 0)
- (sleep 1)
- (loop (- i 1)))
- (else
- (error "File didn't show up: " ,file))))
- marionette))
(mkdir #$output)
(chdir #$output)
@@ -227,22 +219,8 @@
marionette))
(test-assert "nscd is listening on its socket"
- (marionette-eval
- ;; XXX: Work around a race condition in nscd: nscd creates its
- ;; PID file before it is listening on its socket.
- '(let ((sock (socket PF_UNIX SOCK_STREAM 0)))
- (let try ()
- (catch 'system-error
- (lambda ()
- (connect sock AF_UNIX "/var/run/nscd/socket")
- (close-port sock)
- (format #t "nscd is ready~%")
- #t)
- (lambda args
- (format #t "waiting for nscd...~%")
- (usleep 500000)
- (try)))))
- marionette))
+ (wait-for-unix-socket "/var/run/nscd/socket"
+ marionette))
(test-assert "network is up"
(marionette-eval
diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm
index 096580022f..24e60d9d9d 100644
--- a/gnu/tests/rsync.scm
+++ b/gnu/tests/rsync.scm
@@ -64,6 +64,10 @@ PORT."
(marionette-eval
'(begin
(use-modules (gnu services herd))
+
+ ;; Make sure the 'rsync' command is found.
+ (setenv "PATH" "/run/current-system/profile/bin")
+
(start-service 'rsync))
marionette))