mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 22:17:17 +00:00
virschematest: Improve detection of 'invalid' XMLs
The output files from 'qemuxml2argvtest' may have the real capability suffix e.g. 'pci-rom-disabled-invalid.x86_64-latest.xml' which would not be detected as being invalid and thus causing a test failure. Change the logic to find '-invalid.' so that we can properly use 'virschematest' with test cases using real capabilities. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
72a6c2ad9f
commit
c2dfc3b863
@ -48,7 +48,9 @@ static int
|
|||||||
testSchemaValidateXML(const void *args)
|
testSchemaValidateXML(const void *args)
|
||||||
{
|
{
|
||||||
const struct testSchemaData *data = args;
|
const struct testSchemaData *data = args;
|
||||||
bool shouldFail = virStringHasSuffix(data->xml_path, "-invalid.xml");
|
/* invalid XMLs have a '-invalid.' suffix, but not necessarily at the end
|
||||||
|
* of the file name e.g. in case of qemuxml2xmltest with real capabilities */
|
||||||
|
bool shouldFail = !!strstr(data->xml_path, "-invalid.");
|
||||||
g_autoptr(xmlDoc) xml = NULL;
|
g_autoptr(xmlDoc) xml = NULL;
|
||||||
|
|
||||||
if (!(xml = virXMLParseFileCtxt(data->xml_path, NULL)))
|
if (!(xml = virXMLParseFileCtxt(data->xml_path, NULL)))
|
||||||
|
Loading…
Reference in New Issue
Block a user