diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index 40a40a70bf..db7c9420cc 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -3,6 +3,7 @@ #include #include +#include "sd-daemon.h" #include "sd-event.h" #include "capability-util.h" @@ -466,6 +467,10 @@ TEST(sd_device_enumerator_filter_subsystem) { return; } + /* The rest of this test depends on a full booted system with a working udev and so on */ + if (!sd_booted()) + return (void) log_tests_skipped("Test requires fully booted system with udev/etc, skipping to avoid hanging forever."); + _cleanup_(sd_event_unrefp) sd_event *event = NULL; ASSERT_OK(sd_event_default(&event)); ASSERT_OK(sd_event_add_inotify(event, NULL, "/run/udev" , IN_DELETE, on_inotify, NULL));