tools/qvm-run: do not check if DispVM is paused before starting it
DispVM is created on start, so it can't be paused - it doesn't exist
yet.
Fixes: 4a6b5db
"qvm-run will unpause paused VMs by defaults"
This commit is contained in:
parent
a57396d462
commit
6f39533a65
@ -366,9 +366,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
def test_008_dispvm_remote(self):
|
def test_008_dispvm_remote(self):
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm', '--service', 'test.service'], app=self.app)
|
['--dispvm', '--service', 'test.service'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
@ -383,9 +380,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
def test_009_dispvm_remote_specific(self):
|
def test_009_dispvm_remote_specific(self):
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm:test-vm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm=test-vm', '--service', 'test.service'], app=self.app)
|
['--dispvm=test-vm', '--service', 'test.service'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
@ -409,9 +403,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('disp123', 'admin.vm.property.Get', 'qrexec_timeout', None)] = \
|
('disp123', 'admin.vm.property.Get', 'qrexec_timeout', None)] = \
|
||||||
b'0\0default=yes type=int 30'
|
b'0\0default=yes type=int 30'
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm', '--service', 'test.service'], app=self.app)
|
['--dispvm', '--service', 'test.service'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
@ -436,9 +427,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('disp123', 'admin.vm.property.Get', 'qrexec_timeout', None)] = \
|
('disp123', 'admin.vm.property.Get', 'qrexec_timeout', None)] = \
|
||||||
b'0\0default=yes type=int 30'
|
b'0\0default=yes type=int 30'
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm:test-vm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm=test-vm', '--service', 'test.service'], app=self.app)
|
['--dispvm=test-vm', '--service', 'test.service'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
@ -511,9 +499,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('disp123', 'admin.vm.feature.CheckWithTemplate', 'os', None)] = \
|
('disp123', 'admin.vm.feature.CheckWithTemplate', 'os', None)] = \
|
||||||
b'2\x00QubesFeatureNotFoundError\x00\x00Feature \'os\' not set\x00'
|
b'2\x00QubesFeatureNotFoundError\x00\x00Feature \'os\' not set\x00'
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm', '--', 'test.command'], app=self.app)
|
['--dispvm', '--', 'test.command'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
@ -542,9 +527,6 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('disp123', 'admin.vm.feature.CheckWithTemplate', 'os', None)] = \
|
('disp123', 'admin.vm.feature.CheckWithTemplate', 'os', None)] = \
|
||||||
b'2\x00QubesFeatureNotFoundError\x00\x00Feature \'os\' not set\x00'
|
b'2\x00QubesFeatureNotFoundError\x00\x00Feature \'os\' not set\x00'
|
||||||
self.app.expected_calls[
|
|
||||||
('$dispvm', 'admin.vm.CurrentState', None, None)] = \
|
|
||||||
b'0\x00power_state=Running'
|
|
||||||
ret = qubesadmin.tools.qvm_run.main(
|
ret = qubesadmin.tools.qvm_run.main(
|
||||||
['--dispvm', '--no-gui', 'test.command'], app=self.app)
|
['--dispvm', '--no-gui', 'test.command'], app=self.app)
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
|
@ -273,7 +273,7 @@ def main(args=None, app=None):
|
|||||||
file=sys.stderr, color=args.color_stderr)
|
file=sys.stderr, color=args.color_stderr)
|
||||||
retcode = max(retcode, 1)
|
retcode = max(retcode, 1)
|
||||||
continue
|
continue
|
||||||
if vm.is_paused():
|
if not args.dispvm and vm.is_paused():
|
||||||
if not args.autostart:
|
if not args.autostart:
|
||||||
if verbose > 0:
|
if verbose > 0:
|
||||||
print_no_color(
|
print_no_color(
|
||||||
|
Loading…
Reference in New Issue
Block a user