|
From: | Laurent Vivier |
Subject: | Re: [PATCH] tests/qtest: netdev: test stream and dgram backends |
Date: | Fri, 4 Nov 2022 11:58:29 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |