summaryrefslogtreecommitdiff
path: root/gnu/tests/base.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/tests/base.scm')
-rw-r--r--gnu/tests/base.scm45
1 files changed, 24 insertions, 21 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 9429a10b75..38d4317e52 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))
@@ -94,9 +95,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 #$output))
(test-begin "basic")
#$(and initialization
@@ -198,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 ;<https://bugs.gnu.org/40405>
(begin
@@ -486,10 +495,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
@@ -505,8 +515,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))
@@ -642,9 +651,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 #$output))
(test-begin "cleanup")
(test-assert "dirty service worked"
@@ -657,8 +664,7 @@ in a loop. See <http://bugs.gnu.org/26931>.")
(scandir "/tmp"))
marionette))
- (test-end)
- (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+ (test-end))))
(gexp->derivation "cleanup" test))
@@ -713,9 +719,7 @@ non-ASCII names from /tmp.")
(define marionette
(make-marionette (list #$(virtual-machine os))))
- (mkdir #$output)
- (chdir #$output)
-
+ (test-runner-current (system-test-runner #$output))
(test-begin "mcron")
(test-assert "service running"
@@ -752,8 +756,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 +827,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 +906,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))