qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/3] tests/util-sockets: add abstract unix socket cases


From: xiaoqiang zhao
Subject: Re: [PATCH v3 2/3] tests/util-sockets: add abstract unix socket cases
Date: Thu, 14 May 2020 08:26:24 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

在 2020/5/13 下午11:49, Daniel P. Berrangé 写道:
On Sun, May 10, 2020 at 02:14:21PM +0800, xiaoqiang zhao wrote:
add cases to test tight and non-tight for abstract address type

Signed-off-by: xiaoqiang zhao<address@hidden>
---
  tests/test-util-sockets.c | 83 +++++++++++++++++++++++++++++++++++++++
  1 file changed, 83 insertions(+)

diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index 5fd947c7bf..8042fb9276 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -227,6 +227,84 @@ static void test_socket_fd_pass_num_nocli(void)
      g_free(addr.u.fd.str);
  }
+static gpointer unix_server_thread_func(gpointer user_data)
+{
+    SocketAddress addr;
+    Error *err = NULL;
+    int fd = -1;
+    int connfd = -1;
+    struct sockaddr_un un;
+    socklen_t len = sizeof(un);
+    char name[] = "/tmp/unix-test.sock";
Fixed filenames are bad, as even though this is the abstract
namespace and thus safe from on-disk clashes, the abstract
namespace is still OS global. We should append both the PID
and a sequence of random bytes to get something which doesnt
clash if two copies of the unit test run concurrently.

agree.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]