Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemumonitorjsontest.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 576288b..b6adb35 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1688,6 +1688,45 @@ cleanup:
}
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)
{
int ret = 0;
@@ -1777,6 +1816,7 @@ mymain(void)
DO_TEST(qemuMonitorJSONGetBlockStatsInfo);
DO_TEST(qemuMonitorJSONGetMigrationCacheSize);
DO_TEST(qemuMonitorJSONGetMigrationStatus);
+ DO_TEST(qemuMonitorJSONGetSpiceMigrationStatus);
virObjectUnref(xmlopt);
--
1.8.1.5