1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

filesys.test: skip copy-file EACCES test when root

Accidentally omitted from b3b7477128.

* test-suite/tests/filesys.test: skip copy-file EACCES test when root.
This commit is contained in:
Rob Browning 2025-03-20 12:44:33 -05:00
parent 4f39181b2f
commit 4527371d1b

View file

@ -62,13 +62,14 @@
(copy-file src dest)
(pass-if-equal "copy-file dest content" msg
(call-with-input-file dest get-string-all)))
(with-test-prefix "read only dest"
(chmod dest #o444)
(with-exception-handler
(λ (ex)
(pass-if-equal "errno is EACCES" EACCES (exception-errno ex)))
(λ () (copy-file src dest))
#:unwind? #t)))))
(unless (zero? (geteuid))
(with-test-prefix "read only dest"
(chmod dest #o444)
(with-exception-handler
(λ (ex)
(pass-if-equal "errno is EACCES" EACCES (exception-errno ex)))
(λ () (copy-file src dest))
#:unwind? #t))))))
;; return next prospective file descriptor number
(define (next-fd)