Bug 40352

Summary: test-autolaunch fails if DISPLAY is unset
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: normal    
Priority: medium CC: chengwei.yang.cn, hp
Version: 1.4.xKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Don't assume that X11 autolaunch will work if DISPLAY is unset

Description Simon McVittie 2011-08-24 07:03:20 UTC
When performing X11 autolaunch, libdbus refuses to do anything if DISPLAY isn't set. However, the regression test assumes that, if enabled, autolaunch will work.

For instance, this is a problem when building dbus in a minimal chroot with no X server, but with X11 support enabled (as is done in Debian).
Comment 1 Simon McVittie 2011-08-24 07:09:01 UTC
Created attachment 50544 [details] [review]
Don't assume that X11 autolaunch will work if DISPLAY is unset

In practice, it won't; other forms of autolaunch (like Mac OS launchd)
might, but we can't really assert either way.
Comment 2 Simon McVittie 2011-09-26 03:23:41 UTC
I actually wonder whether to just disable test-autolaunch altogether, unless we can find something like Debian's xvfb-run (which runs a specified app under a temporary Xvfb server). It seems to me as though this test doesn't necessarily really test anything, and at worst it spuriously fails (in a minimal environment, with inaccessible X, etc.). It'd also be easy for it to leak a dbus-daemon/dbus-launch pair, which isn't ideal.
Comment 3 Simon McVittie 2013-08-22 17:12:53 UTC
(In reply to comment #0)
> When performing X11 autolaunch, libdbus refuses to do anything if DISPLAY
> isn't set. However, the regression test assumes that, if enabled, autolaunch
> will work.
> 
> For instance, this is a problem when building dbus in a minimal chroot with
> no X server, but with X11 support enabled (as is done in Debian).

I'd like the Debian package build to be able to run the tests, one day...
Comment 4 Chengwei Yang 2013-09-12 13:19:35 UTC
Comment on attachment 50544 [details] [review]
Don't assume that X11 autolaunch will work if DISPLAY is unset

Review of attachment 50544 [details] [review]:
-----------------------------------------------------------------

Looks good.
Comment 5 Chengwei Yang 2013-09-13 02:45:51 UTC
(In reply to comment #4)
> Comment on attachment 50544 [details] [review] [review]
> Don't assume that X11 autolaunch will work if DISPLAY is unset
> 
> Review of attachment 50544 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> Looks good.

Ops, need include "dbus/dbus-sysdeps.h" to fix build, introduced by calling _dbus_getenv().
Comment 6 Simon McVittie 2013-09-13 13:50:49 UTC
(In reply to comment #5)
> Ops, need include "dbus/dbus-sysdeps.h" to fix build, introduced by calling
> _dbus_getenv().

When I wrote the patch, this file included dbus/dbus-sysdeps.h for _dbus_setenv, but I removed that in commit 412538b3b9. Reinstated and applied, 1.7.6.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.