8585
8585
dbus_message_unref (method_call);
8586
8586
dbus_message_unref (reply);
8588
/* Expect the Get call for the processes, reply with
8589
* a main process pid.
8588
/* Expect the Reload call against job instance
8589
* and reply with an instance path to
8591
8592
TEST_DBUS_MESSAGE (server_conn, method_call);
8593
8594
TEST_TRUE (dbus_message_is_method_call (method_call,
8594
DBUS_INTERFACE_PROPERTIES,
8595
DBUS_INTERFACE_UPSTART_INSTANCE,
8597
8598
TEST_EQ_STR (dbus_message_get_path (method_call),
8598
8599
DBUS_PATH_UPSTART "/jobs/test/_");
8600
8601
TEST_TRUE (dbus_message_get_args (method_call, NULL,
8601
DBUS_TYPE_STRING, &interface,
8602
DBUS_TYPE_STRING, &property,
8603
8602
DBUS_TYPE_INVALID));
8605
TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE);
8606
TEST_EQ_STR (property, "processes");
8608
8604
TEST_ALLOC_SAFE {
8609
8605
reply = dbus_message_new_method_return (method_call);
8611
dbus_message_iter_init_append (reply, &iter);
8613
dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT,
8614
(DBUS_TYPE_ARRAY_AS_STRING
8615
DBUS_STRUCT_BEGIN_CHAR_AS_STRING
8616
DBUS_TYPE_STRING_AS_STRING
8617
DBUS_TYPE_INT32_AS_STRING
8618
DBUS_STRUCT_END_CHAR_AS_STRING),
8621
dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY,
8622
(DBUS_STRUCT_BEGIN_CHAR_AS_STRING
8623
DBUS_TYPE_STRING_AS_STRING
8624
DBUS_TYPE_INT32_AS_STRING
8625
DBUS_STRUCT_END_CHAR_AS_STRING),
8628
dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_STRUCT,
8633
dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING,
8636
int32_value = proc_pid;
8637
dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32,
8640
dbus_message_iter_close_container (&arrayiter, &structiter);
8642
dbus_message_iter_close_container (&subiter, &arrayiter);
8644
dbus_message_iter_close_container (&iter, &subiter);
8647
8608
dbus_connection_send (server_conn, reply, NULL);