mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemuxml2xmltest: Redirect access to FW descriptor dirs
If /etc/qemu/firmware directory exists, but is not readable then qemuxml2xmltest fails. This is because once domain XML is parsed it is validated. For that domain capabilities are needed. However, when constructing domain capabilities, FW descriptors are loaded and this is the point where the test fails, because it fails to open one of the directories. Fixes: 5b9819eedc domain capabilities: Expose firmware auto selection feature Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a60ee91400
commit
92832577d1
@ -573,7 +573,8 @@ qemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS)
|
||||
|
||||
qemuxml2xmltest_SOURCES = \
|
||||
qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
|
||||
testutils.c testutils.h
|
||||
testutils.c testutils.h \
|
||||
virfilewrapper.c virfilewrapper.h
|
||||
qemuxml2xmltest_LDADD = $(qemu_LDADDS)
|
||||
|
||||
qemumonitorjsontest_SOURCES = \
|
||||
|
@ -14,6 +14,8 @@
|
||||
# include "qemu/qemu_domain.h"
|
||||
# include "testutilsqemu.h"
|
||||
# include "virstring.h"
|
||||
# include "virfilewrapper.h"
|
||||
# include "configmake.h"
|
||||
|
||||
# define VIR_FROM_THIS VIR_FROM_NONE
|
||||
|
||||
@ -167,6 +169,15 @@ mymain(void)
|
||||
|
||||
setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1);
|
||||
|
||||
/* Required for tpm-emulator tests
|
||||
*/
|
||||
virFileWrapperAddPrefix(SYSCONFDIR "/qemu/firmware",
|
||||
abs_srcdir "/qemufirmwaredata/etc/qemu/firmware");
|
||||
virFileWrapperAddPrefix(PREFIX "/share/qemu/firmware",
|
||||
abs_srcdir "/qemufirmwaredata/usr/share/qemu/firmware");
|
||||
virFileWrapperAddPrefix("/home/user/.config/qemu/firmware",
|
||||
abs_srcdir "/qemufirmwaredata/home/user/.config/qemu/firmware");
|
||||
|
||||
if (qemuTestDriverInit(&driver) < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
@ -1325,6 +1336,7 @@ mymain(void)
|
||||
virHashFree(capslatest);
|
||||
qemuTestDriverFree(&driver);
|
||||
VIR_FREE(fakerootdir);
|
||||
virFileWrapperClearPrefixes();
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user