summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-06-05 12:28:12 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-06-05 19:20:23 +0200
commitea924134f819eef072ba7df9080d39de97fd73e6 (patch)
tree789db0310ca53f4332e4a4218aa8e4bd244f3632 /tests
parent1f9999df4a104558454d36d4aab821c9d5c631fd (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/syscalls.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 6098a094374..6acaa0b1315 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -2,6 +2,7 @@
2;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2015 David Thompson <davet@gnu.org> 3;;; Copyright © 2015 David Thompson <davet@gnu.org>
4;;; Copyright © 2020 Simon South <simon@simonsouth.net> 4;;; Copyright © 2020 Simon South <simon@simonsouth.net>
5;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
5;;; 6;;;
6;;; This file is part of GNU Guix. 7;;; This file is part of GNU Guix.
7;;; 8;;;
@@ -276,8 +277,14 @@
276 (let ((key "user.translator") 277 (let ((key "user.translator")
277 (value "/hurd/pfinet\0") 278 (value "/hurd/pfinet\0")
278 (file (open-file temp-file "w0"))) 279 (file (open-file temp-file "w0")))
279 (setxattr temp-file key value) 280 (catch 'system-error
280 (string=? (getxattr temp-file key) value))) 281 (lambda ()
282 (setxattr temp-file key value)
283 (string=? (getxattr temp-file key) value))
284 (lambda args
285 ;; Accept ENOTSUP, if the file-system does not support extended user
286 ;; attributes.
287 (memv (system-error-errno args) (list ENOTSUP))))))
281 288
282(false-if-exception (delete-file temp-file)) 289(false-if-exception (delete-file temp-file))
283(test-equal "fcntl-flock wait" 290(test-equal "fcntl-flock wait"