DBus Testing Framework

Hello dbus coders out here, i’m pleased to announce the first release of a 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.


Posted

in

,

by

Comments

7 responses to “DBus Testing Framework”

  1. Rob Taylor Avatar
    Rob Taylor

    Damn you, you cheeky monkey! Good work tho…

  2. jean-françois rameau Avatar
    jean-françois rameau

    There’s a typo in your text: https://raphael.slinckx.net/files/dbustesting-smaple.py should point to https://raphael.slinckx.net/files/dbustesting-sample.py

    Nice work. I’m using it to test heavely net-monitor in epiphany 🙂

  3. Ivan Sas Avatar
    Ivan Sas

    I have a small question about “dbustesting.py”.
    What library I should install to have “gobject” python module.
    By now, running “dbustesting.py” puts:
    Traceback (most recent call last):
    File “dbustesting.py”, line 7, in ?
    Import gobject
    ImportError: No module named gobject

    Thank you.

  4. Raphaël Slinckx Avatar

    Depending on your distro, the package containing gobject is the python-gobject package, or the python-gtk or pygtk, or pygobject, or combinations of the previous.

  5. zeekay Avatar
    zeekay

    Hi,
    usefull framework but I have one question:
    what is the licence of the software.
    I cannot find anything or … overlook something.

    Waiting for the answer.
    Thanks.

  6. Quaid Avatar
    Quaid

    Link is dead

  7. Johnicholas Avatar
    Johnicholas

    Link is still dead, 500 internal server error.