Re: How to make automated tests for clients of D-Bus system service?

Simon McVittie <smcv-ZGY8ohtN/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
On Tue, 06 Feb 2018 at 14:32:49 +0100, Miroslav Kravec wrote:
> How do I start own dbus-daemon?

Look at how python-dbusmock does it (I think it has convenience code to
do that for you?), or at the other examples I linked. The tl;dr version
is something like this:

    dbus-daemon --fork --config=your-config-file-here \
        --print-address=3 --print-pid=4 3>address.txt 4>pid.txt

Now your bus address is in address.txt, and the process ID to kill
afterwards is in pid.txt. (Or use pipes.)

> $ dbus-daemon --print-address
> No configuration file specified.

You'll need a configuration file that looks like a hybrid of the session
bus and the system bus, and optionally picks up .service files from a
directory that you control (or you can run the mock service explicitly
and wait for it to appear instead). python-dbusmock probably has some
examples of this.  If not, test/name-test/tmp-session-like-system.conf
in dbus.git is the sort of thing I mean.

    smcv
_______________________________________________
dbus mailing list
[email protected]
https://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.