From: Laurent Vivier <lvivier@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] tests/qtest: netdev: test stream and dgram backends
Date: Fri, 4 Nov 2022 11:58:29 +0100 [thread overview]
Message-ID: <680deee3-ccf7-b32c-2dfe-189ab02463d4@redhat.com> (raw)
In-Reply-To: <Y2TeNFBUnwW9XZBk@redhat.com>
On 11/4/22 10:41, Daniel P. Berrangé wrote:
...
>> +static void test_stream_unix(void)
>> +{
>> + QTestState *qts0, *qts1;
>> + char *expect;
>> + gchar *path;
>> + int ret;
>> +
>> + ret = g_file_open_tmp("netdev-XXXXXX", &path, NULL);
>> + g_assert_true(ret >= 0);
>> + close(ret);
>
> This is creating a zero length plain file, and then paassing
> that as a path for the UNIX socket.
>
> This is pretty dubious and only works because the code will
> be doing 'unlink' on the path. Just delete this as there's
> no reason to pre-create anything on disk for UNIX sockets.
>
The idea here is to generate a path for the socket and to be sure this path is actually
not already in use.
The same for the abstract one, how to be sure we are not running the same test
concurrently and select a different unix name?
I'm going to address all your comments and send a new version of the patch.
Thanks,
Laurent
next prev parent reply other threads:[~2022-11-04 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 9:22 [PATCH] tests/qtest: netdev: test stream and dgram backends Laurent Vivier
2022-11-04 9:41 ` Daniel P. Berrangé
2022-11-04 10:58 ` Laurent Vivier [this message]
2022-11-04 11:13 ` Daniel P. Berrangé
2022-11-04 12:15 ` Michael S. Tsirkin
2022-11-04 13:24 ` Laurent Vivier
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=680deee3-ccf7-b32c-2dfe-189ab02463d4@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).