Hi Bruno, Bruno Haible <br...@clisp.org> writes:
> Err. I disagree with that. When we have a test failure, the first step is > to look at POSIX ([1] in this case). It says "These functions shall fail if: > ...[ENOTDIR]" which catches this case. So, it's a bug in Hurd. > > Then, there are three possibilities: > > A. Relax the test. > B. Report a bug and relax the test. > C. Report a bug and keep the test as is, failing until the bug gets > corrected. > > Option A has only a benefit for continuous integrations. Other than that, > there is no need to bring test failure counts to 0 when they indicate actual > bugs. > > Whereas B and C have a lasting positive effect on the users of that OS (Hurd > in this case). > > Since Hurd is in active development, my preference is for C (as already > indicated a couple of days ago [2]). Thanks for the explanations, that makes sense. Originally, I was thinking option B. But you are right, since we don't have Hurd CI, relaxing the test to bring the fail count down isn't that helpful. I've filed the bug report in glibc under the Hurd component so hopefully it will get fixed [1]. In the meantime, I have pushed the attached patch restoring the test to its original state. And documented the bug so one, after manually testing, can see the failure is expected. Collin [1] https://sourceware.org/bugzilla/show_bug.cgi?id=32569
>From 82c416d7aec0a8bd52fa8c3b6c1b2cc589b407fb Mon Sep 17 00:00:00 2001 From: Collin Funk <collin.fu...@gmail.com> Date: Sat, 18 Jan 2025 18:00:55 -0800 Subject: [PATCH] linkat tests: Revert the last change. * tests/test-linkat.c (main): Disallow EINVAL an alternative error value. * doc/posix-functions/linkat.texi: Document the GNU/Hurd bug. --- ChangeLog | 5 +++++ doc/posix-functions/linkat.texi | 6 ++++++ tests/test-linkat.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19332fa253..2057a6da9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2025-01-18 Collin Funk <collin.fu...@gmail.com> + linkat tests: Revert the last change. + * tests/test-linkat.c (main): Disallow EINVAL an alternative error + value. + * doc/posix-functions/linkat.texi: Document the GNU/Hurd bug. + linkat tests: Avoid failure on GNU/Hurd. * tests/test-linkat.c (main): Allow EINVAL an alternative error value. diff --git a/doc/posix-functions/linkat.texi b/doc/posix-functions/linkat.texi index 2c2eeb0e94..ceeddaff6c 100644 --- a/doc/posix-functions/linkat.texi +++ b/doc/posix-functions/linkat.texi @@ -27,4 +27,10 @@ @node linkat Portability problems not fixed by Gnulib: @itemize +@item +@code{linkat (fd, "directory", fd, "symlink/" ...)} sets @code{errno} +to @code{EINVAL} instead of @code{EEXIST} or @code{ENOTDIR} on some +platforms: +@c https://sourceware.org/bugzilla/show_bug.cgi?id=32569 +GNU/Hurd. @end itemize diff --git a/tests/test-linkat.c b/tests/test-linkat.c index 80e7222c43..5fd2e37ebf 100644 --- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -223,7 +223,7 @@ main (void) ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1/", 0) == -1); - ASSERT (errno == EEXIST || errno == ENOTDIR || errno == EINVAL); + ASSERT (errno == EEXIST || errno == ENOTDIR); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1", AT_SYMLINK_FOLLOW) == -1); -- 2.48.1