[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/14] test-util-filemonitor: Adapt to the FreeBSD inotify ren
From: |
Alex Bennée |
Subject: |
[PATCH v2 07/14] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics |
Date: |
Wed, 7 Feb 2024 16:38:05 +0000 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
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 <berrange@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20240206002344.12372-4-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
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 },
--
2.39.2
- [PATCH v2 00/14] maintainer updates for 9.0 pre-PR (docker, plugin tests, deprecation, elf, semihosting, gdbstub), Alex Bennée, 2024/02/07
- [PATCH v2 03/14] configure: run plugin TCG tests again, Alex Bennée, 2024/02/07
- [PATCH v2 01/14] tests/docker: Add sqlite3 module to openSUSE Leap container, Alex Bennée, 2024/02/07
- [PATCH v2 05/14] tests/vm: Set UseDNS=no in the sshd configuration, Alex Bennée, 2024/02/07
- [PATCH v2 04/14] Revert "hw/elf_ops: Ignore loadable segments with zero size", Alex Bennée, 2024/02/07
- [PATCH v2 07/14] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics,
Alex Bennée <=
- [PATCH v2 06/14] tests/vm/freebsd: Reload the sshd configuration, Alex Bennée, 2024/02/07
- [PATCH v2 10/14] gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way, Alex Bennée, 2024/02/07
- [PATCH v2 02/14] docs: mark CRIS support as deprecated, Alex Bennée, 2024/02/07
- [PATCH v2 09/14] kconfig: use "select" to enable semihosting, Alex Bennée, 2024/02/07
- [PATCH v2 08/14] meson: Link with libinotify on FreeBSD, Alex Bennée, 2024/02/07
- [PATCH v2 12/14] gdbstub: Add syscall entry/return hooks, Alex Bennée, 2024/02/07