ci: start the dbus mock server in GN CI
This commit is contained in:
parent
a4f02724bf
commit
00b2d94785
3 changed files with 18 additions and 9 deletions
|
@ -6,17 +6,23 @@ import os
|
|||
import sys
|
||||
|
||||
|
||||
def cleanup():
|
||||
def stop():
|
||||
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
|
||||
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
||||
|
||||
def start():
|
||||
dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||
|
||||
atexit.register(cleanup)
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, dbusmock_log)
|
||||
|
||||
dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)
|
||||
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, dbusmock_log)
|
||||
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)
|
||||
if __name__ == '__main__':
|
||||
import subprocess
|
||||
start()
|
||||
try:
|
||||
subprocess.check_call(sys.argv[1:])
|
||||
finally:
|
||||
stop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue