tools: fix handling qvm-run --no-autostart

Fixes QubesOS/qubes-issues#3083
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-19 14:55:33 +02:00
parent f89d67c3e3
commit 8981e71b88
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 17 additions and 1 deletions

View File

@ -404,3 +404,19 @@ class TC_00_qvm_run(qubesadmin.tests.QubesTestCase):
('test-vm', 'qubes.VMShell', b'command; exit\n'),
])
self.assertAllCalled()
def test_013_no_autostart(self):
self.app.expected_calls[
('dom0', 'admin.vm.List', None, None)] = \
b'0\x00test-vm class=AppVM state=Running\n' \
b'test-vm2 class=AppVM state=Running\n' \
b'test-vm3 class=AppVM state=Halted\n'
self.app.expected_calls[
('test-vm3', 'admin.vm.List', None, None)] = \
b'0\x00test-vm3 class=AppVM state=Halted\n'
ret = qubesadmin.tools.qvm_run.main(
['--no-gui', '--no-autostart', 'test-vm3', 'command'],
app=self.app)
self.assertEqual(ret, 0)
self.assertEqual(self.app.service_calls, [])
self.assertAllCalled()

View File

@ -41,7 +41,7 @@ parser.add_argument('--autostart', '--auto', '-a',
help='option ignored, this is default')
parser.add_argument('--no-autostart', '--no-auto', '-n',
action='store_false',
action='store_false', dest='autostart',
help='do not autostart qube')
parser.add_argument('--pass-io', '-p',