D-Bus unit tests

Thomas Sondergaard <ts-2vlBz+Gd9o2sRyR5/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
Hi,

I have a bunch of unit tests that use D-Bus that are run by jenkins. On 
Linux, jenkins starts an Xvnc display for me, on Windows I just have the 
jenkins users local display. I would like to be able to run my tests in 
parallel, and to that end I want each started test executable to start 
its own dbus-daemon, but I want child processes started by the test 
executable to use that same D-Bus daemon. I'm Using QtDBus (Qt 4.8, 
hopefully 5.x soon).

My thinking is that I need to do something like this:
qputenv("DBUS_SESSION_BUS_ADDRESS", "autolaunch:");
QDBusConnection::sessionBus(); // Trigger connect
qputenv("DBUS_SESSION_BUS_ADDRESS", 
getDBusAddress(QDBusConnection::sessionBus()));

Unfortunately, I don't know how to implement getDBusAddress(), but the 
autolaunch: mechanism also doesn't work as I expect. If another process 
has already been started with autolaunch: I get connected to it's 
dbus-daemon (on RHEL7 linux, haven't tried on Windows). Btw, this seems 
inconsistent with http://dbus.freedesktop.org/doc/dbus-launch.1.html 
which says "Whenever an autolaunch occurs, the application that had to 
start a new bus will be in its own little world". It is however 
consistent with 
http://dbus.freedesktop.org/doc/dbus-specification.html#meta-transports-autolaunch.

I hope you can help me with this. I'd like a solution that works on both 
Linux and Windows.

Thank you for your time
Thomas

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.