summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-12-19 15:51:59 +0100
committerLudovic Courtès <ludo@gnu.org>2024-12-28 22:32:38 +0100
commit5c9029dc79027a156aceb86b38d9fd9abb3cdaa4 (patch)
treefc6baf18f65721a754db485bab325be23c780c9f /tests
parent5b8c19c2089c18a98eed87a10a303d24ea9666db (diff)
syscalls: Add ‘kexec-load-file’.
* guix/build/syscalls.scm (string->utf-8/nul-terminated) (kexec-load-file): New procedures. * tests/syscalls.scm ("kexec-load-file"): New test. Change-Id: I3724226a14ecc07f346e77519fb5b0591096c7f6
Diffstat (limited to 'tests')
-rw-r--r--tests/syscalls.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 13f4f11721..eef864d097 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -679,6 +679,19 @@
(lambda args
(system-error-errno args))))))
+(when (or (zero? (getuid))
+ (not (string-contains %host-type "linux")))
+ (test-skip 1))
+(test-equal "kexec-load-file"
+ EPERM
+ (catch 'system-error
+ (lambda ()
+ (let ((fd1 (open-fdes "/dev/null" O_RDONLY))
+ (fd2 (open-fdes "/dev/null" O_RDONLY)))
+ (kexec-load-file fd1 fd2 "gnu.repl=yes")))
+ (lambda args
+ (system-error-errno args))))
+
(test-end)
(false-if-exception (delete-file temp-file))