[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/9] tests: fix test-io-channel-command on win32
From: |
marcandre . lureau |
Subject: |
[PATCH v2 2/9] tests: fix test-io-channel-command on win32 |
Date: |
Sun, 29 Jan 2023 22:24:07 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
socat "PIPE:"" on Windows are named pipes, not fifo path names.
Fixes: commit 68406d10859 ("tests/unit: cleanups for test-io-channel-command")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
tests/unit/test-io-channel-command.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/unit/test-io-channel-command.c
b/tests/unit/test-io-channel-command.c
index 096224962c..e76ef2daaa 100644
--- a/tests/unit/test-io-channel-command.c
+++ b/tests/unit/test-io-channel-command.c
@@ -31,8 +31,12 @@ static char *socat = NULL;
static void test_io_channel_command_fifo(bool async)
{
+#ifdef WIN32
+ const gchar *fifo = TEST_FIFO;
+#else
g_autofree gchar *tmpdir = g_dir_make_tmp("qemu-test-io-channel.XXXXXX",
NULL);
g_autofree gchar *fifo = g_build_filename(tmpdir, TEST_FIFO, NULL);
+#endif
g_autofree gchar *srcargs = g_strdup_printf("%s - PIPE:%s,wronly", socat,
fifo);
g_autofree gchar *dstargs = g_strdup_printf("%s PIPE:%s,rdonly -", socat,
fifo);
g_auto(GStrv) srcargv = g_strsplit(srcargs, " ", -1);
@@ -57,7 +61,9 @@ static void test_io_channel_command_fifo(bool async)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+#ifndef WIN32
g_rmdir(tmpdir);
+#endif
}
--
2.39.1
- [PATCH v2 0/9] Various win32 fixes & teach 'getfd' QMP command to import sockets, marcandre . lureau, 2023/01/29
- [PATCH v2 1/9] tests: fix path separator, use g_build_filename(), marcandre . lureau, 2023/01/29
- [PATCH v2 2/9] tests: fix test-io-channel-command on win32,
marcandre . lureau <=
- [PATCH v2 3/9] tests/docker: fix a win32 error due to portability, marcandre . lureau, 2023/01/29
- [PATCH v2 4/9] osdep: implement qemu_socketpair() for win32, marcandre . lureau, 2023/01/29
- [PATCH v2 5/9] qmp: 'add_client' actually expects sockets, marcandre . lureau, 2023/01/29
- [PATCH v2 6/9] qapi: implement conditional command arguments, marcandre . lureau, 2023/01/29
- [PATCH v2 9/9] qtest: enable vnc-display test on win32, marcandre . lureau, 2023/01/29
- [PATCH v2 7/9] qmp: teach 'getfd' to import sockets on win32, marcandre . lureau, 2023/01/29
- [PATCH v2 8/9] libqtest: make qtest_qmp_add_client work on win32, marcandre . lureau, 2023/01/29