Fix tests: Don't try to use policykit during the tests

Creating a policykit proxy was causing timeouts for me for unclear
reasons when running under the tests. But we're not using policykit at
all during the tests, so we can just avoid this call completely.
This commit is contained in:
Alexander Larsson committed 2016-09-20 05:56:19 +02:00
1 parent 2fc9d5973e
commit ef7cf7ac92
1 file changed
+7 -4
+7 -4
View File
@@ -783,11 +783,14 @@ main (int argc,
if (verbose)
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL);
authority = polkit_authority_get_sync (NULL, &error);
if (authority == NULL)
if (!on_session_bus)
{
g_printerr ("Can't get polkit authority: %s\n", error->message);
return 1;
authority = polkit_authority_get_sync (NULL, &error);
if (authority == NULL)
{
g_printerr ("Can't get polkit authority: %s\n", error->message);
return 1;
}
}
exe_path_len = readlink ("/proc/self/exe", exe_path, sizeof (exe_path) - 1);