tests/extra: add vm.run(..., gui=) argument

A convenient (and compatible) option to wait for user session before
starting the command.
This commit is contained in:
Marek Marczykowski-Górecki 2020-08-08 21:55:45 +02:00
parent 46cc4ca910
commit c425df6c57
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -80,7 +80,14 @@ class VMWrapper(object):
return self._loop.run_until_complete(self._vm.shutdown())
def run(self, command, wait=False, user=None, passio_popen=False,
passio_stderr=False, **kwargs):
passio_stderr=False, gui=False, **kwargs):
if gui:
try:
self._loop.run_until_complete(
self._vm.run_service_for_stdio('qubes.WaitForSession',
user=user))
except subprocess.CalledProcessError as err:
return err.returncode
if wait:
try:
self._loop.run_until_complete(