Skip to content

Commit

Permalink
Fix test suite
Browse files Browse the repository at this point in the history
It failed to consider that the tests run outside of dom0.
  • Loading branch information
DemiMarie committed Nov 27, 2020
1 parent f4d93fd commit 76cd08a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions qubes/tests/vm/dispvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ def test_002_template_change(self):
dispvm = self.app.add_new_vm(qubes.vm.dispvm.DispVM,
name='test-dispvm', template=self.appvm)

with self.assertRaises(qubes.exc.QubesVMNotHaltedError):
dispvm.template = self.appvm
with self.assertRaises(qubes.exc.QubesVMNotHaltedError):
dispvm.template = self.appvm
dispvm.start()
if not self.app.vmm.offline_mode:
assert not dispvm.is_halted()
with self.assertRaises(qubes.exc.QubesVMNotHaltedError):
dispvm.template = self.appvm
with self.assertRaises(qubes.exc.QubesValueError):
dispvm.template = qubes.property.DEFAULT
dispvm.kill()
dispvm.template = qubes.property.DEFAULT
dispvm.template = self.appvm

def test_003_dvmtemplate_template_change(self):
self.appvm.template_for_dispvms = True
Expand All @@ -137,7 +141,7 @@ def test_003_dvmtemplate_template_change(self):
self.dispvm = self.app.add_new_vm(qubes.vm.dispvm.DispVM,
name='test-dispvm', template=self.appvm)

with self.assertRaises(qubes.exc.QubesVMInUseError):
with self.assertRaises(qubes.exc.QubesVMNotHaltedError):
self.appvm.template = self.template
with self.assertRaises(qubes.exc.QubesValueError):
self.appvm.template = qubes.property.DEFAULT
Expand Down
4 changes: 3 additions & 1 deletion run-tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
#!/bin/sh --

set -eu
sudo dnf -y install lvm2 python3-inotify python3-sphinx python3-docutils python3-PyYAML python3-jinja2 python3-lxml python3-pylint python3-coverage
CLEANUP_LVM=
if sudo --non-interactive $(dirname "$0")/ci/lvm-manage setup-lvm vg$$/pool; then
export DEFAULT_LVM_POOL=vg$$/pool
Expand Down

0 comments on commit 76cd08a

Please sign in to comment.