[libvirt] [PATCH] gnulib/tests: allow test-getaddrinfo to pass when offline

Sometimes - yes, even in the latter part of the first decade of the twenty first century - one doesn't have access to the Internet while one is hacking. Signed-off-by: Mark McLoughlin <markmc@redhat.com> --- gnulib/tests/test-getaddrinfo.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/gnulib/tests/test-getaddrinfo.c b/gnulib/tests/test-getaddrinfo.c index a887cb1..246021a 100644 --- a/gnulib/tests/test-getaddrinfo.c +++ b/gnulib/tests/test-getaddrinfo.c @@ -64,6 +64,11 @@ int simple (char *host, char *service) if (res != 0) { + /* 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) + return 0; /* IRIX reports EAI_NONAME for "https". Don't fail the test merely because of this. */ if (res == EAI_NONAME) -- 1.6.0.6

On Mon, Jan 26, 2009 at 08:30:27AM +0000, Mark McLoughlin wrote:
Sometimes - yes, even in the latter part of the first decade of the twenty first century - one doesn't have access to the Internet while one is hacking.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> --- gnulib/tests/test-getaddrinfo.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gnulib/tests/test-getaddrinfo.c b/gnulib/tests/test-getaddrinfo.c index a887cb1..246021a 100644 --- a/gnulib/tests/test-getaddrinfo.c +++ b/gnulib/tests/test-getaddrinfo.c @@ -64,6 +64,11 @@ int simple (char *host, char *service)
if (res != 0) { + /* 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) + return 0; /* IRIX reports EAI_NONAME for "https". Don't fail the test merely because of this. */ if (res == EAI_NONAME)
+1 Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

On Mon, Jan 26, 2009 at 08:30:27AM +0000, Mark McLoughlin wrote:
Sometimes - yes, even in the latter part of the first decade of the twenty first century - one doesn't have access to the Internet while one is hacking.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> --- gnulib/tests/test-getaddrinfo.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gnulib/tests/test-getaddrinfo.c b/gnulib/tests/test-getaddrinfo.c index a887cb1..246021a 100644 --- a/gnulib/tests/test-getaddrinfo.c +++ b/gnulib/tests/test-getaddrinfo.c @@ -64,6 +64,11 @@ int simple (char *host, char *service)
if (res != 0) { + /* 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) + return 0; /* IRIX reports EAI_NONAME for "https". Don't fail the test merely because of this. */ if (res == EAI_NONAME)
ACK, though there's a tiny whitespace bug there. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Mark McLoughlin
-
Richard W.M. Jones