Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- tests/qemumonitorjsontest.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7ba8ad2..52df486 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1603,6 +1603,42 @@ cleanup: } static int +testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *data) +{ + virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; + qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt); + int ret = -1; + unsigned long long cacheSize; + + if (!test) + return -1; + + if (qemuMonitorTestAddItem(test, "query-migrate-cache-size", + "{" + " \"return\": 67108864," + " \"id\": \"libvirt-12\"" + "}") < 0) + goto cleanup; + + if (qemuMonitorJSONGetMigrationCacheSize(qemuMonitorTestGetMonitor(test), + &cacheSize) < 0) + goto cleanup; + + if (cacheSize != 67108864) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "Invalid cacheSize: %llu, expected 67108864", + cacheSize); + goto cleanup; + } + + ret = 0; + +cleanup: + qemuMonitorTestFree(test); + return ret; +} + +static int mymain(void) { int ret = 0; @@ -1690,6 +1726,7 @@ mymain(void) DO_TEST(qemuMonitorJSONGetBalloonInfo); DO_TEST(qemuMonitorJSONGetBlockInfo); DO_TEST(qemuMonitorJSONGetBlockStatsInfo); + DO_TEST(qemuMonitorJSONGetMigrationCacheSize); virObjectUnref(xmlopt); -- 1.8.1.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list