summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2025-11-07 18:29:16 +0100
committerMathieu Othacehe <othacehe@gnu.org>2025-11-08 11:26:14 +0100
commit6aded64869207aa7402e5c301fbe7086ceb8e631 (patch)
tree8124bf1c663ef8336b417e93953d12c3df75ab70 /gnu
parentcdcfa598645f820dda108aa6a208ccccb3c5a1e5 (diff)
gnu: tests: Fix opensmtpd.
The test has two issues: - it uses /var/spool/mail instead of /var/mail - the client often takes more than 30 seconds to connect to the smtpd server, because the server tries to perform name resolution on 10.0.2.3 * gnu/tests/mail.scm (%qemu-static-networking-no-nameserver): New variable. (%opensmtpd-os): Use it instead of the dhcpcd-service-type service. (run-opensmtpd-test): Use /var/mail instead of /var/spool/mail. Fixes: guix/guix#3978 Change-Id: I429edbf2460f380f8a617ee1fccd145f34a1f3d6
Diffstat (limited to 'gnu')
-rw-r--r--gnu/tests/mail.scm22
1 files changed, 18 insertions, 4 deletions
diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm
index 389bb4b1569..ff9c3a690c1 100644
--- a/gnu/tests/mail.scm
+++ b/gnu/tests/mail.scm
@@ -44,9 +44,23 @@
%test-getmail
%test-rspamd))
+(define %qemu-static-networking-no-nameserver
+ ;; Networking configuration for QEMU without nameserver.
+ (static-networking
+ (addresses (list (network-address
+ (device "eth0")
+ (value "10.0.2.15/24"))))
+ (routes (list (network-route
+ (destination "default")
+ (gateway "10.0.2.2"))))
+ (requirement '())
+ (provision '(networking))
+ (name-servers '())))
+
(define %opensmtpd-os
(simple-operating-system
- (service dhcpcd-service-type)
+ (service static-networking-service-type
+ (list %qemu-static-networking-no-nameserver))
(service opensmtpd-service-type
(opensmtpd-configuration
(config-file
@@ -99,8 +113,8 @@ match from any for local action inbound
(test-assert "mbox is empty"
(marionette-eval
- '(and (file-exists? "/var/spool/mail")
- (not (file-exists? "/var/spool/mail/root")))
+ '(and (file-exists? "/var/mail")
+ (not (file-exists? "/var/mail/root")))
marionette))
(test-eq "accept an email"
@@ -150,7 +164,7 @@ match from any for local action inbound
(let wait ((n 20))
(cond ((queue-empty?)
- (file-exists? "/var/spool/mail/root"))
+ (file-exists? "/var/mail/root"))
((zero? n)
(error "root mailbox didn't show up"))
(else