From 77ec0cf01433402c3ba9c5d5c1fe8aa638162409 Mon Sep 17 00:00:00 2001 From: Dmitry Fedorov Date: Thu, 28 Jan 2021 14:45:15 +0300 Subject: [PATCH] winusb: add test for run_service with stubdom arg --- qubes/tests/vm/qubesvm.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index e0d2475b3..39333fd2b 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -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,