aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-24 00:35:16 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-24 00:46:37 +0100
commit3483f004a98f103acff96effe1309cc620372e79 (patch)
treed88f597f5112645fdc4c4e578c1ae5eeae33e1cb /tests
parent9475fd9217af370839cbfdb06b0a0a9a063d3469 (diff)
downloadguix-3483f004a98f103acff96effe1309cc620372e79.tar
guix-3483f004a98f103acff96effe1309cc620372e79.tar.gz
syscalls: Export 'read-utmpx'.
* guix/build/syscalls.scm (read-utmpx-from-port): New procedure. * tests/syscalls.scm ("read-utmpx, EOF") ("read-utmpx"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/syscalls.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index fb2c8e7100..92e02f3303 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -452,6 +452,15 @@
#t)))
entries))))
+(test-assert "read-utmpx, EOF"
+ (eof-object? (read-utmpx (%make-void-port "r"))))
+
+(unless (access? "/var/run/utmpx" O_RDONLY)
+ (tes-skip 1))
+(test-assert "read-utmpx"
+ (let ((result (call-with-input-file "/var/run/utmpx" read-utmpx)))
+ (or (utmpx? result) (eof-object? result))))
+
(test-end)
(false-if-exception (delete-file temp-file))