After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697261 - incomplete GTestDBus sandboxing
incomplete GTestDBus sandboxing
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-04 12:51 UTC by Simon McVittie
Modified: 2013-08-23 17:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tracker tests: do not request starting all Tracker services (1.02 KB, patch)
2013-04-04 15:29 UTC, Simon McVittie
committed Details | Review
all tests: disable non-local GIO VFS backends, such as gvfs (968 bytes, patch)
2013-04-04 15:29 UTC, Simon McVittie
committed Details | Review
tests: clear out various D-Bus-related variables (2.67 KB, patch)
2013-04-04 15:29 UTC, Simon McVittie
committed Details | Review
Do not distribute _gen/param-spec-struct.h in tarballs or scan it with g-i (1.08 KB, patch)
2013-04-04 15:29 UTC, Simon McVittie
reviewed Details | Review

Description Simon McVittie 2013-04-04 12:51:05 UTC
I recently upgraded to GNOME 3.8 from Debian experimental (as opposed to the pile of installations-from-source I was previously using) and now the Folks tests fail:

* GIO tries to activate gvfs, which isn't available because the GTestDBus environment has no service-activation by default

* the Telepathy bits try to use the "starter bus" which points to the real session, so they can't take the AccountManager bus name

Workaround: run them with:

    GIO_USE_VFS=local DBUS_STARTER_ADDRESS= DBUS_STARTER_BUS_TYPE= \
    DBUS_SESSION_BUS_ADDRESS=

I'll add those to the test-case base class (arguably, GTestDBus should do at least some of that, though).
Comment 1 Simon McVittie 2013-04-04 15:29:00 UTC
Created attachment 240623 [details] [review]
tracker tests: do not request starting all Tracker  services

We don't care about tracker-miner-fs etc. for these tests; all we want
to do is stop any running Tracker stuff. D-Bus service activation will
ensure that we get the necessary services when they're needed, without
starting the unnecessary ones.

(This fixes the Tracker tests on a system without tracker-miner-fs.)
Comment 2 Simon McVittie 2013-04-04 15:29:16 UTC
Created attachment 240624 [details] [review]
all tests: disable non-local GIO VFS backends, such as  gvfs
Comment 3 Simon McVittie 2013-04-04 15:29:34 UTC
Created attachment 240625 [details] [review]
tests: clear out various D-Bus-related variables

The actual terminal in gnome-terminal 3.8 is an activatable service,
so it has DBUS_STARTER_ADDRESS in its environment. telepathy-glib prefers
DBUS_STARTER_ADDRESS over DBUS_SESSION_BUS_ADDRESS, but GTestDBus
doesn't clear or set the former, only the latter; so we end up trying to
use the real bus when run under a recent gnome-terminal.

See also <https://bugs.freedesktop.org/show_bug.cgi?id=63119>.
Comment 4 Simon McVittie 2013-04-04 15:29:53 UTC
Created attachment 240626 [details] [review]
Do not distribute _gen/param-spec-struct.h in tarballs  or scan it with g-i

It isn't self-contained, and provokes a (non-fatal) syntax error from
g-ir-scanner.
Comment 5 Philip Withnall 2013-04-04 19:05:41 UTC
Review of attachment 240623 [details] [review]:

++
Comment 6 Philip Withnall 2013-04-04 19:06:08 UTC
Review of attachment 240624 [details] [review]:

++
Comment 7 Philip Withnall 2013-04-04 19:10:56 UTC
Review of attachment 240625 [details] [review]:

Have you filed a bug against GTestDBus for this? The patch looks good, but if you do file a bug against GTestDBus, please add a FIXME referencing it. Thanks!
Comment 8 Philip Withnall 2013-04-04 19:13:23 UTC
Review of attachment 240626 [details] [review]:

I don’t know this bit of the code base well enough to review this properly; but it’s copied from Telepathy so I defer to your expertise.
Comment 9 Simon McVittie 2013-04-05 13:44:09 UTC
Comment on attachment 240623 [details] [review]
tracker tests: do not request starting all Tracker  services

53337413f
Comment 10 Simon McVittie 2013-04-05 13:44:18 UTC
Comment on attachment 240624 [details] [review]
all tests: disable non-local GIO VFS backends, such as  gvfs

bfab3ee2
Comment 11 Simon McVittie 2013-04-05 13:44:25 UTC
Comment on attachment 240625 [details] [review]
tests: clear out various D-Bus-related variables

1322054
Comment 12 Philip Withnall 2013-04-05 15:37:14 UTC
(In reply to comment #7)
> Have you filed a bug against GTestDBus for this? The patch looks good, but if
> you do file a bug against GTestDBus, please add a FIXME referencing it. Thanks!

For reference, bug #697348 has been filed against GTestDBus.

(In reply to comment #8)
> Review of attachment 240626 [details] [review]:
> 
> I don’t know this bit of the code base well enough to review this properly; but
> it’s copied from Telepathy so I defer to your expertise.

i.e. “Please commit it if you think it’s the right fix”.
Comment 13 Simon McVittie 2013-08-23 17:35:04 UTC
(In reply to comment #12)
> i.e. “Please commit it if you think it’s the right fix”.

Committed for 0.9.6.