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:
parent
46cc4ca910
commit
c425df6c57
@ -80,7 +80,14 @@ class VMWrapper(object):
|
|||||||
return self._loop.run_until_complete(self._vm.shutdown())
|
return self._loop.run_until_complete(self._vm.shutdown())
|
||||||
|
|
||||||
def run(self, command, wait=False, user=None, passio_popen=False,
|
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:
|
if wait:
|
||||||
try:
|
try:
|
||||||
self._loop.run_until_complete(
|
self._loop.run_until_complete(
|
||||||
|
Loading…
Reference in New Issue
Block a user