On 04/23/2013 08:32 AM, Richard W.M. Jones wrote: > > Not looked into this in any detail yet, but just a note that the > getaddrinfo test is now failing in Fedora Rawhide. This failure > started to happen within the last week. > > system error: Connection refused > system error: Connection refused > system error: Connection refused > system error: Connection refused > FAIL: test-getaddrinfo > > Because this is a connection problem, it's remotely possible this has > happened because of a change in Koji (the Fedora build system) which > has no network access. > > Full build log: > http://kojipkgs.fedoraproject.org//work/tasks/180/5290180/build.log > > Versions of things: > http://kojipkgs.fedoraproject.org//work/tasks/180/5290180/root.log > > The version of gnulib is about a month old. I will try a newer one > shortly.
I don't think the test should fail on any system error actually. I.E. stuff external to gnulib. I'll apply the attached soon to address this. I checked the change with: ./gnulib-tool --create-testdir --with-tests --test getaddrinfo thanks, Pádraig.
>From 2b4ef0b9986914a9ba22da20cbfb5e675c459de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com> Date: Tue, 23 Apr 2013 10:01:30 +0100 Subject: [PATCH] test-getaddrinfo: Skip on system errors * tests/test-getaddrinfo.c (simple): Skip the test on system errors, which avoids "system error: Connection refused" failures. Reported by Richard W.M. Jones --- ChangeLog | 5 +++++ tests/test-getaddrinfo.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f49e881..88a6ed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-04-23 Pádraig Brady <p...@draigbrady.com> + + test-getaddrinfo: Skip on system errors + * tests/test-getaddrinfo.c (simple): Skip and diagnose system errors. + 2013-04-11 Dmitry V. Levin <l...@altlinux.org> regex-tests, regex: allow glibc re_search behavior diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c index 1b9892f..30afd9f 100644 --- a/tests/test-getaddrinfo.c +++ b/tests/test-getaddrinfo.c @@ -82,13 +82,18 @@ simple (char const *host, char const *service) if (res != 0) { - /* EAI_AGAIN is returned if no network is available. Don't fail + /* EAI_AGAIN is returned if no network is available. Don't fail the test merely because someone is down the country on their - in-law's farm. */ - if (res == EAI_AGAIN) + in-law's farm. Also skip the test if there is a system error + which can also be due to network connectivity (ECONNREFUSED etc.) */ + if (res == EAI_AGAIN || res == EAI_SYSTEM) { skip++; - fprintf (stderr, "skipping getaddrinfo test: no network?\n"); + fprintf (stderr, "skipping getaddrinfo test: "); + if (res == EAI_AGAIN) + fprintf (stderr, "no network?\n"); + else + fprintf (stderr, "system error: %s\n", strerror (err)); return 77; } /* IRIX reports EAI_NONAME for "https". Don't fail the test @@ -105,9 +110,6 @@ simple (char const *host, char const *service) if (res == EAI_NODATA) return 0; #endif - /* Provide details if errno was set. */ - if (res == EAI_SYSTEM) - fprintf (stderr, "system error: %s\n", strerror (err)); return 1; } -- 1.7.7.6