aboutsummaryrefslogtreecommitdiff
path: root/tests/socket-helpers.h
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-12-22 11:48:49 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2018-03-13 18:06:06 +0000
commitabd983c0e0beb4b15326e51a837e1b5177df0e08 (patch)
tree6429cda082157e08a23b85e5e835274415f450f6 /tests/socket-helpers.h
parent9b589ffb1237ec54f8341d8a80ba77f31d428842 (diff)
downloadqemu-abd983c0e0beb4b15326e51a837e1b5177df0e08.zip
qemu-abd983c0e0beb4b15326e51a837e1b5177df0e08.tar.gz
qemu-abd983c0e0beb4b15326e51a837e1b5177df0e08.tar.bz2
sockets: strengthen test suite IP protocol availability checks
Instead of just checking whether it is possible to bind() on a socket, also check that we can successfully connect() to the socket we bound to. This more closely replicates the level of functionality that tests will actually use. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests/socket-helpers.h')
-rw-r--r--tests/socket-helpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/socket-helpers.h b/tests/socket-helpers.h
index efa96ed..1c07d6d 100644
--- a/tests/socket-helpers.h
+++ b/tests/socket-helpers.h
@@ -21,13 +21,13 @@
/*
* @hostname: a DNS name or numeric IP address
*
- * Check whether it is possible to bind to ports
+ * 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(const char *hostname);
+int socket_can_bind_connect(const char *hostname);
/*
* @has_ipv4: set to true on return if IPv4 is available