GDBus: Avoid use of libdbus-1 in authentication tests
authorDavid Zeuthen <zeuthen@gmail.com>
Thu, 3 Jan 2013 16:57:21 +0000 (11:57 -0500)
committerDavid Zeuthen <zeuthen@gmail.com>
Thu, 3 Jan 2013 17:12:55 +0000 (12:12 -0500)
commit2652dc13573471a1a20070fdeef0c44eb0aa4f9a
tree7bc28d6d2fbdd446b54343ac6d607445c827da68
parent03e84f936fd6f4acbcdf671cc6be5b0690ee7ea6
GDBus: Avoid use of libdbus-1 in authentication tests

This greatly simplifies the test since everything is now in a single
process and possible bugs / quirks in libdbus-1 will not interfere
with the tests. On the other hand, we no longer test interoperability
with libdbus-1. This is somewhat moot, however, since other tests that
involve a message bus (e.g. GTestDBus users which include most of the
GDBus test suite itself) will test this.

Also ensure that we don't pollute existing D-Bus keyrings for the
DBUS_COOKIE_SHA1 authentication method (e.g. files in the
~/.dbus-keyrings directory) by setting the environment variables
G_DBUS_COOKIE_SHA1_KEYRING_DIR and
G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION.

All in all, this change avoids some thorny issues where the GDBus and
libdbus-1 implementations disagree on whether an item in the D-Bus
keyring is still valid (items have an age etc.). In reality, since the
DBUS_COOKIE_SHA1 authentication method is never used in production,
this is never hit in production. This bug was, however, frequently hit
if you just ran the test suite repeatedly for 15 minutes or so.

Also add TODO items to mention that we currently don't test corner
cases involving

 - DBUS_COOKIE_SHA1 timeouts
 - libdbus-1 interoperability

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
gio/tests/Makefile.am
gio/tests/gdbus-auth.c