提交 92832577 编写于 作者: D Daniel Henrique Barboza 提交者: Michal Privoznik

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: 5b9819ee domain capabilities: Expose firmware auto selection feature
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 a60ee914
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册