From patchwork Wed Feb 7 16:38:05 2024 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: 770646 Delivered-To: patch@linaro.org Received: by 2002:a5d:40c1:0:b0:33b:4db1:f5b3 with SMTP id b1csp401062wrq; Wed, 7 Feb 2024 08:40:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGC93/1OsxU1/l9Rje940D0Dtf6AldT+fZ0I0o/6AWln3mVbd5NU4R0tQO4xK74Nc6p1dE+ X-Received: by 2002:a0c:e30e:0:b0:68c:c3a5:8120 with SMTP id s14-20020a0ce30e000000b0068cc3a58120mr68908qvl.3.1707324023557; Wed, 07 Feb 2024 08:40:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707324023; cv=none; d=google.com; s=arc-20160816; b=aHI26H900PneBMRqSbeiHq9BQXNGEWH9V9KYVoHByO2zxLep9gAmVs8fR5+4M4/9u5 aSM6e+oi7w+iARjPDZud+6k1soOagUibW0nkv+fw6hr3hIA1PDhmIAyet9lh+oODZj19 Wqj2g7AalXeW7sqKFjquOttNK4HNUHnql69VuYU1Q9pyBOfpuxwVCFG1Hq0JFqonZs/P 3GPg9NgqMLSslqgZQy6YUlXdeFhwAM8N51PTPgcZM52w8HsV8qjWfGTHGYk31evvKiKA bTMOJsYehKwYxRN9GsufEWgfNjB+JVgrFGrnI7bi/DsbIflUnHvWX9oIyIAJI171Km6k Xr0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9IbvextsUKhbDQgPyuaeoL3jSODZ/hWaknGrv+i1g18=; fh=pVYUJV4vKhVN//0Z0Fc13chhPlTxQqhbaUjiJdV2K7Y=; b=puwuJ+wHauDaF6YQd6Xk9f5Vv6B506OfsprJL/GFuXz3eTwdCqEAIxDNlF1E6zOwyA kA2zXnUyGAAu+IqHZ5jlbjFPn5poOoS+dL+zft5JsyP/JbKKnfO9qkkXsAjLtx5ltGRQ dPqBMSf6jjBiMyvKwE2dzuKH1ZuhKx/nmte2iIcukGeixSaTIsXdpo5CS9yYJhSDOwzM MclVtBKZ8qu4iryFz78yikPTYiyXyZV573v8o9W4aq7UG5K/bzVir2N53j0A0OWkkKBK g0RHV2DI0Pn4QmlqyQ7M9uubPdYT7BcC3nppQm40gQ+fWoqB4G5ZISxm7CjMwPgAKyKN tqBQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CuiGozEy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCVt/Dg/RhOPBqFmFROlwGzVAxQOLyzHWGrJyGh4xJEuoicboBP90e8FAJ7+99qC1bf34WmD0hp3da+mAlxCsko8 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j25-20020a05620a147900b0078591a8cc6bsi1429035qkl.609.2024.02.07.08.40.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2024 08:40:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CuiGozEy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXkwL-0002tO-Qc; Wed, 07 Feb 2024 11:38:25 -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 1rXkwK-0002sC-H0 for qemu-devel@nongnu.org; Wed, 07 Feb 2024 11:38:24 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXkwG-00067n-EE for qemu-devel@nongnu.org; Wed, 07 Feb 2024 11:38:23 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40ffd94a707so8029125e9.1 for ; Wed, 07 Feb 2024 08:38:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707323899; x=1707928699; darn=nongnu.org; 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=9IbvextsUKhbDQgPyuaeoL3jSODZ/hWaknGrv+i1g18=; b=CuiGozEyOhm69oPTra3QbwGv1ujJrl7spKqq1nSc9Soav9a4jHRHJlqaBWGo9w52tu xwNgzbgaIO9v5og1jX4xokyT9SHeMFF/UvdrLDY4zLS78DkjAEBJsM3Atr3v4Iod9Esu httmM1D6pO6ISUTmPqaipHDpcVjWIzneqnPrNfdAQjWMAF3AYvAR1sOUXD42Qb/APhJV 57uxaPfYhB3aneVqtu1eMT0aONloQ95zygqGf6grqAgd4Nodf+XtZsNccGWk0aXy/2tN PT3XYD4GU503dhPQcPxniiGMMVfzJTWbYi33jbKGHsVRrztdl5SLQh65JNKXWmGdUutb 48pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707323899; x=1707928699; 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=9IbvextsUKhbDQgPyuaeoL3jSODZ/hWaknGrv+i1g18=; b=hIon1bFfAFiK6pFYOfr5e/D6efnkZZ3opEfT9K8vDh1NmbED6L/QhqOTh+CqMwTYEU Vu9vQbaFlRVTqh0JII2K7SjPTmMHcoqwhCzM0KII++Zz57A6+EhupL183d6MvI1a5TLI Vw1JMxYENrDRRY7cxArrfoNReTZ77zHNCyKGTn1DoW1IWmOanBkXVXqBQ/2AHLUokJ2K WMawpnNZY/m4quCQa6ii76IuWYIdfgLNsDPa9EmdUL7ZW3AQ0UqnXfkaj/Z3ggXj+4wg XNXE93vtcb2PKiPtE7itiPt3Xf7uiPCU7O+GOxTl2HgrDDNae/4vehCzf9jPscbTyDKO wPUg== X-Gm-Message-State: AOJu0YwyqypnacpFZIQ/jENRdOH9HiXHTPwpFRXw7Tzd3dwBekVQGd4x 24b7fgbQSvfb8odIGF/x4XCWnHwtewXazJC9VpxzIq2T8c+KKQm4DG4fej4e7zI= X-Received: by 2002:a05:600c:a08:b0:40e:fb8f:debe with SMTP id z8-20020a05600c0a0800b0040efb8fdebemr4884205wmp.38.1707323899069; Wed, 07 Feb 2024 08:38:19 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUhimZaeVtx0FbFGdLUmex+udSHN5v6slNAzSoXl1zK5iRAUFOlXiGyxUEPsIAB2Iw6yrfJpfy9JuFtECw1ez1I0fM0OiUxhmSd3VsQ4a4FINLxD3LzvA5fA1t+hj0BEY8du8uGuKhPI7FhZv1gYWRBNA0gytf/ZLiiHhvuIi630KxG2wUx8oxHpTPP7yfgjuAN+lESvm3k5gMaj/V3/k/8HpebV8NR99nt8a2ZpDXFYU1JfeqQMymopOj5ui5UpnALi4+keqhcBbhDM3dVbVlWYq+MlpFJntUv6+SzSkvQq3pd0IMPH14/kYspXRxw/PDoQSYld6+FO8CQe18ThwbpgTQbS9WELPTpMxBe0/OSO8iBB0cdtPpT/9m1ce1xzOg6dVSBYwsncfpClFmb3fzcZ/VK9CUxmlD2QMDSOaehe8Oan5kePrC8ceZYrbqY4pymxdAacVIPvqhRnN1MLewenZhTCXDQ8oE7WQluSJtMCxlwoEySZWbjm2ZcOAlZyXlRF8a2bYrYhaxIcdbN17/Ptn25JYTZabClpR1woxuDKVy7F+892PF2HEOhcvjMtwys8eJOgLa10bBxoA0d+TcGYPAdPJmsiRiWyTjytbeLi4eXgIZvxq/MP7qxsipagt88zTduIPWtmccczuTW6b9JDQniuRoZRNNLkfmZkEIShnrZNSWR5Jo+8Fl2/qUchSYk5IaiX6D0TQ5WhKU4hl1rlW1l4x3tmemdhrT57yHmdlrulASpAS4OaCJVuo8/r3LLkP44c8kSDWfBFPdkSW9TEAOpFXxncX69MHkzxjrjQFpyXrZT4TsV14ihoP032F7GgOv6KL1GwJbTPVEwAz33ICZ+e+rpZKqOwtQF Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w14-20020a05600c474e00b00410232ffb2csm642397wmo.25.2024.02.07.08.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 08:38:17 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B8E675F8E3; Wed, 7 Feb 2024 16:38:12 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: devel@lists.libvirt.org, Jiaxun Yang , Daniel Henrique Barboza , Chris Wulff , Weiwei Li , Bin Meng , Thomas Huth , qemu-riscv@nongnu.org, Marek Vasut , Liu Zhiwei , Aleksandar Rikalo , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Alistair Francis , Warner Losh , Paolo Bonzini , Aurelien Jarno , Beraldo Leal , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Max Filippov , =?utf-8?q?Alex_Benn=C3=A9e?= , Ed Maste , Palmer Dabbelt , Li-Wen Hsu , Laurent Vivier , Kyle Evans , Wainer dos Santos Moschetta , Riku Voipio , Ilya Leoshkevich Subject: [PATCH v2 07/14] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics Date: Wed, 7 Feb 2024 16:38:05 +0000 Message-Id: <20240207163812.3231697-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240207163812.3231697-1-alex.bennee@linaro.org> References: <20240207163812.3231697-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in an IN_DELETE event for that existing file: $ FILEMONITOR_DEBUG=1 build/tests/unit/test-util-filemonitor Rename /tmp/test-util-filemonitor-K13LI2/fish/one.txt -> /tmp/test-util-filemonitor-K13LI2/two.txt Event id=200000000 event=2 file=one.txt Queue event id 200000000 event 2 file one.txt Queue event id 100000000 event 2 file two.txt Queue event id 100000002 event 2 file two.txt Queue event id 100000000 event 0 file two.txt Queue event id 100000002 event 0 file two.txt Event id=100000000 event=0 file=two.txt Expected event 0 but got 2 This difference in behavior is not expected to break the real users, so teach the test to accept it. Suggested-by: Daniel P. Berrange Signed-off-by: Ilya Leoshkevich Message-Id: <20240206002344.12372-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Warner Losh --- tests/unit/test-util-filemonitor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/test-util-filemonitor.c b/tests/unit/test-util-filemonitor.c index a22de275955..02e67fc96ac 100644 --- a/tests/unit/test-util-filemonitor.c +++ b/tests/unit/test-util-filemonitor.c @@ -360,6 +360,14 @@ test_file_monitor_events(void) { .type = QFILE_MONITOR_TEST_OP_EVENT, .filesrc = "one.txt", .watchid = &watch4, .eventid = QFILE_MONITOR_EVENT_DELETED }, +#ifdef __FreeBSD__ + { .type = QFILE_MONITOR_TEST_OP_EVENT, + .filesrc = "two.txt", .watchid = &watch0, + .eventid = QFILE_MONITOR_EVENT_DELETED }, + { .type = QFILE_MONITOR_TEST_OP_EVENT, + .filesrc = "two.txt", .watchid = &watch2, + .eventid = QFILE_MONITOR_EVENT_DELETED }, +#endif { .type = QFILE_MONITOR_TEST_OP_EVENT, .filesrc = "two.txt", .watchid = &watch0, .eventid = QFILE_MONITOR_EVENT_CREATED },