The '.replies' files are quite confusing since we don't record which command created the given reply. Also our tests did not validate whether the correct command was called. Address this by recording which command was called and reuse qemuMonitorTestNewFromFileFull which allows checking the command issued by libvirt prior to giving a reply. The change itself is quite simple, but there's some churn from the capability files. I've separated the churn into a separate patch for review and also included a tool which was used to gather the data. The patch with the tools needs to be applied after 'tests: qemucapsprobemock: Prepare 'qemucapsprobe' for the new format' to achieve the result. Peter Krempa (10): qemu: monitor: Add possibility to reset command sequence in tests tests: qemucapabilities: Reset command sequence before second probe tests: qemumonitor: Simplify handling of end of file in full file test tests: qemumonitor: Optimize control flow when concatenating replies tests: qemucapsprobemock: Simplify and extract skipping of empty lines tests: qemucapsprobemock: Fail if JSON reply from qemu can't be reformatted tests: qemucapsprobemock: Prepare 'qemucapsprobe' for the new format tests: qemucapabilities: Test commands used to query capabilities FIXUP: Tweak capability files to conform to the new approach DO_NOT_APPLY: HACK: Regenerate qemucapabilitiestest data fix-files.sh | 1 + src/qemu/qemu_monitor.c | 11 + src/qemu/qemu_monitor_priv.h | 31 + tests/Makefile.am | 1 + .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 317 ++++- tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 317 ++++- tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 317 ++++- tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 317 ++++- tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 2 +- .../caps_2.10.0.aarch64.replies | 319 ++++- tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.10.0.ppc64.replies | 322 ++++- tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 342 ++++- tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 2 +- .../caps_2.10.0.x86_64.replies | 1294 +++++++++++++++++-- tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 350 ++++- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 2 +- .../caps_2.12.0.aarch64.replies | 328 ++++- tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 331 ++++- tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 358 +++++- tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 2 +- .../caps_2.12.0.x86_64.replies | 1351 ++++++++++++++++++-- tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 341 ++++- tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 346 ++++- tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 2 +- .../caps_2.6.0.aarch64.replies | 319 ++++- tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.6.0.ppc64.replies | 322 ++++- tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 346 ++++- tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.7.0.s390x.replies | 306 ++++- tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 346 ++++- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.s390x.replies | 342 ++++- tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 346 ++++- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.ppc64.replies | 322 ++++- tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.s390x.replies | 342 ++++- tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 1292 +++++++++++++++++-- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 +- tests/qemucapabilitiestest.c | 20 +- tests/qemucapsprobemock.c | 77 +- tests/qemumonitortestutils.c | 48 +- 57 files changed, 10827 insertions(+), 645 deletions(-) create mode 100755 fix-files.sh create mode 100644 src/qemu/qemu_monitor_priv.h -- 2.16.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list