From patchwork Tue Feb 28 19:06:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13155156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D57F5C64EC7 for ; Tue, 28 Feb 2023 19:09:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX5KB-0002Uu-Ha; Tue, 28 Feb 2023 14:07:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pX5JT-0002Fb-HR for qemu-devel@nongnu.org; Tue, 28 Feb 2023 14:07:15 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pX5JQ-0002ln-F3 for qemu-devel@nongnu.org; Tue, 28 Feb 2023 14:06:59 -0500 Received: by mail-wm1-x335.google.com with SMTP id c18so7132574wmr.3 for ; Tue, 28 Feb 2023 11:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5wgqhpOuR7e6cKqdeQ7eDt12+eCjeJwpWxVsBAVXjj4=; b=ArEdwujJWnIc0xOGkrrbqFuONQZaB8cf56w6B/8UFbuHl46ijekAFfBLoHJBGYWng5 DqVEBd1S37zqhTg8mAPkFl2EJGJIcjzeRvAkz6TN4+eQssh0nzvBQhNO0ruEDTFJ4F+Q Rhhm6UXrw3kKqBqj6/K7ZQX8AOuOqCHHVFc3Nu0TX/hqW+GI5/tlEgTO+o18XoG42w3q eriicvc2VOdpaE34kLhmSeRj+5fPLXes8ouI76r+r6koNbpDMF8u8Ai2C9b6JIOHnfhN A3o9WFS+3adfqiZv84YfTWJstXrABKd1hn95YJfLGOn/7mFuqwzrMVNjQUbyj2Xe5DLe ulLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5wgqhpOuR7e6cKqdeQ7eDt12+eCjeJwpWxVsBAVXjj4=; b=pD6FofYf88NDhskCu+onIVPWuSbwdFWkYj2CwQSjNXlKsOAMMqtd/uQDK78gMMra9k ccwy3lKOu9LM+5fsegKSkcE2vJd+LbrFWQY6JFp6mwRRtd/yarukKQx0X7CM/26VPh6h 4451gwISvV0OYLq+jvboWt7MaRZkbcPqSnghfcGaezcks0oeVMMGvCLIbW7l92Y+UVfv mZLasPLmTPFUIK/BYd37PA9EqI8XtYt3XPWFtYkBHMHN9woOAxwqnC/0PU5iJJNh1PXx SoGe2EHwbCGXiD+RVS8i9UUOIO/z99qbV/B6lZ9oW23gtNt2XKG6iKHNBWSDRE33R5Qx Rt3A== X-Gm-Message-State: AO0yUKVQ6GiM0FXmcrlOKdwsJL82cF0ei/1vkAXbsjljQxLfmmD4TLOd xF+LW6hnkzUQSTZ8XHfU50ZL/Q== X-Google-Smtp-Source: AK7set9GRcqrdEz53O1859GXi1oaMLU7hvs+X7NLJf57fL2njFGm4vwIUKCRTqMB4RfcJrFfsj5g3g== X-Received: by 2002:a05:600c:331c:b0:3eb:55d2:9c4c with SMTP id q28-20020a05600c331c00b003eb55d29c4cmr1562324wmp.16.1677611214972; Tue, 28 Feb 2023 11:06:54 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c379300b003e2052bad94sm16690886wmr.33.2023.02.28.11.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 11:06:54 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9E1BC1FFBB; Tue, 28 Feb 2023 19:06:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Michael Roth , Peter Maydell , Kevin Wolf , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , Alexander Bulekov , Aurelien Jarno , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Darren Kenny , Hanna Reitz , Cleber Rosa , John Snow , Ed Maste , qemu-arm@nongnu.org, Fam Zheng , Thomas Huth , Yonggang Luo , qemu-block@nongnu.org, Paolo Bonzini , Stefan Hajnoczi , Bandan Das , Li-Wen Hsu , Pavel Dovgalyuk , Laurent Vivier , Bastian Koppelmann , Qiuhao Li , Wainer dos Santos Moschetta , Richard Henderson Subject: [PATCH v3 03/24] tests: be a bit more strict cleaning up fifos Date: Tue, 28 Feb 2023 19:06:32 +0000 Message-Id: <20230228190653.1602033-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230228190653.1602033-1-alex.bennee@linaro.org> References: <20230228190653.1602033-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230221094558.2864616-5-alex.bennee@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)