--- /dev/null
+ABS_SRCDIR/qemuxmlconfdata/broken-xml-invalid.xml:2: Couldn't find end of Start Tag dom line 1
+(null)
+^
--- /dev/null
+XML error: failed to parse xml document 'ABS_SRCDIR/qemuxmlconfdata/nonexistent-file.xml'
FLAG_REAL_CAPS |
FLAG_SLIRP_HELPER |
FLAG_ALLOW_DUPLICATE_OUTPUT |
+ FLAG_ALLOW_MISSING_INPUT |
0, -1);
return 0;
if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0)
goto cleanup;
- if (!virFileExists(info->infile)) {
+ if (!(info->flags & FLAG_ALLOW_MISSING_INPUT) &&
+ !virFileExists(info->infile)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Input file '%s' not found", info->infile);
goto cleanup;
g_unsetenv("PIPEWIRE_REMOTE");
g_unsetenv("PIPEWIRE_RUNTIME_DIR");
+ DO_TEST_CAPS_ARCH_LATEST_FULL("nonexistent-file", "x86_64",
+ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_ALLOW_MISSING_INPUT);
+ DO_TEST_CAPS_LATEST_PARSE_ERROR("broken-xml-invalid");
+
DO_TEST_CAPS_LATEST("x86_64-pc-minimal");
DO_TEST_CAPS_LATEST_ABI_UPDATE("x86_64-pc-minimal");
DO_TEST_CAPS_LATEST("x86_64-q35-minimal");
FLAG_REAL_CAPS = 1 << 2,
FLAG_SLIRP_HELPER = 1 << 3,
FLAG_ALLOW_DUPLICATE_OUTPUT = 1 << 4, /* allow multiple tests with the same output file */
+ FLAG_ALLOW_MISSING_INPUT = 1 << 5,
} testQemuInfoFlags;
struct testQemuConf {
const char **exceptions; /* optional NULL terminated list of filenames inside
directory where the expected validation result is
inverted */
+ const char **skip; /* optional NULL terminated list of files to skip altogether */
const char *dirRegex;
const char *file;
};
!g_regex_match(filter, ent->d_name, 0, NULL))
continue;
+ if (entry->skip &&
+ g_strv_contains(entry->skip, ent->d_name))
+ continue;
+
if (entry->exceptions)
exception = g_strv_contains(entry->exceptions, ent->d_name);
NULL
};
+/* skip tests with completely broken XML */
+static const char *skip_qemuxmlconfdata[] = {
+ "broken-xml-invalid.xml",
+ NULL
+};
+
static const struct testSchemaEntry schemaDomain[] = {
{ .dir = "tests/domainschemadata" },
{ .dir = "tests/qemuxmlconfdata",
.exceptions = exceptions_qemuxmlconfdata,
+ .skip = skip_qemuxmlconfdata,
},
{ .dir = "tests/xmconfigdata" },
{ .dir = "tests/lxcxml2xmldata" },