tools: fix handling qvm-run --no-autostart
Fixes QubesOS/qubes-issues#3083
This commit is contained in:
parent
f89d67c3e3
commit
8981e71b88
@ -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()
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user