alonbl      14/03/08 20:21:37

  Added:               
                        
gnutls-2.12.23-gl-tests-getaddrinfo-skip-if-no-network.patch
  Log:
  Fix network sandbox gnulib issue, bug#503870
  
  (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 
BF20DC51)

Revision  Changes    Path
1.1                  
net-libs/gnutls/files/gnutls-2.12.23-gl-tests-getaddrinfo-skip-if-no-network.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.23-gl-tests-getaddrinfo-skip-if-no-network.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.23-gl-tests-getaddrinfo-skip-if-no-network.patch?rev=1.1&content-type=text/plain

Index: gnutls-2.12.23-gl-tests-getaddrinfo-skip-if-no-network.patch
===================================================================
>From 4b3252d59ef2d73118e2de6743ba58e2cbafa008 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <[email protected]>
Date: Sat, 8 Mar 2014 22:13:51 +0200
Subject: [PATCH] tests: getaddrinfo: skip if no network

When running tests under network sandbox, there is no connectivity to
the DNS, in this case function returns system error and ECONNREFUSED
this should result in skipping test.

Signed-off-by: Alon Bar-Lev <[email protected]>
---
 tests/test-getaddrinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gl/tests/test-getaddrinfo.c b/gl/tests/test-getaddrinfo.c
index acf9cd6..b155410 100644
--- a/gl/tests/test-getaddrinfo.c
+++ b/gl/tests/test-getaddrinfo.c
@@ -85,7 +85,7 @@ simple (char const *host, char const *service)
       /* 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)
+      if (res == EAI_AGAIN || (res == EAI_SYSTEM && err == ECONNREFUSED))
         {
           skip++;
           fprintf (stderr, "skipping getaddrinfo test: no network?\n");
-- 
1.8.3.2





Reply via email to