From: Laurent Vivier <lvivier@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v4] tests/qtest: netdev: test stream and dgram backends
Date: Tue, 3 Jan 2023 15:46:55 +0100 [thread overview]
Message-ID: <f59bd50b-abf7-88ae-7c09-e5c204e08e9a@redhat.com> (raw)
In-Reply-To: <b9ebccdf-5cea-a051-46e9-f88a8c59a6ef@redhat.com>
On 1/3/23 15:08, Thomas Huth wrote:
> On 03/01/2023 12.00, Laurent Vivier wrote:
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>>
>> Notes:
>> v4:
>> - rework EXPECT_STATE()
>> - use g_dir_make_tmp()
>> v3:
>> - Add "-M none" to avoid error:
>> "No machine specified, and there is no default"
>> v2:
>> - Fix ipv6 free port allocation
>> - Check for IPv4, IPv6, AF_UNIX
>> - Use g_mkdtemp() rather than g_file_open_tmp()
>> - Use socketpair() in test_stream_fd()
>> v1: compared to v14 of "qapi: net: add unix socket type support to netdev backend":
>> - use IP addresses 127.0.0.1 and ::1 rather than localhost
>>
>> tests/qtest/meson.build | 2 +
>> tests/qtest/netdev-socket.c | 434 ++++++++++++++++++++++++++++++++++++
>> 2 files changed, 436 insertions(+)
>> create mode 100644 tests/qtest/netdev-socket.c
> [...]
>> +int main(int argc, char **argv)
>> +{
>> + int ret;
>> + bool has_ipv4, has_ipv6, has_afunix;
>> + g_autoptr(GError) err = NULL;
>> +
>> + g_test_init(&argc, &argv, NULL);
>> +
>> + if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) {
>> + g_printerr("socket_check_protocol_support() failed\n");
>> + goto end;
>> + }
>> +
>> + tmpdir = g_dir_make_tmp("netdev-socket.XXXXXX", &err);
>> + if (tmpdir == NULL) {
>> + g_error("Can't create temporary directory in %s: %s",
>> + g_get_tmp_dir(), err->message);
>
> Should there also be a "goto end" here?
No, g_error() is fatal.
https://docs.gtk.org/glib/func.error.html
>
> Apart from that:
> Acked-by: Thomas Huth <thuth@redhat.com>
>
Thanks,
Laurent
>> + }
>> +
>> + if (has_ipv4) {
>> + qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
>> + qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
>> + qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
>> + }
>> + if (has_ipv6) {
>> + qtest_add_func("/netdev/stream/inet/ipv6", test_stream_inet_ipv6);
>> + }
>> +
>> + socket_check_afunix_support(&has_afunix);
>> + if (has_afunix) {
>> + qtest_add_func("/netdev/dgram/unix", test_dgram_unix);
>> + qtest_add_func("/netdev/stream/unix", test_stream_unix);
>> + qtest_add_func("/netdev/stream/unix/abstract",
>> + test_stream_unix_abstract);
>> + qtest_add_func("/netdev/stream/fd", test_stream_fd);
>> + qtest_add_func("/netdev/dgram/fd", test_dgram_fd);
>> + }
>> +
>> +end:
>> + ret = g_test_run();
>> +
>> + g_rmdir(tmpdir);
>> + g_free(tmpdir);
>> +
>> + return ret;
>> +}
>
next prev parent reply other threads:[~2023-01-03 14:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 11:00 [PATCH v4] tests/qtest: netdev: test stream and dgram backends Laurent Vivier
2023-01-03 14:08 ` Thomas Huth
2023-01-03 14:46 ` Laurent Vivier [this message]
2023-01-04 14:36 ` Thomas Huth
2023-01-04 14:38 ` Thomas Huth
2023-01-04 15:41 ` Philippe Mathieu-Daudé
2023-01-04 18:37 ` Thomas Huth
2023-01-04 20:10 ` Laurent Vivier
2023-01-05 6:24 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f59bd50b-abf7-88ae-7c09-e5c204e08e9a@redhat.com \
--to=lvivier@redhat.com \
--cc=berrange@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).