Merge branch 'devel20190819'

* devel20190819:
  tests: make libvirt mockup more robust
  tests: update for not needing custom kernel modules anymore
This commit is contained in:
Marek Marczykowski-Górecki 2019-09-21 02:20:00 +02:00
commit 784fd966a2
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 9 additions and 7 deletions

View File

@ -47,11 +47,7 @@ class GrubBase(object):
if self.template.startswith('fedora-'):
cmd_install1 = 'dnf clean expire-cache && ' \
'dnf install -y qubes-kernel-vm-support grub2-tools'
cmd_install2 = 'dnf install -y kernel-core && ' \
'KVER=$(rpm -q --qf ' \
'\'%{VERSION}-%{RELEASE}.%{ARCH}\\n\' kernel-core|head -1) && ' \
'dnf install --allowerasing -y kernel-devel-$KVER && ' \
'dkms autoinstall -k $KVER'
cmd_install2 = 'dnf install -y kernel-core'
cmd_update_grub = 'grub2-mkconfig -o /boot/grub2/grub.cfg'
elif self.template.startswith('debian-'):
cmd_install1 = 'apt-get update && apt-get install -y ' \

View File

@ -32,8 +32,14 @@ class TestVMM(object):
@property
def libvirt_conn(self):
import libvirt
raise libvirt.libvirtError('phony error')
if self.offline_mode:
import libvirt
raise libvirt.libvirtError('phony error')
else:
libvirt_mock = unittest.mock.Mock()
vm_mock = libvirt_mock.lookupByUUID.return_value
vm_mock.isActive.return_value = False
return libvirt_mock
class TestHost(object):
# pylint: disable=too-few-public-methods