diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-07-09 23:24:46 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-08-22 17:30:25 +0400 |
commit | a4eb74a66a0f34d53127e240c1eeae42073bc558 (patch) | |
tree | e77228445b0fcf78610a1e1c0b0432e6c00feb57 | |
parent | e7b6ba4186f243f149b0d8cddc129fe681ba3912 (diff) | |
download | qemu-a4eb74a66a0f34d53127e240c1eeae42073bc558.zip qemu-a4eb74a66a0f34d53127e240c1eeae42073bc558.tar.gz qemu-a4eb74a66a0f34d53127e240c1eeae42073bc558.tar.bz2 |
test: skip tests if socket_check_protocol_support() failed
Skip the tests if socket_check_protocol_support() failed, but do run
g_test_run() to keep TAP harness happy.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r-- | tests/test-char.c | 4 | ||||
-rw-r--r-- | tests/test-io-channel-socket.c | 4 | ||||
-rw-r--r-- | tests/test-util-sockets.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/test-char.c b/tests/test-char.c index 2dde620..b56e43c 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -1365,7 +1365,8 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) { - return -1; + g_printerr("socket_check_protocol_support() failed\n"); + goto end; } module_call_init(MODULE_INIT_QOM); @@ -1465,5 +1466,6 @@ int main(int argc, char **argv) g_test_add_func("/char/hotswap", char_hotswap_test); g_test_add_func("/char/websocket", char_websock_test); +end: return g_test_run(); } diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c index d2053c4..d172f30 100644 --- a/tests/test-io-channel-socket.c +++ b/tests/test-io-channel-socket.c @@ -566,7 +566,8 @@ int main(int argc, char **argv) * with either IPv4 or IPv6 disabled. */ if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) { - return 1; + g_printerr("socket_check_protocol_support() failed\n"); + goto end; } if (has_ipv4) { @@ -595,5 +596,6 @@ int main(int argc, char **argv) test_io_channel_unix_listen_cleanup); #endif /* _WIN32 */ +end: return g_test_run(); } diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c index f1ebffe..e2a3a8a 100644 --- a/tests/test-util-sockets.c +++ b/tests/test-util-sockets.c @@ -242,7 +242,8 @@ int main(int argc, char **argv) * with either IPv4 or IPv6 disabled. */ if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) { - return 1; + g_printerr("socket_check_protocol_support() failed\n"); + goto end; } if (has_ipv4) { @@ -264,5 +265,6 @@ int main(int argc, char **argv) test_socket_fd_pass_num_nocli); } +end: return g_test_run(); } |