Skip to content

Commit

Permalink
tests: fix pretending VM is running
Browse files Browse the repository at this point in the history
After fixing cyclic import, qmemman is now imported in tests too and
expects "xid" property to be set on a running VM.
  • Loading branch information
marmarek committed Dec 27, 2022
1 parent 54a71ce commit 516b3e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qubes/tests/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,7 @@ def test_621_qdb_vm_with_network(self, mock_qubesdb, mock_urandom,
# pretend the VM is running...
vm._qubesprop_xid = 3
netvm.kernel = None
netvm._qubesprop_xid = 4
test_qubesdb = TestQubesDB()
mock_qubesdb.write.side_effect = test_qubesdb.write
mock_qubesdb.rm.side_effect = test_qubesdb.rm
Expand Down Expand Up @@ -1855,6 +1856,7 @@ def test_622_qdb_guivm_keyboard_layout(self, mock_qubesdb, mock_urandom,
vm.netvm = None
vm.guivm = guivm
vm.is_running = lambda: True
vm._qubesprop_xid = 2
guivm.keyboard_layout = 'fr++'
guivm.is_running = lambda: True
guivm._libvirt_domain = unittest.mock.Mock(**{'ID.return_value': 2})
Expand Down Expand Up @@ -1905,6 +1907,7 @@ def test_623_qdb_audiovm(self, mock_qubesdb, mock_urandom,
vm.netvm = None
vm.audiovm = audiovm
vm.is_running = lambda: True
vm._qubesprop_xid = 2
audiovm.is_running = lambda: True
audiovm._libvirt_domain = unittest.mock.Mock(**{'ID.return_value': 2})
vm.events_enabled = True
Expand Down Expand Up @@ -1978,6 +1981,7 @@ def test_625_qdb_keyboard_layout_change(self, mock_qubesdb, mock_urandom,
vm.netvm = None
vm.guivm = guivm
vm.is_running = lambda: True
vm._qubesprop_xid = 2
guivm.keyboard_layout = 'fr++'
guivm.is_running = lambda: True
guivm._libvirt_domain = unittest.mock.Mock(**{'ID.return_value': 2})
Expand Down

0 comments on commit 516b3e6

Please sign in to comment.