From 6eee2de99f70b9caf5dfecacb7440af9657be317 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 9 Mar 2023 18:07:45 +0100 Subject: [PATCH] qemuhotplugtest: Make the test more useful by validating used commands against QMP schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qemuhotplugtest validates only that a given command is used but not the arguments of the command. With this patch we'll validate the arguments against the QMP schema thus we can catch possible issues with deprecated commands. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/qemuhotplugtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9c8407c5ef..63a6833cfd 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -57,6 +57,7 @@ struct qemuHotplugTestData { GHashTable *capsLatestFiles; GHashTable *capsCache; GHashTable *schemaCache; + GHashTable *schema; }; static int @@ -342,7 +343,7 @@ testQemuHotplug(const void *data) if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, test->arch, test->capsLatestFiles, test->capsCache, test->schemaCache, - NULL) < 0) + &test->schema) < 0) goto cleanup; } @@ -356,7 +357,7 @@ testQemuHotplug(const void *data) /* Now is the best time to feed the spoofed monitor with predefined * replies. */ - if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, NULL, NULL))) + if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, NULL, test->schema))) goto cleanup; tmp = test->mon;