From 332caeff4fd7f31fdf1024b2f1851ae44eb94bc4 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 21 Apr 2023 00:05:54 -0400 Subject: tests: Check for dbus connection error --- tests/src/test-runner.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c index bf4fd9f5..11dd9ba9 100644 --- a/tests/src/test-runner.c +++ b/tests/src/test-runner.c @@ -2770,7 +2770,9 @@ main (int argc, char **argv) if (g_key_file_has_key (config, "test-runner-config", "timeout", NULL)) status_timeout_ms = g_key_file_get_integer (config, "test-runner-config", "timeout", NULL) * 1000; - dbus_conn = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); + dbus_conn = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); + if (!dbus_conn) + g_error("Failed to connect to system D-Bus: %s", error->message); /* Start D-Bus services */ if (!g_key_file_get_boolean (config, "test-runner-config", "disable-upower", NULL)) -- cgit v1.2.1