summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-06-08 17:04:24 +0100
committerSimon McVittie <smcv@collabora.com>2017-06-08 18:30:39 +0100
commitffa410a0403dcba0116f644749c82e7fc2a0c49f (patch)
tree307407bcf138c1880a7b7204a1c4dbc0b52446f5 /bus
parent015a5cf36d431a7431d67185f87398368508c488 (diff)
downloaddbus-ffa410a0403dcba0116f644749c82e7fc2a0c49f.tar.gz
tests: Don't exercise GetMachineId() or autolaunch if no machine ID
At the moment there is a hack in the implementation of GetMachineId() to stop tests from failing during "make check" on a system where dbus has never been installed, by silently generating a new unique fake "machine ID" for each process. I'm about to change that behaviour to report errors properly; skip affected test-cases if we can't read the real machine ID. The shell scripts to test dbus-launch are run both as "make check" tests (for which it is valid for dbus to be not correctly installed) and as installed-tests (for which that is not valid), so make them pass during "make check" but fail during installed testing. The tests in bus/ and test/name-test/ are only run during "make check" so they only have the code path where they are skipped. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
Diffstat (limited to 'bus')
-rw-r--r--bus/dispatch.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 2b590741..19228bed 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -3330,10 +3330,21 @@ static dbus_bool_t
check_existent_get_machine_id (BusContext *context,
DBusConnection *connection)
{
+ DBusError error = DBUS_ERROR_INIT;
DBusMessage *message;
dbus_uint32_t serial;
+ DBusGUID uuid;
const char *machine_id;
+ if (!_dbus_read_local_machine_uuid (&uuid, FALSE, &error))
+ {
+ /* Unable to test further: either we ran out of memory, or neither
+ * dbus nor systemd was ever correctly installed on this machine */
+ _dbus_verbose ("Machine UUID not available: %s", error.message);
+ dbus_error_free (&error);
+ return TRUE;
+ }
+
message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
"/org/freedesktop/TestSuite",
"org.freedesktop.DBus.Peer",