Commit e148aa47 authored by Simon McVittie's avatar Simon McVittie

tests: Skip if unable to launch uninstalled dbus-daemon as other uid

Some CI systems do the entire build as uid 0 in a throwaway container.
If this is done in a build directory for which the messagebus user
does not have search (+x) permission, then they will be unable to
execute the just-built dbus-daemon binary.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 505bbfe4
......@@ -209,6 +209,24 @@ spawn_dbus_daemon (const gchar *binary,
&address_fd,
NULL, /* child's stderr = our stderr */
&error);
/* The other uid might not have access to our build directory if we
* are building in /root or something */
if (user != TEST_USER_ME &&
g_getenv ("DBUS_TEST_UNINSTALLED") != NULL &&
error != NULL &&
error->domain == G_SPAWN_ERROR &&
(error->code == G_SPAWN_ERROR_CHDIR ||
error->code == G_SPAWN_ERROR_ACCES ||
error->code == G_SPAWN_ERROR_PERM))
{
g_prefix_error (&error, "Unable to launch %s as other user: ",
binary);
g_test_skip (error->message);
g_clear_error (&error);
return NULL;
}
g_assert_no_error (error);
g_ptr_array_free (argv, TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment