[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: getaddrinfo: skip if no network
From: |
Alon Bar-Lev |
Subject: |
[PATCH] tests: getaddrinfo: skip if no network |
Date: |
Sat, 8 Mar 2014 22:15:52 +0200 |
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 <address@hidden>
---
tests/test-getaddrinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index acf9cd6..b155410 100644
--- a/tests/test-getaddrinfo.c
+++ b/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
- [PATCH] tests: getaddrinfo: skip if no network,
Alon Bar-Lev <=