mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemumonitorjsontest: Test qemuMonitorJSONGetSpiceMigrationStatus
This commit is contained in:
parent
e0decbf05a
commit
3491d7b539
@ -1511,6 +1511,45 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
testQemuMonitorJSONqemuMonitorJSONGetSpiceMigrationStatus(const void *data)
|
||||
{
|
||||
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
|
||||
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
|
||||
int ret = -1;
|
||||
bool spiceMigrated;
|
||||
|
||||
if (!test)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorTestAddItem(test, "query-spice",
|
||||
"{"
|
||||
" \"return\": {"
|
||||
" \"migrated\": true,"
|
||||
" \"enabled\": false,"
|
||||
" \"mouse-mode\": \"client\""
|
||||
" },"
|
||||
" \"id\": \"libvirt-14\""
|
||||
"}") < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuMonitorJSONGetSpiceMigrationStatus(qemuMonitorTestGetMonitor(test),
|
||||
&spiceMigrated) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!spiceMigrated) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"Invalid spice migration status: %d, expecting 1",
|
||||
spiceMigrated);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
qemuMonitorTestFree(test);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
mymain(void)
|
||||
{
|
||||
@ -1565,6 +1604,7 @@ mymain(void)
|
||||
DO_TEST(qemuMonitorJSONGetBlockStatsInfo);
|
||||
DO_TEST(qemuMonitorJSONGetMigrationCacheSize);
|
||||
DO_TEST(qemuMonitorJSONGetMigrationStatus);
|
||||
DO_TEST(qemuMonitorJSONGetSpiceMigrationStatus);
|
||||
|
||||
virObjectUnref(xmlopt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user