[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/24] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL
From: |
Thomas Huth |
Subject: |
[PULL 04/24] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL |
Date: |
Wed, 16 Sep 2020 13:47:11 +0200 |
The tests/test-char test is currently always failing on my system since
the getaddrinfo() in socket_can_bind_connect() returns EAI_NONAME when
it is called from socket_check_protocol_support() to check for IPv6.
socket_check_protocol_support() then returns -1 and thus the tests are
not run at all - even though IPv4 is working fine.
socket_can_bind_connect() connect should return EADDRNOTAVAIL in this
case instead, so that socket_check_protocol_support() does not fail.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200908121543.222872-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/socket-helpers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/socket-helpers.c b/tests/socket-helpers.c
index 19a51e887e..f704fd1a69 100644
--- a/tests/socket-helpers.c
+++ b/tests/socket-helpers.c
@@ -59,8 +59,7 @@ static int socket_can_bind_connect(const char *hostname, int
family)
/* lookup */
rc = getaddrinfo(hostname, NULL, &ai, &res);
if (rc != 0) {
- if (rc == EAI_ADDRFAMILY ||
- rc == EAI_FAMILY) {
+ if (rc == EAI_ADDRFAMILY || rc == EAI_FAMILY || rc == EAI_NONAME) {
errno = EADDRNOTAVAIL;
} else {
errno = EINVAL;
--
2.18.2
- [PULL 00/24] qtests, unit tests and Cirrus-CI fixes / improvements, Thomas Huth, 2020/09/16
- [PULL 01/24] iotests: Drop readlink -f, Thomas Huth, 2020/09/16
- [PULL 02/24] fuzz: Change the way we write qtest log to stderr, Thomas Huth, 2020/09/16
- [PULL 03/24] tests/qtest/qmp-cmd-test: Use inclusive language, Thomas Huth, 2020/09/16
- [PULL 04/24] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL,
Thomas Huth <=
- [PULL 06/24] qga/commands-win32: Fix problem with redundant protype declaration, Thomas Huth, 2020/09/16
- [PULL 05/24] Simplify the .gitignore file, Thomas Huth, 2020/09/16
- [PULL 08/24] tests: Convert g_free to g_autofree macro in test-logging.c, Thomas Huth, 2020/09/16
- [PULL 07/24] rcu: Implement drain_call_rcu, Thomas Huth, 2020/09/16
- [PULL 10/24] meson: Disable test-char on msys2/mingw for fixing tests stuck, Thomas Huth, 2020/09/16
- [PULL 09/24] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full, Thomas Huth, 2020/09/16
- [PULL 11/24] meson: disable crypto tests are empty under win32, Thomas Huth, 2020/09/16
- [PULL 12/24] tests: Fixes test-replication.c on msys2/mingw., Thomas Huth, 2020/09/16