Skip to content
Snippets Groups Projects
Commit 504bae20 authored by Simon McVittie's avatar Simon McVittie
Browse files

tests/launcher: Test new Terminate() method

parent 329628c5
No related branches found
No related tags found
No related merge requests found
...@@ -202,6 +202,7 @@ class TestLauncher(BaseTest): ...@@ -202,6 +202,7 @@ class TestLauncher(BaseTest):
def test_socket(self) -> None: def test_socket(self) -> None:
with tempfile.TemporaryDirectory(prefix='test-') as temp: with tempfile.TemporaryDirectory(prefix='test-') as temp:
need_terminate = True
proc = subprocess.Popen( proc = subprocess.Popen(
self.launcher + [ self.launcher + [
'--socket', os.path.join(temp, 'socket'), '--socket', os.path.join(temp, 'socket'),
...@@ -365,8 +366,23 @@ class TestLauncher(BaseTest): ...@@ -365,8 +366,23 @@ class TestLauncher(BaseTest):
'Process %d did not exit' % pid 'Process %d did not exit' % pid
) )
conn.call_sync(
None,
LAUNCHER_PATH,
LAUNCHER_IFACE,
'Terminate',
GLib.Variant('()', ()),
GLib.VariantType('()'),
Gio.DBusCallFlags.NONE,
-1,
None,
)
need_terminate = False
finally: finally:
proc.terminate() if need_terminate:
proc.terminate()
proc.wait() proc.wait()
self.assertEqual(proc.returncode, 0) self.assertEqual(proc.returncode, 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment