From 6cae57d9ade3af9bbcc53f5deb6b6f46d39e51e6 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 25 Oct 2022 00:50:05 +0100 Subject: [PATCH] test-sd-device: check if /run/udev/ exists When running the tests in a chroot /sys/ might be writable, but it doesn't mean udev will be running Assertion 'sd_event_add_inotify(event, NULL, "/run/udev" , IN_DELETE, on_inotify, NULL) >= 0' failed at src/libsystemd/sd-device/test-sd-device.c:352, function test_sd_device_enumerator_filter_subsystem(). Aborting. --- src/libsystemd/sd-device/test-sd-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index 6f432005e9..4ab8b3894a 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -342,7 +342,7 @@ TEST(sd_device_enumerator_filter_subsystem) { /* The test test_sd_device_enumerator_filter_subsystem_trial() is quite racy. Let's run the function * several times after the udev queue becomes empty. */ - if (!udev_available()) { + if (!udev_available() || (access("/run/udev", F_OK) < 0 && errno == ENOENT)) { assert_se(test_sd_device_enumerator_filter_subsystem_trial_many()); return; }