[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/14] tests: be a bit more strict cleaning up fifos
From: |
Alex Bennée |
Subject: |
[PATCH v2 04/14] tests: be a bit more strict cleaning up fifos |
Date: |
Tue, 21 Feb 2023 09:45:48 +0000 |
When we re-factored we dropped the unlink() step which turns out to be
required for rmdir to do its thing. If we had been checking the return
value we would have noticed so lets do that with this fix.
Fixes: 68406d1085 (tests/unit: cleanups for test-io-channel-command)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/unit/test-io-channel-command.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/unit/test-io-channel-command.c
b/tests/unit/test-io-channel-command.c
index 04b75ab3b4..c6e66a8c33 100644
--- a/tests/unit/test-io-channel-command.c
+++ b/tests/unit/test-io-channel-command.c
@@ -42,6 +42,7 @@ static void test_io_channel_command_fifo(bool async)
g_auto(GStrv) dstargv = g_strsplit(dstargs, " ", -1);
QIOChannel *src, *dst;
QIOChannelTest *test;
+ int err;
if (mkfifo(fifo, 0600)) {
g_error("mkfifo: %s", strerror(errno));
@@ -61,7 +62,10 @@ static void test_io_channel_command_fifo(bool async)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
- g_rmdir(tmpdir);
+ err = g_unlink(fifo);
+ g_assert(err == 0);
+ err = g_rmdir(tmpdir);
+ g_assert(err == 0);
}
static void test_io_channel_command_fifo_async(void)
--
2.39.1
- [PATCH v2 00/14] testing/next: docker, avocado, unit, gitlab, Alex Bennée, 2023/02/21
- [PATCH v2 01/14] block: Handle curl 7.55.0, 7.85.0 version changes, Alex Bennée, 2023/02/21
- [PATCH v2 04/14] tests: be a bit more strict cleaning up fifos,
Alex Bennée <=
- [PATCH v2 02/14] tests: don't run socat tests on MacOS as well, Alex Bennée, 2023/02/21
- [PATCH v2 05/14] tests: make fp-test less chatty when running from test suite, Alex Bennée, 2023/02/21
- [PATCH v2 07/14] gitlab: extend custom runners with base_job_template, Alex Bennée, 2023/02/21
- [PATCH v2 11/14] tests: add tuxrun baseline test to avocado, Alex Bennée, 2023/02/21
- [PATCH v2 06/14] gitlab-ci: Use artifacts instead of dumping logs in the Cirrus-CI jobs, Alex Bennée, 2023/02/21