diff options
author | Federico Mena Quintero <federico@gnome.org> | 2022-07-12 14:21:39 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2022-07-12 21:48:16 -0500 |
commit | d281f8e0cf0d023789006b449dd83d63edb08301 (patch) | |
tree | d044accb57f04ccb7710681cda33f41b181fb262 /ci/run-registryd-tests.sh | |
parent | 178a4238c147363150266d3524d87bbed4887e22 (diff) | |
download | at-spi2-core-d281f8e0cf0d023789006b449dd83d63edb08301.tar.gz |
Control the registry fixture's lifetime via a mock gnome-session
As for the code coverage job, we need registryd's tests to be able to
control the lifetime of at-spi-bus-launcher and at-spi2-registryd.
So, the session_manager() fixture assumes that it is running alonside
a gnome-session dbus mock. The teardown code tells the session to
Logout - this will make the mock notify session clients that they have
to terminate.
Diffstat (limited to 'ci/run-registryd-tests.sh')
-rwxr-xr-x | ci/run-registryd-tests.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ci/run-registryd-tests.sh b/ci/run-registryd-tests.sh new file mode 100755 index 00000000..a664b96a --- /dev/null +++ b/ci/run-registryd-tests.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -eu + +echo "About to run the tests. First we'll launch a gnome-session DBus mock." + +python3 -m dbusmock --session org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager & +sleep 1 + +gdbus call --session \ + --dest org.gnome.SessionManager \ + --object-path /org/gnome/SessionManager \ + --method org.freedesktop.DBus.Mock.AddTemplate 'tests/dbusmock/mock-gnome-session.py' '{}' + +gdbus call --session \ + --dest org.gnome.SessionManager \ + --object-path /org/gnome/SessionManager \ + --method org.freedesktop.DBus.Mock.SetSessionRunning true + +cd tests/registryd +pytest -v |