Products › lamco-dbus-tools › Docs

Check a D-Bus interface in CI, and compare two versions

Check a D-Bus interface in CI: Introspect a running service with dbussee, compare two versions with dbustell drift, and fail the job on a breaking change.

Describes version 0.4.1.

What a running service offers

$ dbussee introspect org.freedesktop.login1 --bus system
/org/freedesktop/LogControl1
  org.freedesktop.LogControl1: 0 methods, 0 signals, 3 properties
/org/freedesktop/login1
  org.freedesktop.login1.Manager: 62 methods, 10 signals, 51 properties
/org/freedesktop/login1/user/_1000
...
org.freedesktop.login1 (:1.2) asked at 17 objects from /, with the no-start flag: 11 with interfaces of its own, 0 failed

It asks the service at each object, with the flag that forbids starting it. A service started on demand has to be running already: hostnamectl status starts hostname1, for one. --out keeps it all.

Part of a service, or a large one

--path starts the walk at an object below /, and --max-objects stops it after so many objects asked, saying so; a service with thousands of objects, such as a file index, stops at 2,000 unless told otherwise. dbustell drift --service NAME takes one service from a capture that holds several. Run against the lamp of changing a service's state (docs/measurements/stage-13/flags/):

$ dbussee introspect com.example.Lamp --path /com/example
/com/example/Lamp
  com.example.Lamp: 0 methods, 0 signals, 1 properties
com.example.Lamp (:1.1) asked at 2 objects from /com/example, with the no-start flag: 1 with interfaces of its own, 0 failed
$ dbussee introspect com.example.Lamp --max-objects 2
com.example.Lamp (:1.1) asked at 2 objects from /, with the no-start flag: 0 with interfaces of its own, 0 failed; stopped at 2, more were named
$ dbustell drift lamp.json lamp.json --service com.example.Lamp
0 changes, 0 breaking. Interfaces were compared by name; --objects compares the objects of two live trees too.

Two versions

dbussee --bus system --out before.json introspect org.freedesktop.hostname1
# upgrade
dbussee --bus system --out after.json introspect org.freedesktop.hostname1
dbustell drift before.json after.json

Each difference is breaking, for new clients only, or information, as the drift rules give them, and the command exits 1 on a breaking one. From Debian 13's systemd 257 to Fedora 45's 262, hostname1 gained three methods and seven properties, all for new clients only.

--objects also compares the objects, which suits two readings of one service on one machine.

In the service's own CI

Keep the interface's XML in the project, as many do, and hold what the build runs to it:

dbus-run-session -- sh -c '
  ./my-service &
  dbussee --out live.json introspect com.example.Catalog
  dbustell drift interfaces/com.example.Catalog.xml live.json --junit drift.xml
'

A breaking change fails the job, and the JUnit report has a case for each change, a breaking one failing. A client broken by a changed signature runs this against three versions of a service.