On Mon, Jun 10, 2019 at 10:30:44 -0500, Eric Blake wrote:
The DO_TEST() macro in qemumonitorjsontest.c was not passing the
schema through, which meant that we were not validating any of those
tests for correct usage according to the schema.
Tested by using this hack, where the test mistakenly passed pre-patch,
but correctly diagnosed the garbage post-patch:
| diff --git i/src/qemu/qemu_monitor_json.c w/src/qemu/qemu_monitor_json.c
| index 53a7de8b77..86d8450814 100644
| --- i/src/qemu/qemu_monitor_json.c
| +++ w/src/qemu/qemu_monitor_json.c
| @@ -1532,7 +1532,8 @@ qemuMonitorJSONGetStatus(qemuMonitorPtr mon,
| if (reason)
| *reason = VIR_DOMAIN_PAUSED_UNKNOWN;
|
| - if (!(cmd = qemuMonitorJSONMakeCommand("query-status", NULL)))
| + if (!(cmd = qemuMonitorJSONMakeCommand("query-status",
| + "s:garbage", "foo",
NULL)))
I use the same trick when testing these :)
| return -1;
|
| if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
Suggested-by: Peter Krempa <pkrempa(a)redhat.com>
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
tests/qemumonitorjsontest.c | 251 +++++++++++++++++++++---------------
1 file changed, 149 insertions(+), 102 deletions(-)
ACK, it's good to see that actually everything was compliant :).