dbus-runner: Add colord mocking

This will be needed for adding colord integration without breaking
testing.

The test context is altered to make sure any left over color devices are
cleaned up before starting. This means it becomes possible to run a test
case multiple times without having to restart meta-dbus-runner.py.

Note: Don't use os.getlogin() to get the current username; as that
requires a controlling terminal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
This commit is contained in:
Jonas Ådahl
2021-10-28 15:35:43 +02:00
committed by Marge Bot
parent 67e7140c25
commit 4fe743e03b
4 changed files with 113 additions and 5 deletions

View File

@ -42,6 +42,7 @@ class MutterDBusTestCase(DBusTestCase):
'meta-mocks-manager', {'templates-dir': get_templates_dir()})
klass.start_from_local_template('localed')
klass.start_from_local_template('colord')
klass.system_bus_con = klass.get_dbus(system_bus=True)
klass.session_bus_con = klass.get_dbus(system_bus=False)