* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#ifdef DBUS_UNIX
-#define TEST_CONNECTION "debug-pipe:name=test-server"
-#else
-#define TEST_CONNECTION "tcp:host=localhost,port=1234"
-#endif
+/* This is hard-coded in the files in valid-config-files-*. We have to use
+ * the debug-pipe transport because the tests in this file require that
+ * dbus_connection_open_private() does not block. */
+#define TEST_DEBUG_PIPE "debug-pipe:name=test-server"
if (dbus_message_contains_unix_fds(message) &&
!dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD))
return TRUE; /* silently don't send it */
if (dbus_message_contains_unix_fds(message) &&
!dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD))
return TRUE; /* silently don't send it */
if (dbus_error_is_set (&tmp_error))
{
dbus_move_error (&tmp_error, error);
if (dbus_error_is_set (&tmp_error))
{
dbus_move_error (&tmp_error, error);
/* If we can't even allocate an OOM error, we just go to sleep
* until we can.
*/
while (!bus_connection_preallocate_oom_error (connection))
_dbus_wait_for_memory ();
/* If we can't even allocate an OOM error, we just go to sleep
* until we can.
*/
while (!bus_connection_preallocate_oom_error (connection))
_dbus_wait_for_memory ();
/* Ref connection in case we disconnect it at some point in here */
dbus_connection_ref (connection);
/* Ref connection in case we disconnect it at some point in here */
dbus_connection_ref (connection);
interface_name = dbus_message_get_interface (message);
member_name = dbus_message_get_member (message);
error_name = dbus_message_get_error_name (message);
interface_name = dbus_message_get_interface (message);
member_name = dbus_message_get_member (message);
error_name = dbus_message_get_error_name (message);
_dbus_verbose ("DISPATCH: %s %s %s to %s\n",
interface_name ? interface_name : "(no interface)",
member_name ? member_name : "(no member)",
_dbus_verbose ("DISPATCH: %s %s %s to %s\n",
interface_name ? interface_name : "(no interface)",
member_name ? member_name : "(no member)",
/* If service_name is NULL, if it's a signal we send it to all
* connections with a match rule. If it's not a signal, there
* are some special cases here but mostly we just bail out.
/* If service_name is NULL, if it's a signal we send it to all
* connections with a match rule. If it's not a signal, there
* are some special cases here but mostly we just bail out.
+
+ if(bus_context_is_kdbus(context))
+ {
+ if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
+ {
+ handleNameOwnerChanged(message, transaction, connection);
+ goto out;
+ }
+ }
_dbus_string_init_const (&service_string, service_name);
service = bus_registry_lookup (registry, &service_string);
_dbus_string_init_const (&service_string, service_name);
service = bus_registry_lookup (registry, &service_string);
*/
if (!bus_dispatch_matches (transaction, connection, addressed_recipient, message, &error))
goto out;
*/
if (!bus_dispatch_matches (transaction, connection, addressed_recipient, message, &error))
goto out;
if (!dbus_connection_add_filter (connection,
bus_dispatch_message_filter,
NULL, NULL))
return FALSE;
if (!dbus_connection_add_filter (connection,
bus_dispatch_message_filter,
NULL, NULL))
return FALSE;
const char *what_is_expected)
{
_dbus_verbose ("expecting: %s\n", what_is_expected);
const char *what_is_expected)
{
_dbus_verbose ("expecting: %s\n", what_is_expected);
while (dbus_connection_get_dispatch_status (connection) ==
DBUS_DISPATCH_COMPLETE &&
dbus_connection_get_is_connected (connection))
while (dbus_connection_get_dispatch_status (connection) ==
DBUS_DISPATCH_COMPLETE &&
dbus_connection_get_is_connected (connection))
if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
{
dbus_error_free (&error);
if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
{
dbus_error_free (&error);
&& strcmp (service_name, new_owner) != 0)
{
_dbus_warn ("inconsistent ServiceOwnedChanged message (\"%s\" [ %s -> %s ])\n",
&& strcmp (service_name, new_owner) != 0)
{
_dbus_warn ("inconsistent ServiceOwnedChanged message (\"%s\" [ %s -> %s ])\n",
CheckServiceOwnerChangedData socd;
_dbus_verbose ("killing connection %p\n", connection);
CheckServiceOwnerChangedData socd;
_dbus_verbose ("killing connection %p\n", connection);
/* kick in the disconnect handler that unrefs the connection */
dbus_connection_close (connection);
bus_test_run_everything (context);
/* kick in the disconnect handler that unrefs the connection */
dbus_connection_close (connection);
bus_test_run_everything (context);
/* Run disconnect handler in test.c */
if (bus_connection_dispatch_one_message (connection))
_dbus_assert_not_reached ("something received on connection being killed other than the disconnect");
/* Run disconnect handler in test.c */
if (bus_connection_dispatch_one_message (connection))
_dbus_assert_not_reached ("something received on connection being killed other than the disconnect");
_dbus_assert (!dbus_connection_get_is_connected (connection));
dbus_connection_unref (connection);
connection = NULL;
_dbus_assert (!bus_test_client_listed (connection));
_dbus_assert (!dbus_connection_get_is_connected (connection));
dbus_connection_unref (connection);
connection = NULL;
_dbus_assert (!bus_test_client_listed (connection));
socd.expected_kind = SERVICE_DELETED;
socd.expected_service_name = base_service;
socd.failed = FALSE;
socd.skip_connection = NULL;
socd.expected_kind = SERVICE_DELETED;
socd.expected_service_name = base_service;
socd.failed = FALSE;
socd.skip_connection = NULL;
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
dbus_free (base_service);
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
dbus_free (base_service);
if (!check_no_leftovers (context))
_dbus_assert_not_reached ("stuff left in message queues after disconnecting a client");
}
if (!check_no_leftovers (context))
_dbus_assert_not_reached ("stuff left in message queues after disconnecting a client");
}
_dbus_verbose ("Unchecked kill of connection %p\n", connection);
dbus_connection_ref (connection);
_dbus_verbose ("Unchecked kill of connection %p\n", connection);
dbus_connection_ref (connection);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
dbus_message_unref (message);
message = NULL;
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
dbus_message_unref (message);
message = NULL;
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
/* send our message */
bus_test_run_clients_loop (SEND_PENDING (connection));
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
/* send our message */
bus_test_run_clients_loop (SEND_PENDING (connection));
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
block_connection_until_message_from_bus (context, connection, "reply to Hello");
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
block_connection_until_message_from_bus (context, connection, "reply to Hello");
if (!dbus_connection_get_is_connected (connection))
{
_dbus_verbose ("connection was disconnected (presumably auth failed)\n");
if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
{
if (dbus_message_is_error (message,
if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
{
if (dbus_message_is_error (message,
while (!dbus_bus_set_unique_name (connection, name))
_dbus_wait_for_memory ();
while (!dbus_bus_set_unique_name (connection, name))
_dbus_wait_for_memory ();
socd.expected_kind = SERVICE_CREATED;
socd.expected_service_name = name;
socd.failed = FALSE;
socd.skip_connection = connection; /* we haven't done AddMatch so won't get it ourselves */
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
socd.expected_kind = SERVICE_CREATED;
socd.expected_service_name = name;
socd.failed = FALSE;
socd.skip_connection = connection; /* we haven't done AddMatch so won't get it ourselves */
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
retry_get_acquired_name:
if (!dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &acquired,
retry_get_acquired_name:
if (!dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &acquired,
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
{
warn_unexpected (connection, message, "method return for Hello");
if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
{
warn_unexpected (connection, message, "method return for Hello");
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
/* send our message */
bus_test_run_clients_loop (SEND_PENDING (connection));
if (!dbus_connection_get_is_connected (connection))
{
/* send our message */
bus_test_run_clients_loop (SEND_PENDING (connection));
if (!dbus_connection_get_is_connected (connection))
{
block_connection_until_message_from_bus (context, connection, "reply to AddMatch");
if (!dbus_connection_get_is_connected (connection))
{
block_connection_until_message_from_bus (context, connection, "reply to AddMatch");
if (!dbus_connection_get_is_connected (connection))
{
if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
{
if (dbus_message_is_error (message,
if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR)
{
if (dbus_message_is_error (message,
if (dbus_bus_get_unique_name (connection) == NULL)
{
/* We didn't successfully register, so we can't
if (dbus_bus_get_unique_name (connection) == NULL)
{
/* We didn't successfully register, so we can't
flags = 0;
if (!dbus_message_append_args (message,
DBUS_TYPE_STRING, &nonexistent,
flags = 0;
if (!dbus_message_append_args (message,
DBUS_TYPE_STRING, &nonexistent,
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
message = dbus_message_new_method_call (NONEXISTENT_SERVICE_NAME,
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
message = dbus_message_new_method_call (NONEXISTENT_SERVICE_NAME,
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
dbus_error_init (&error);
base_service = NULL;
old_owner = NULL;
base_service_from_bus = NULL;
message = initial_message;
dbus_error_init (&error);
base_service = NULL;
old_owner = NULL;
base_service_from_bus = NULL;
message = initial_message;
if (strcmp (base_service, base_service_from_bus) != 0)
{
_dbus_warn ("Expected base service activation, got \"%s\" instead with owner \"%s\"\n",
if (strcmp (base_service, base_service_from_bus) != 0)
{
_dbus_warn ("Expected base service activation, got \"%s\" instead with owner \"%s\"\n",
socd.expected_kind = SERVICE_CREATED;
socd.expected_service_name = base_service;
socd.failed = FALSE;
socd.skip_connection = connection;
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
socd.expected_kind = SERVICE_CREATED;
socd.expected_service_name = base_service;
socd.failed = FALSE;
socd.skip_connection = connection;
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
socd.expected_service_name = service_name;
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
socd.expected_service_name = service_name;
bus_test_clients_foreach (check_service_owner_changed_foreach,
&socd);
if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
{
warn_unexpected (connection, message, "reply to StartServiceByName");
if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
{
warn_unexpected (connection, message, "reply to StartServiceByName");
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after verifying existent activation results\n");
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after verifying existent activation results\n");
reget_service_name_arg:
if (!dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &service_name,
reget_service_name_arg:
if (!dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &service_name,
if (strcmp (service_name, activated_name) != 0)
{
_dbus_warn ("Expected to see service %s created, saw %s instead\n",
activated_name, service_name);
goto out;
}
if (strcmp (service_name, activated_name) != 0)
{
_dbus_warn ("Expected to see service %s created, saw %s instead\n",
activated_name, service_name);
goto out;
}
/* Note that this differs from regular activation in that we don't get a
* reply to ActivateService here.
*/
/* Note that this differs from regular activation in that we don't get a
* reply to ActivateService here.
*/
/* Now we are expecting ServiceOwnerChanged (deletion) messages for the base
* service and the activated_name. The base service
* notification is required to come last.
/* Now we are expecting ServiceOwnerChanged (deletion) messages for the base
* service and the activated_name. The base service
* notification is required to come last.
socd.failed = FALSE;
socd.skip_connection = NULL;
bus_test_clients_foreach (check_service_owner_changed_foreach,
socd.failed = FALSE;
socd.skip_connection = NULL;
bus_test_clients_foreach (check_service_owner_changed_foreach,
/* Kill off the test service by sending it a quit message */
message = dbus_message_new_method_call (service_name,
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Exit");
/* Kill off the test service by sending it a quit message */
message = dbus_message_new_method_call (service_name,
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Exit");
if (message == NULL)
{
/* Do this again; we still need the service to exit... */
if (!check_send_exit_to_service (context, connection,
service_name, base_service))
goto out;
if (message == NULL)
{
/* Do this again; we still need the service to exit... */
if (!check_send_exit_to_service (context, connection,
service_name, base_service))
goto out;
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!check_send_exit_to_service (context, connection,
service_name, base_service))
goto out;
if (!check_send_exit_to_service (context, connection,
service_name, base_service))
goto out;
if (!got_error)
{
/* If no error, wait for the test service to exit */
block_connection_until_message_from_bus (context, connection, "test service to exit");
if (!got_error)
{
/* If no error, wait for the test service to exit */
block_connection_until_message_from_bus (context, connection, "test service to exit");
_dbus_verbose ("Got error %s after test service exited\n",
dbus_message_get_error_name (message));
_dbus_verbose ("Got error %s after test service exited\n",
dbus_message_get_error_name (message));
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after %s\n",
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after %s\n",
flags = 0;
if (!dbus_message_append_args (message,
DBUS_TYPE_STRING, &existent,
flags = 0;
if (!dbus_message_append_args (message,
DBUS_TYPE_STRING, &existent,
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
/* We may need to block here for the test service to exit or finish up */
block_connection_until_message_from_bus (context, connection, "test service to exit or finish up");
/* We may need to block here for the test service to exit or finish up */
block_connection_until_message_from_bus (context, connection, "test service to exit or finish up");
if (message_kind != GOT_ERROR)
{
block_connection_until_message_from_bus (context, connection, "error about service exiting");
if (message_kind != GOT_ERROR)
{
block_connection_until_message_from_bus (context, connection, "error about service exiting");
if (!check_got_error (context, connection,
DBUS_ERROR_SPAWN_CHILD_EXITED,
DBUS_ERROR_NO_MEMORY,
if (!check_got_error (context, connection,
DBUS_ERROR_SPAWN_CHILD_EXITED,
DBUS_ERROR_NO_MEMORY,
if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
out:
if (message)
dbus_message_unref (message);
if (base_service_message)
dbus_message_unref (base_service_message);
out:
if (message)
dbus_message_unref (message);
if (base_service_message)
dbus_message_unref (base_service_message);
segv_service = "org.freedesktop.DBus.TestSuiteSegfaultService";
flags = 0;
if (!dbus_message_append_args (message,
segv_service = "org.freedesktop.DBus.TestSuiteSegfaultService";
flags = 0;
if (!dbus_message_append_args (message,
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"RunHelloFromSelf");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"RunHelloFromSelf");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running hello from self");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running hello from self");
"/org/freedesktop/TestSuite",
"org.freedesktop.DBus.Peer",
"Ping");
"/org/freedesktop/TestSuite",
"org.freedesktop.DBus.Peer",
"Ping");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running Ping");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running Ping");
message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
"/org/freedesktop/TestSuite",
"org.freedesktop.DBus.Peer",
"GetMachineId");
message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
"/org/freedesktop/TestSuite",
"org.freedesktop.DBus.Peer",
"GetMachineId");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running GetMachineId");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from running GetMachineId");
/* We can't check that the machine id is correct because during make check it is
* just made up for each process separately
*/
/* We can't check that the machine id is correct because during make check it is
* just made up for each process separately
*/
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
/* Check that ServiceOwnerChanged (creation) was correctly received */
if (!check_service_auto_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
/* Check that ServiceOwnerChanged (creation) was correctly received */
if (!check_service_auto_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
if (!dbus_connection_send (connection, message, &serial))
{
dbus_message_unref (message);
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
"/org/freedesktop/TestSuite",
"org.freedesktop.TestSuite",
"Echo");
/* Check that ServiceOwnerChanged (creation) was correctly received */
if (!check_service_auto_activated (context, connection, SHELL_SUCCESS_SERVICE_NAME,
base_service, message))
goto out;
/* Check that ServiceOwnerChanged (creation) was correctly received */
if (!check_service_auto_activated (context, connection, SHELL_SUCCESS_SERVICE_NAME,
base_service, message))
goto out;
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
* doesn't send a reply due to OOM.
*/
block_connection_until_message_from_bus (context, connection, "reply from echo message after auto-activation");
DBUS_TYPE_STRING, &argv[1],
DBUS_TYPE_STRING, &argv[2],
DBUS_TYPE_STRING, &argv[3],
DBUS_TYPE_STRING, &argv[1],
DBUS_TYPE_STRING, &argv[2],
DBUS_TYPE_STRING, &argv[3],
depending on the path to the tests
*/
if (strcmp("-test", argv[1]) != 0)
{
depending on the path to the tests
*/
if (strcmp("-test", argv[1]) != 0)
{
if (!check_send_exit_to_service (context, connection,
SHELL_SUCCESS_SERVICE_NAME,
base_service))
goto out;
if (!check_send_exit_to_service (context, connection,
SHELL_SUCCESS_SERVICE_NAME,
base_service))
goto out;
if (!check_no_leftovers (d->context))
{
_dbus_warn ("Messages were left over, should be covered by test suite\n");
if (!check_no_leftovers (d->context))
{
_dbus_warn ("Messages were left over, should be covered by test suite\n");
if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
if (!check_service_activated (context, connection, EXISTENT_SERVICE_NAME,
base_service, message))
goto out;
if (!check_get_services (context, connection, "ListNames", &services, &len))
{
return TRUE;
if (!check_get_services (context, connection, "ListNames", &services, &len))
{
return TRUE;
if (!check_no_leftovers (d->context))
{
_dbus_warn ("Messages were left over, should be covered by test suite\n");
if (!check_no_leftovers (d->context))
{
_dbus_warn ("Messages were left over, should be covered by test suite\n");
if (!_dbus_concat_dir_and_file (&full, &file))
{
_dbus_string_free (&full);
return FALSE;
}
if (!_dbus_concat_dir_and_file (&full, &file))
{
_dbus_string_free (&full);
return FALSE;
}
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, foo);
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, foo);
if (!check_hello_message (context, foo))
_dbus_assert_not_reached ("hello message failed");
if (!check_hello_message (context, foo))
_dbus_assert_not_reached ("hello message failed");
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("AddMatch message failed");
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("AddMatch message failed");
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, bar);
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, bar);
if (!check_hello_message (context, bar))
_dbus_assert_not_reached ("hello message failed");
if (!check_add_match_all (context, bar))
_dbus_assert_not_reached ("AddMatch message failed");
if (!check_hello_message (context, bar))
_dbus_assert_not_reached ("hello message failed");
if (!check_add_match_all (context, bar))
_dbus_assert_not_reached ("AddMatch message failed");
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, baz);
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, baz);
if (!check_hello_message (context, baz))
_dbus_assert_not_reached ("hello message failed");
if (!check_hello_message (context, baz))
_dbus_assert_not_reached ("hello message failed");
if (!check_list_services (context, baz))
_dbus_assert_not_reached ("ListActivatableNames message failed");
if (!check_list_services (context, baz))
_dbus_assert_not_reached ("ListActivatableNames message failed");
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after setting up initial connections\n");
_dbus_assert_not_reached ("initial connection setup failed");
}
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after setting up initial connections\n");
_dbus_assert_not_reached ("initial connection setup failed");
}
check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
check_nonexistent_service_no_auto_start);
check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
check_nonexistent_service_no_auto_start);
check2_try_iterations (context, foo, "segfault_service_no_auto_start",
check_segfault_service_no_auto_start);
#endif
check2_try_iterations (context, foo, "segfault_service_no_auto_start",
check_segfault_service_no_auto_start);
#endif
check2_try_iterations (context, foo, "existent_service_no_auto_start",
check_existent_service_no_auto_start);
check2_try_iterations (context, foo, "existent_service_no_auto_start",
check_existent_service_no_auto_start);
check2_try_iterations (context, foo, "nonexistent_service_auto_start",
check_nonexistent_service_auto_start);
check2_try_iterations (context, foo, "nonexistent_service_auto_start",
check_nonexistent_service_auto_start);
_dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
#else
/* only do the segfault test if we are not using the launcher */
_dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
#else
/* only do the segfault test if we are not using the launcher */
check2_try_iterations (context, foo, "existent_service_auto_auto_start",
check_existent_service_auto_start);
#endif
check2_try_iterations (context, foo, "existent_service_auto_auto_start",
check_existent_service_auto_start);
#endif
if (!check_existent_service_auto_start (context, foo))
_dbus_assert_not_reached ("existent service auto start failed");
if (!check_existent_service_auto_start (context, foo))
_dbus_assert_not_reached ("existent service auto start failed");
/* save the config name for the activation helper */
if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
_dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
/* save the config name for the activation helper */
if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
_dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
/* run launch-helper activation tests */
_dbus_verbose ("Launch helper activation tests\n");
if (!bus_dispatch_test_conf (test_data_dir,
/* run launch-helper activation tests */
_dbus_verbose ("Launch helper activation tests\n");
if (!bus_dispatch_test_conf (test_data_dir,
if (!bus_dispatch_test_conf_fail (test_data_dir,
"valid-config-files-system/debug-allow-all-fail.conf"))
return FALSE;
if (!bus_dispatch_test_conf_fail (test_data_dir,
"valid-config-files-system/debug-allow-all-fail.conf"))
return FALSE;
context = bus_context_new_test (test_data_dir,
"valid-config-files/debug-allow-all-sha1.conf");
if (context == NULL)
return FALSE;
context = bus_context_new_test (test_data_dir,
"valid-config-files/debug-allow-all-sha1.conf");
if (context == NULL)
return FALSE;
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, foo);
_dbus_assert_not_reached ("could not set up connection");
spin_connection_until_authenticated (context, foo);
if (!check_hello_message (context, foo))
_dbus_assert_not_reached ("hello message failed");
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("addmatch message failed");
if (!check_hello_message (context, foo))
_dbus_assert_not_reached ("hello message failed");
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("addmatch message failed");
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after setting up initial SHA-1 connection\n");
_dbus_assert_not_reached ("initial connection setup failed");
}
if (!check_no_leftovers (context))
{
_dbus_warn ("Messages were left over after setting up initial SHA-1 connection\n");
_dbus_assert_not_reached ("initial connection setup failed");
}
int one[2], two[2], x, y, z;
char r;
int one[2], two[2], x, y, z;
char r;
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("AddMatch message failed");
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("AddMatch message failed");