From: Luca Boccassi Date: Mon, 24 Oct 2022 23:50:05 +0000 (+0100) Subject: test-sd-device: check if /run/udev/ exists X-Git-Tag: v252~30^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cae57d9ade3af9bbcc53f5deb6b6f46d39e51e6;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index 6f432005e94..4ab8b3894ae 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; }