mothacehe pushed a commit to branch master
in repository guix.
commit ea924134f819eef072ba7df9080d39de97fd73e6
Author: Mathieu Othacehe <[email protected]>
AuthorDate: Fri Jun 5 12:28:12 2020 +0200
tests: syscall: Support file-systems without extended attributes.
* tests/syscalls.scm (setxattr): Catch ENOTSUP that can be raised if the
file-system does not support extended user attributes.
---
tests/syscalls.scm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 6098a09..6acaa0b 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès
<[email protected]>
;;; Copyright © 2015 David Thompson <[email protected]>
;;; Copyright © 2020 Simon South <[email protected]>
+;;; Copyright © 2020 Mathieu Othacehe <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -276,8 +277,14 @@
(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)))
+ (catch 'system-error
+ (lambda ()
+ (setxattr temp-file key value)
+ (string=? (getxattr temp-file key) value))
+ (lambda args
+ ;; Accept ENOTSUP, if the file-system does not support extended user
+ ;; attributes.
+ (memv (system-error-errno args) (list ENOTSUP))))))
(false-if-exception (delete-file temp-file))
(test-equal "fcntl-flock wait"