aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/base.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-01-25 12:42:39 -0500
committerLeo Famulari <leo@famulari.name>2017-01-25 12:42:39 -0500
commitd123f2f991e0bf6f51e5f207d291fb4c1ceb1245 (patch)
tree8ca3cbeff8a08ab9e11a0324fd9ec0bae7614f4c /gnu/tests/base.scm
parenta282d7ff174ccc13b3645359449af6052451c2a1 (diff)
parent864042c5c5f845fd3c1ae37c64dc1a672fedef28 (diff)
downloadgnu-guix-d123f2f991e0bf6f51e5f207d291fb4c1ceb1245.tar
gnu-guix-d123f2f991e0bf6f51e5f207d291fb4c1ceb1245.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/tests/base.scm')
-rw-r--r--gnu/tests/base.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 2687a6cdb8..a725ca90f3 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -194,6 +194,29 @@ info --version")
(utmpx-entries)))
marionette))
+ ;; Likewise for /var/log/wtmp (used by 'last').
+ (test-assert "wtmp entry"
+ (match (marionette-eval
+ '(begin
+ (use-modules (guix build syscalls)
+ (srfi srfi-1))
+
+ (define (entry->list entry)
+ (list (utmpx-user entry) (utmpx-line entry)
+ (utmpx-host entry) (utmpx-login-type entry)))
+
+ (call-with-input-file "/var/log/wtmp"
+ (lambda (port)
+ (let loop ((result '()))
+ (if (eof-object? (peek-char port))
+ (map entry->list (reverse result))
+ (loop (cons (read-utmpx port) result)))))))
+ marionette)
+ (((users lines hosts types) ..1)
+ (every (lambda (type)
+ (eqv? type (login-type LOGIN_PROCESS)))
+ types))))
+
(test-assert "host name resolution"
(match (marionette-eval
'(begin