From 76cd08af0024ae46f8ba300ebb2c4b5af2695329 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Thu, 26 Nov 2020 20:48:43 -0500 Subject: [PATCH] Fix test suite It failed to consider that the tests run outside of dom0. --- qubes/tests/vm/dispvm.py | 14 +++++++++----- run-tests | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qubes/tests/vm/dispvm.py b/qubes/tests/vm/dispvm.py index 9ffa92c70..1765fe3ac 100644 --- a/qubes/tests/vm/dispvm.py +++ b/qubes/tests/vm/dispvm.py @@ -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 @@ -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 diff --git a/run-tests b/run-tests index e7861dc76..15fefc3dd 100755 --- a/run-tests +++ b/run-tests @@ -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