DBus Testing Framework

What is it ?

You may know that testing dbus services or debugging dbus clients is not always easy since it involves creating services and wiring up things you don’t really want to do in a test script.

This framework (quite a buzzword) allows you to easily setup and run dbus services and clients in a linear python script.

Originally written for the telepathy framework (a inter process communication framework aiming to bring conversation as first-class desktop citizen) (don’t laugh rob), an heavy consumer of dbus stuff, and sponsored by Collabora.

Libnotify Sample

Just to have a teaser, here is a libnotify test sample, it opens a notification bubble and then close it and checks that the closing reason and id is correct:

self["notif"] = ("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications")

id = self["notif"]["Notify"].call("notifname", 0, "", "title", "content",[],{}, 0)

self["notif"]["NotificationClosed"].listen()
self["notif"]["CloseNotification"].call(id)
results = self["notif"]["NotificationClosed"].wait()

assert results[0] == id

Documentation and download

You can access the full explanation and tutorial and documentation on this page. For the moment the framework is a single python file available here and you can download the sample tests file to get an idea of what kind of scripts can be written.

Comments

One response to “DBus Testing Framework”

  1. Tristan Matthews Avatar
    Tristan Matthews

    Hi,

    The link https://raphael.slinckx.net/files/dbustesting.py is broken.
    I imagine that this is the same file in the python-insanity package?

Leave a Reply