aboutsummaryrefslogtreecommitdiff
path: root/tests/syscalls.scm
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2020-05-14 00:30:57 +0200
committerJan Nieuwenhuizen <janneke@gnu.org>2020-05-14 00:48:12 +0200
commitdf05842332be80ed7f53022402b95cf711163b41 (patch)
tree8626f5f1eb82a74369cd1269f75dc13603d84c39 /tests/syscalls.scm
parent1a044e3936ac4c1ba1575fe791bf59577b039cf9 (diff)
downloadguix-df05842332be80ed7f53022402b95cf711163b41.tar
guix-df05842332be80ed7f53022402b95cf711163b41.tar.gz
syscalls: Add 'getxattr'.
* guix/build/syscalls.scm (getxattr): New procedure. * tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r--tests/syscalls.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 7fe0cd1545..3823de7c1e 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -271,6 +271,14 @@
(scandir directory (const #t) string<?))))
(false-if-exception (delete-file temp-file))
+(test-assert "getxattr, setxattr"
+ (let ((key "user.translator")
+ (value "/hurd/pfinet\0")
+ (file (open-file temp-file "w0")))
+ (setxattr temp-file key value)
+ (string=? (getxattr temp-file key) value)))
+
+(false-if-exception (delete-file temp-file))
(test-equal "fcntl-flock wait"
42 ; the child's exit status
(let ((file (open-file temp-file "w0b")))