mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
tests: Allow QMP schema testing in qemuMonitorTestNewFromFileFull
Pass in the schema data from the caller if QMP schema testing is desired. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
56c2f2b45b
commit
1a77e0032b
@ -82,7 +82,8 @@ testQemuCaps(const void *opaque)
|
|||||||
data->dataDir, data->base, data->archName) < 0)
|
data->dataDir, data->base, data->archName) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(mon = qemuMonitorTestNewFromFileFull(repliesFile, &data->driver, NULL)))
|
if (!(mon = qemuMonitorTestNewFromFileFull(repliesFile, &data->driver, NULL,
|
||||||
|
NULL)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuProcessQMPInitMonitor(qemuMonitorTestGetMonitor(mon)) < 0)
|
if (qemuProcessQMPInitMonitor(qemuMonitorTestGetMonitor(mon)) < 0)
|
||||||
|
@ -435,7 +435,7 @@ testQemuHotplugCpuPrepare(const char *test,
|
|||||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
|
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
|
||||||
|
|
||||||
if (!(data->mon = qemuMonitorTestNewFromFileFull(data->file_json_monitor,
|
if (!(data->mon = qemuMonitorTestNewFromFileFull(data->file_json_monitor,
|
||||||
&driver, data->vm)))
|
&driver, data->vm, NULL)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
priv->mon = qemuMonitorTestGetMonitor(data->mon);
|
priv->mon = qemuMonitorTestGetMonitor(data->mon);
|
||||||
|
@ -1396,6 +1396,7 @@ qemuMonitorTestFullAddItem(qemuMonitorTestPtr test,
|
|||||||
* @fileName: File name to load monitor replies from
|
* @fileName: File name to load monitor replies from
|
||||||
* @driver: qemu driver object
|
* @driver: qemu driver object
|
||||||
* @vm: domain object (may be null if it's not needed by the test)
|
* @vm: domain object (may be null if it's not needed by the test)
|
||||||
|
* @qmpschema: QMP schema data hash table if QMP checking is required
|
||||||
*
|
*
|
||||||
* Create a JSON test monitor simulator object and fill it with expected command
|
* Create a JSON test monitor simulator object and fill it with expected command
|
||||||
* sequence and replies specified in @fileName.
|
* sequence and replies specified in @fileName.
|
||||||
@ -1409,7 +1410,8 @@ qemuMonitorTestFullAddItem(qemuMonitorTestPtr test,
|
|||||||
qemuMonitorTestPtr
|
qemuMonitorTestPtr
|
||||||
qemuMonitorTestNewFromFileFull(const char *fileName,
|
qemuMonitorTestNewFromFileFull(const char *fileName,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm)
|
virDomainObjPtr vm,
|
||||||
|
virHashTablePtr qmpschema)
|
||||||
{
|
{
|
||||||
qemuMonitorTestPtr ret = NULL;
|
qemuMonitorTestPtr ret = NULL;
|
||||||
char *jsonstr = NULL;
|
char *jsonstr = NULL;
|
||||||
@ -1423,7 +1425,8 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
|
|||||||
if (virTestLoadFile(fileName, &jsonstr) < 0)
|
if (virTestLoadFile(fileName, &jsonstr) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(ret = qemuMonitorTestNew(true, driver->xmlopt, vm, driver, NULL, NULL)))
|
if (!(ret = qemuMonitorTestNew(true, driver->xmlopt, vm, driver, NULL,
|
||||||
|
qmpschema)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
tmp = jsonstr;
|
tmp = jsonstr;
|
||||||
|
@ -90,7 +90,8 @@ qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
|
|||||||
bool simple);
|
bool simple);
|
||||||
qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName,
|
qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm);
|
virDomainObjPtr vm,
|
||||||
|
virHashTablePtr qmpschema);
|
||||||
|
|
||||||
qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt);
|
qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user