提交 5703b481 编写于 作者: P Peter Krempa

testQemuMonitorJSONqemuMonitorJSONQueryCPUs: Split off test for query-cpus-fast

Separate the test for the newer command into a new function.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 199cd7a3
...@@ -1435,10 +1435,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) ...@@ -1435,10 +1435,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque)
{2, 17626, (char *) "/machine/unattached/device[2]", true}, {2, 17626, (char *) "/machine/unattached/device[2]", true},
{3, 17628, NULL, true}, {3, 17628, NULL, true},
}; };
struct qemuMonitorQueryCpusEntry expect_fast[] = {
{0, 17629, (char *) "/machine/unattached/device[0]", false},
{1, 17630, (char *) "/machine/unattached/device[1]", false},
};
g_autoptr(qemuMonitorTest) test = NULL; g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
...@@ -1483,6 +1479,29 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) ...@@ -1483,6 +1479,29 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque)
"}") < 0) "}") < 0)
return -1; return -1;
/* query-cpus */
if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slow,
false, 4))
return -1;
return 0;
}
static int
testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt;
struct qemuMonitorQueryCpusEntry expect_fast[] = {
{0, 17629, (char *) "/machine/unattached/device[0]", false},
{1, 17630, (char *) "/machine/unattached/device[1]", false},
};
g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
if (qemuMonitorTestAddItem(test, "query-cpus-fast", if (qemuMonitorTestAddItem(test, "query-cpus-fast",
"{" "{"
" \"return\": [" " \"return\": ["
...@@ -1501,11 +1520,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) ...@@ -1501,11 +1520,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque)
"}") < 0) "}") < 0)
return -1; return -1;
/* query-cpus */
if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slow,
false, 4))
return -1;
/* query-cpus-fast */ /* query-cpus-fast */
if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast, if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fast,
true, 2)) true, 2))
...@@ -3236,6 +3250,7 @@ mymain(void) ...@@ -3236,6 +3250,7 @@ mymain(void)
DO_TEST(qemuMonitorJSONGetTargetArch); DO_TEST(qemuMonitorJSONGetTargetArch);
DO_TEST(qemuMonitorJSONGetMigrationCapabilities); DO_TEST(qemuMonitorJSONGetMigrationCapabilities);
DO_TEST(qemuMonitorJSONQueryCPUs); DO_TEST(qemuMonitorJSONQueryCPUs);
DO_TEST(qemuMonitorJSONQueryCPUsFast);
DO_TEST(qemuMonitorJSONGetVirtType); DO_TEST(qemuMonitorJSONGetVirtType);
DO_TEST(qemuMonitorJSONSendKey); DO_TEST(qemuMonitorJSONSendKey);
DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability); DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册