diff --git a/tests/genericxml2xmlindata/generic-graphics-listen-back-compat-mismatch.xml b/tests/genericxml2xmlindata/generic-graphics-listen-back-compat-mismatch.xml
new file mode 100644
index 0000000000000000000000000000000000000000..eee3fed1012d10cd99eb5832662af8ec2d2e2ee3
--- /dev/null
+++ b/tests/genericxml2xmlindata/generic-graphics-listen-back-compat-mismatch.xml
@@ -0,0 +1,30 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/genericxml2xmlindata/generic-graphics-listen-back-compat.xml b/tests/genericxml2xmlindata/generic-graphics-listen-back-compat.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c60fb6e145cf22991d11ade28037c02692747ad4
--- /dev/null
+++ b/tests/genericxml2xmlindata/generic-graphics-listen-back-compat.xml
@@ -0,0 +1,28 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/genericxml2xmloutdata/generic-graphics-listen-back-compat.xml b/tests/genericxml2xmloutdata/generic-graphics-listen-back-compat.xml
new file mode 100644
index 0000000000000000000000000000000000000000..aa00d34a64fccca5eec8c5b009829b76972ae2c1
--- /dev/null
+++ b/tests/genericxml2xmloutdata/generic-graphics-listen-back-compat.xml
@@ -0,0 +1,30 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
index 7d504db6f29d1043f917ba66e28d15d03017dd97..05563fbfb98d0ae0457c314380ab0d29020ec20d 100644
--- a/tests/genericxml2xmltest.c
+++ b/tests/genericxml2xmltest.c
@@ -21,6 +21,7 @@ struct testInfo {
const char *name;
int different;
bool inactive_only;
+ testCompareDomXML2XMLResult expectResult;
};
static int
@@ -40,7 +41,7 @@ testCompareXMLToXMLHelper(const void *data)
ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
info->different ? xml_out : xml_in,
!info->inactive_only, NULL, NULL, 0,
- TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
+ info->expectResult);
cleanup:
VIR_FREE(xml_in);
VIR_FREE(xml_out);
@@ -59,22 +60,27 @@ mymain(void)
if (!(xmlopt = virTestGenericDomainXMLConfInit()))
return EXIT_FAILURE;
-#define DO_TEST_FULL(name, is_different, inactive) \
+#define DO_TEST_FULL(name, is_different, inactive, expectResult) \
do { \
- const struct testInfo info = {name, is_different, inactive}; \
+ const struct testInfo info = {name, is_different, inactive, \
+ expectResult}; \
if (virtTestRun("GENERIC XML-2-XML " name, \
testCompareXMLToXMLHelper, &info) < 0) \
ret = -1; \
} while (0)
#define DO_TEST(name) \
- DO_TEST_FULL(name, 0, false)
+ DO_TEST_FULL(name, 0, false, TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS)
#define DO_TEST_DIFFERENT(name) \
- DO_TEST_FULL(name, 1, false)
+ DO_TEST_FULL(name, 1, false, TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS)
DO_TEST_DIFFERENT("disk-virtio");
+ DO_TEST_DIFFERENT("graphics-listen-back-compat");
+ DO_TEST_FULL("graphics-listen-back-compat-mismatch", 0, false,
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
+
virObjectUnref(caps);
virObjectUnref(xmlopt);