coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-9.4.170-7b206 ls/removed-directory test failure


From: Pádraig Brady
Subject: Re: coreutils-9.4.170-7b206 ls/removed-directory test failure
Date: Tue, 26 Mar 2024 18:43:47 +0000
User-agent: Mozilla Thunderbird

On 26/03/2024 18:25, Bruno Haible wrote:
Pádraig Brady wrote:
The ls/removed-directory test fails on FreeBSD 14.0.

tests-suite.log from FreeBSD 14.0:


FAIL: tests/ls/removed-directory
================================

diff -u /dev/null err
--- /dev/null   1970-01-01
+++ err 1970-01-01
+ls: reading directory '.': No such file or directory
FAIL tests/ls/removed-directory.sh (exit status: 1)

It seems that readdir() on FreeBSD 14 is _not_ eating the ENOENT from 
getdirentries().
Attached is an extra check for that, that avoids the test in that case.

This patch is not good:

   - It skips the test on all platforms that don't have 'python' in $PATH.
     (Nowadays more platforms have 'python3'. The old name 'python' is not
     present on all platforms that have 'python3'.)

Right, all _non linux_ platforms.
Good call re python3. In init.cfg I previously set $PYTHON with:

  { python3 < /dev/null && PYTHON_=python3; } ||
  { python  < /dev/null && PYTHON_=python; }

I should refactor that out at some stage.

   - On FreeBSD 14.0, in an empty directory:
     $ python3.9 -c 'import os; os.listdir(".")'
     succeeds (exit code 0). In detail:
     $ python3.9
     >>> import os
     >>> os.listdir(".")
     []
     Conclusion: The python test does *not* actually test what you meant
     to test.

Note it's testing for _deleted_ dirs, not empty dirs.
I.e. it wants to exit failure in the unhandled errno case.
It did seems to work for me when testing on Linux and FreeBSD 14 at least.
I.e. the following failed (skipped) on FreeBSD 14:

  (mkdir d && cd d && rmdir ../d && python3 -c 'import os; os.listdir(".")')

Anyway all this is moot as I'm adjusting ls,
rather than applying this patch to the test.

cheers,
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]