Skip to content

Commit

Permalink
winusb: add test for run_service with stubdom arg
Browse files Browse the repository at this point in the history
  • Loading branch information
easydozen committed Jan 28, 2021
1 parent 6a8bfd4 commit 77ec0cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qubes/tests/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,18 @@ def test_700_run_service(self, mock_subprocess):
'user:QUBESRPC test.service test-inst-vm')
self.assertFalse(start_mock.called)

mock_subprocess.reset_mock()
start_mock.reset_mock()
with self.subTest('stubdom'):
vm.is_running = lambda: True
vm.is_qrexec_running = lambda: True
self.loop.run_until_complete(vm.run_service('test.service',
stubdom=True))
mock_subprocess.assert_called_once_with(
'/usr/bin/qrexec-client', '-d', 'test-inst-vm-dm',
'user:QUBESRPC test.service dom0')
self.assertFalse(start_mock.called)

@unittest.mock.patch('qubes.vm.qubesvm.QubesVM.run')
def test_710_run_for_stdio(self, mock_run):
vm = self.get_vm(cls=qubes.vm.standalonevm.StandaloneVM,
Expand Down

0 comments on commit 77ec0cf

Please sign in to comment.