summaryrefslogtreecommitdiff
path: root/tests/qemusecuritytest.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2019-11-15 11:56:46 +0100
committerMichal Privoznik <mprivozn@redhat.com>2019-11-15 11:56:46 +0100
commit9e4445ebc31aeea2b8e961d8756e4e015f5ac71d (patch)
tree52140322980a8877334ff2182b3dbaacb5ebfa9c /tests/qemusecuritytest.c
parent7bd41cb62cadbfc1a922ee7a061ec716a4c60a0d (diff)
downloadlibvirt-9e4445ebc31aeea2b8e961d8756e4e015f5ac71d.tar.gz
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>
Diffstat (limited to 'tests/qemusecuritytest.c')
-rw-r--r--tests/qemusecuritytest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c
index 685ac4dca2..8c0a48bb65 100644
--- a/tests/qemusecuritytest.c
+++ b/tests/qemusecuritytest.c
@@ -217,4 +217,5 @@ mymain(void)
return ret;
}
-VIR_TEST_MAIN(mymain)
+VIR_TEST_MAIN_PRELOAD(mymain,
+ VIR_TEST_MOCK("domaincaps"))