summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-03-25 16:51:59 +0100
committerLudovic Courtès <ludo@gnu.org>2025-04-20 18:50:51 +0200
commitc990405607f3692420ed94e75a7046feff3e28ce (patch)
tree0c98e41a457f929795c7e1119b9da1e511912116 /tests
parent78f493dcf82b37c4147f303c4fef8140640d56f2 (diff)
syscalls: Add ‘unshare’.
* guix/build/syscalls.scm (unshare): New procedure. Change-Id: I344273b8bdeaa9366334e6e20ee7efc37eb6c8f7
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 d2848879d7..879c3e4f25 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -149,6 +149,15 @@
((_ . status)
(= 42 (status:exit-val status))))))))
+(test-equal "unshare"
+ EPERM
+ ;; Unless running as root, (unshare CLONE_NEWNS) returns EPERM.
+ (catch 'system-error
+ (lambda ()
+ (unshare CLONE_NEWNS))
+ (lambda args
+ (system-error-errno args))))
+
(unless perform-container-tests?
(test-skip 1))
(test-assert "setns"