Skip to content

Commit

Permalink
tests/extra: add vm.run(..., gui=) argument
Browse files Browse the repository at this point in the history
A convenient (and compatible) option to wait for user session before
starting the command.

(cherry picked from commit c425df6)
  • Loading branch information
marmarek committed Oct 22, 2020
1 parent b61690e commit 7c28646
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion qubes/tests/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ def shutdown(self):
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(
Expand Down

0 comments on commit 7c28646

Please sign in to comment.