diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-01-19 23:21:25 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-01-19 23:21:25 +0100 |
| commit | 150309726f221c9b982e594466d35f5b895391d5 (patch) | |
| tree | c5a90ba7c20b498378f69dd4668e120e258e413c /tests/syscalls.scm | |
| parent | 57f068bec5349e250ce321262609ca8978a81f7f (diff) | |
syscalls: Add utmpx procedures and data structure.
* guix/build/syscalls.scm (<utmpx-entry>): New record type.
(%utmpx): New C struct.
(login-type): New bits.
(setutxent, endutxent, getutxent, utmpx-entries): New procedures.
Diffstat (limited to 'tests/syscalls.scm')
| -rw-r--r-- | tests/syscalls.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index e4ef32c522c..fb2c8e71004 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> | 3 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -441,6 +441,17 @@ | |||
| 441 | (> (terminal-columns (open-input-string "Join us now, share the software!")) | 441 | (> (terminal-columns (open-input-string "Join us now, share the software!")) |
| 442 | 0)) | 442 | 0)) |
| 443 | 443 | ||
| 444 | (test-assert "utmpx-entries" | ||
| 445 | (match (utmpx-entries) | ||
| 446 | (((? utmpx? entries) ...) | ||
| 447 | (every (lambda (entry) | ||
| 448 | (match (utmpx-user entry) | ||
| 449 | ((? string?) | ||
| 450 | (> (utmpx-pid entry) 0)) | ||
| 451 | (#f ;might be DEAD_PROCESS | ||
| 452 | #t))) | ||
| 453 | entries)))) | ||
| 454 | |||
| 444 | (test-end) | 455 | (test-end) |
| 445 | 456 | ||
| 446 | (false-if-exception (delete-file temp-file)) | 457 | (false-if-exception (delete-file temp-file)) |
