]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: Mock access to /dev/kvm
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Nov 2019 10:56:46 +0000 (11:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Nov 2019 10:56:46 +0000 (11:56 +0100)
commit9e4445ebc31aeea2b8e961d8756e4e015f5ac71d
tree52140322980a8877334ff2182b3dbaacb5ebfa9c
parent7bd41cb62cadbfc1a922ee7a061ec716a4c60a0d
tests: Mock access to /dev/kvm

Some of our tests try to validate domain XMLs they are working
with (not intentionally, simply because they call top level
domain XML parse function). Anyway, this implies that we build
domain capabilities also - see
virQEMUDriverGetDomainCapabilities(). And since some domain XMLs
are type of 'kvm' the control gets through
virQEMUCapsFillDomainCaps() and virHostCPUGetKVMMaxVCPUs() to
opening /dev/kvm which may be missing on the machine we're
running 'make check'.

Previously, we did not see this issue, because it was masked. If
building domain capabilities failed for whatever reason, we
ignored the failure. Only v5.9.0-207-gc69e6edea3 uncovered the
problem (it changed reval from 0 to -1 if
virQEMUDriverGetDomainCapabilities() fails). Since the referenced
commit is correct, we need to mock access to /dev/kvm in our
tests.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuhotplugtest.c
tests/qemumemlocktest.c
tests/qemusecuritytest.c
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c
tests/securityselinuxlabeltest.c