diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c index 4d99506c28..6b1d3e36bb 100644 --- a/src/tests/config/test-config.c +++ b/src/tests/config/test-config.c @@ -28,6 +28,7 @@ #include "nm-test-device.h" #include "nm-fake-platform.h" #include "nm-logging.h" +#include "nm-dbus-manager.h" #include "nm-test-utils.h" @@ -289,6 +290,13 @@ main (int argc, char **argv) { nmtst_init_assert_logging (&argc, &argv); + /* Initialize the DBus manager singleton explicitly, because it is accessed by + * the class initializer of NMDevice (used by the NMTestDevice stub). + * This way, we skip calling nm_dbus_manager_init_bus() which would + * either fail and/or cause unexpected actions in the test. + * */ + nm_dbus_manager_setup (g_object_new (NM_TYPE_DBUS_MANAGER, NULL)); + nm_fake_platform_setup (); g_test_add_func ("/config/simple", test_config_simple);