
On 05/09/2013 06:18 AM, Ján Tomko wrote:
Print an error instead of crashing when a TPM device without a backend is specified.
Add a test for tpm device with no backend, which should fail with a parse error.
https://bugzilla.redhat.com/show_bug.cgi?id=961252 --- src/conf/domain_conf.c | 6 +++++ .../qemuxml2argv-tpm-no-backend-invalid.xml | 27 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-tpm-no-backend-invalid.xml
Awesome that we've enhanced the testsuite to check RNG parser rejection of invalid xml!
DO_TEST("tpm-passthrough", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS); + DO_TEST_PARSE_ERROR("tpm-no-backend-invalid", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
Should we be tweaking things for the other xml files (renaming files and/or tightening RNG) so that other uses of DO_TEST_PARSE_ERROR can also stress RNG validation? tests/qemuxml2argvtest.c: DO_TEST_PARSE_ERROR("boot-dev+order", tests/qemuxml2argvtest.c: DO_TEST_PARSE_ERROR("usb-ich9-no-companion", tests/qemuxml2argvtest.c: DO_TEST_PARSE_ERROR("usb-none-other", tests/qemuxml2argvtest.c: DO_TEST_PARSE_ERROR("usb-none-hub", tests/qemuxml2argvtest.c: DO_TEST_PARSE_ERROR("usb-none-usbtablet", -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org