bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* rename, renameat, renameatu: Fix test failures on Android/Termux
@ 2023-01-11 17:27 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2023-01-11 17:27 UTC (permalink / raw)
  To: bug-gnulib

Similar tests failures are seen on Android 11 with Termux:

FAIL: test-rename
=================

link: Permission denied
FAIL test-rename (exit status: 1)

FAIL: test-renameat
===================

link: Permission denied
../../gltests/test-rename.h:80: assertion 'mkdir (BASE "dir", 0700) == 0' failed
Aborted
FAIL test-renameat (exit status: 134)

FAIL: test-renameatu
====================

link: Permission denied
../../gltests/test-rename.h:80: assertion 'mkdir (BASE "dir", 0700) == 0' failed
Aborted
FAIL test-renameatu (exit status: 134)

The workaround is the same: Mark these tests as SKIPped.


2023-01-11  Bruno Haible  <bruno@clisp.org>

	rename, renameat, renameatu: Fix test failures on Android/Termux.
	* tests/test-rename.h (test_rename): On Android, treat an EACCES failure
	like EPERM.

diff --git a/tests/test-rename.h b/tests/test-rename.h
index 0b8ed7255c..37b1b67cac 100644
--- a/tests/test-rename.h
+++ b/tests/test-rename.h
@@ -499,11 +499,16 @@ test_rename (int (*func) (char const *, char const *), bool print)
     if (ret == -1)
       {
         /* If the device does not support hard links, errno is
-           EPERM on Linux, EOPNOTSUPP on FreeBSD.  */
+           EPERM on Linux,
+           EOPNOTSUPP on FreeBSD,
+           EACCES on Android within Termux.  */
         switch (errno)
           {
           case EPERM:
           case EOPNOTSUPP:
+          #if defined __ANDROID__
+          case EACCES:
+          #endif
             if (print)
               fputs ("skipping test: "
                      "hard links not supported on this file system\n",





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-11 17:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 17:27 rename, renameat, renameatu: Fix test failures on Android/Termux Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).