Merge branch 'devel20190819'
* devel20190819: tests: make libvirt mockup more robust tests: update for not needing custom kernel modules anymore
This commit is contained in:
commit
784fd966a2
@ -47,11 +47,7 @@ class GrubBase(object):
|
|||||||
if self.template.startswith('fedora-'):
|
if self.template.startswith('fedora-'):
|
||||||
cmd_install1 = 'dnf clean expire-cache && ' \
|
cmd_install1 = 'dnf clean expire-cache && ' \
|
||||||
'dnf install -y qubes-kernel-vm-support grub2-tools'
|
'dnf install -y qubes-kernel-vm-support grub2-tools'
|
||||||
cmd_install2 = 'dnf install -y kernel-core && ' \
|
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_update_grub = 'grub2-mkconfig -o /boot/grub2/grub.cfg'
|
cmd_update_grub = 'grub2-mkconfig -o /boot/grub2/grub.cfg'
|
||||||
elif self.template.startswith('debian-'):
|
elif self.template.startswith('debian-'):
|
||||||
cmd_install1 = 'apt-get update && apt-get install -y ' \
|
cmd_install1 = 'apt-get update && apt-get install -y ' \
|
||||||
|
@ -32,8 +32,14 @@ class TestVMM(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def libvirt_conn(self):
|
def libvirt_conn(self):
|
||||||
|
if self.offline_mode:
|
||||||
import libvirt
|
import libvirt
|
||||||
raise libvirt.libvirtError('phony error')
|
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):
|
class TestHost(object):
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
|
Loading…
Reference in New Issue
Block a user