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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user