aboutsummaryrefslogtreecommitdiff
path: root/tests/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-10-05 21:54:31 +0200
committerLudovic Courtès <ludo@gnu.org>2019-10-05 22:05:02 +0200
commit5e5f7167943b408ae55736a44908a82056c87780 (patch)
treeb62ed56427ad1274b05edc2a4d995263034b62a9 /tests/syscalls.scm
parentaace6f6dba3a0e7dd46146f5c7947b11e1076e5d (diff)
downloadguix-5e5f7167943b408ae55736a44908a82056c87780.tar
guix-5e5f7167943b408ae55736a44908a82056c87780.tar.gz
syscalls: Add 'add-to-entropy-count'.
* guix/build/syscalls.scm (RNDADDTOENTCNT): New variable. (add-to-entropy-count): New procedure. * tests/syscalls.scm ("add-to-entropy-count"): New test.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r--tests/syscalls.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index eeb223b950..1b3121e503 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -567,6 +567,19 @@
(let ((result (call-with-input-file "/var/run/utmpx" read-utmpx)))
(or (utmpx? result) (eof-object? result))))
+(when (zero? (getuid))
+ (test-skip 1))
+(test-equal "add-to-entropy-count"
+ EPERM
+ (call-with-output-file "/dev/urandom"
+ (lambda (port)
+ (catch 'system-error
+ (lambda ()
+ (add-to-entropy-count port 77)
+ #f)
+ (lambda args
+ (system-error-errno args))))))
+
(test-end)
(false-if-exception (delete-file temp-file))