Commit c67913c9 authored by Andrea Bolognani's avatar Andrea Bolognani

tests: Explicitly spawn a session libvirt-dbus instance

Tests are performed using the session D-Bus instance, so we
should launch libvirt-dbus in session mode as well.

This was working fine when running the tests as a regular
user, because in that case libvirt-dbus would default to
session mode, but fail when running them as root because
libvirt-dbus would run in system mode and consequently not
show up on the session bus.

Of course building and runnning the test suite as root is
a pretty bad idea in general, but a lot of distributions
run at least part of their package build steps with pretend
root privileges (eg. fakeroot), so we have to make sure it
works in that scenario too.
Signed-off-by: 's avatarAndrea Bolognani <>
Reviewed-by: 's avatarKaterina Koukiou <>
parent 153e4f4b
......@@ -33,7 +33,7 @@ class BaseTestClass():
"""Start libvirt-dbus for each test function
os.environ['LIBVIRT_DEBUG'] = '3'
self.libvirt_dbus = subprocess.Popen([exe])
self.libvirt_dbus = subprocess.Popen([exe, '--session'])
self.bus = dbus.SessionBus()
for i in range(10):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment