tests: specify the address family when checking bind

getaddrinfo() may succeed with PF_UNSPEC, but fail when more specific.

(this allows to skip some tests that would fail under podman)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Marc-André Lureau 2019-07-09 18:12:28 +04:00
parent 05af039d1e
commit 71714178fa
2 changed files with 13 additions and 15 deletions

View file

@ -20,17 +20,6 @@
#ifndef TESTS_SOCKET_HELPERS_H
#define TESTS_SOCKET_HELPERS_H
/*
* @hostname: a DNS name or numeric IP address
*
* Check whether it is possible to bind & connect to ports
* on the DNS name or IP address @hostname. If an IP address
* is used, it must not be a wildcard address.
*
* Returns 0 on success, -1 on error with errno set
*/
int socket_can_bind_connect(const char *hostname);
/*
* @has_ipv4: set to true on return if IPv4 is available
* @has_ipv6: set to true on return if IPv6 is available