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  <br...@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",




Reply via email to