summary refs log tree commit diff
path: root/tests/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-11-25 17:22:32 +0100
committerLudovic Courtès <ludo@gnu.org>2017-11-25 18:12:33 +0100
commit4aac8d059a2bec9f075ceea2a089ca029a71912c (patch)
tree656bad9689f011168a30e8be4c6d2ce43c62bc0c /tests/syscalls.scm
parent1e0ea1d8dfa0d17e4451f71f17d34541738ec0c6 (diff)
downloadguix-4aac8d059a2bec9f075ceea2a089ca029a71912c.tar.gz
syscalls: Adjust utmpx test.
Fixes <https://bugs.gnu.org/29426>.
Reported by Adonay Felipe Nogueira <adfeno@hyperbola.info>.

* tests/syscalls.scm ("utmpx-entries"): Check the value
of (utmpx-entries entry) only for INIT_PROCESS, LOGIN_PROCESS, and
USER_PROCESS entries.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r--tests/syscalls.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 2b5c4c3be1..22ca2a05d4 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -525,7 +525,12 @@
      (every (lambda (entry)
               (match (utmpx-user entry)
                 ((? string?)
-                 (or (eqv? (login-type BOOT_TIME) (utmpx-login-type entry))
+                 ;; Ensure we have a valid PID for those entries where it
+                 ;; makes sense.
+                 (or (not (memv (utmpx-login-type entry)
+                                (list (login-type INIT_PROCESS)
+                                      (login-type LOGIN_PROCESS)
+                                      (login-type USER_PROCESS))))
                      (> (utmpx-pid entry) 0)))
                 (#f                               ;might be DEAD_PROCESS
                  #t)))