]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2xmloutdata: Workaround wrong detection of 'disk-cdrom-empty-network-invalid...
authorPeter Krempa <pkrempa@redhat.com>
Tue, 15 Aug 2023 12:43:20 +0000 (14:43 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 22 Aug 2023 12:04:40 +0000 (14:04 +0200)
The 'disk-cdrom-empty-network-invalid' is a special case were the input
XML is invalid according to the schema, but after processing a valid XML
is produced.

This corner case doesn't play well with 'virschematest' which uses the
file suffix to determine whether the file is invalid.

Upcoming patch will change the 'virschematest' condition, which would
start detecting this XML as invalid.

Use the '-active'/'-inactive' suffix for the file, which is possible
with qemuxml2xmltest so that an upcoming patch will not cause test
failure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid-active.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml with 100% similarity]
tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid-inactive.x86_64-latest.xml [new symlink]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid-inactive.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid-inactive.x86_64-latest.xml
new file mode 120000 (symlink)
index 0000000..9733ff0
--- /dev/null
@@ -0,0 +1 @@
+disk-cdrom-empty-network-invalid-active.x86_64-latest.xml
\ No newline at end of file
index 50e6860dfcfae68662256f1bd2a1ff6b1198c19e..e9ab6d8a451e602e451990f40c9ad946d47ed5bc 100644 (file)
@@ -287,6 +287,9 @@ mymain(void)
     DO_TEST_NOCAPS("disk-aio");
     DO_TEST_CAPS_LATEST("disk-aio-io_uring");
     DO_TEST_NOCAPS("disk-cdrom");
+    /* The 'disk-cdrom-empty-network-invalid' test case uses separate
+     * '-active'/'-inactive' output files to work around 'virschematest'
+     * thinking the output file is invalid XML */
     DO_TEST_CAPS_LATEST("disk-cdrom-empty-network-invalid");
     DO_TEST_CAPS_LATEST("disk-cdrom-network");
     DO_TEST("disk-cdrom-bus-other", QEMU_CAPS_DEVICE_USB_STORAGE);