提交 c55f070b 编写于 作者: P Peter Xu 提交者: Markus Armbruster

tests: add oob functional test for test-qmp-cmds

Straightforward test just to let the test-qmp-cmds be complete.
Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: NPeter Xu <peterx@redhat.com>
Message-Id: <20181009062718.1914-6-peterx@redhat.com>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 192f26a7
......@@ -126,6 +126,21 @@ static void test_dispatch_cmd(void)
qobject_unref(req);
}
static void test_dispatch_cmd_oob(void)
{
QDict *req = qdict_new();
QDict *resp;
qdict_put_str(req, "exec-oob", "test-flags-command");
resp = qmp_dispatch(&qmp_commands, QOBJECT(req), true);
assert(resp != NULL);
assert(!qdict_haskey(resp, "error"));
qobject_unref(resp);
qobject_unref(req);
}
/* test commands that return an error due to invalid parameters */
static void test_dispatch_cmd_failure(void)
{
......@@ -302,6 +317,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_test_add_func("/qmp/dispatch_cmd", test_dispatch_cmd);
g_test_add_func("/qmp/dispatch_cmd_oob", test_dispatch_cmd_oob);
g_test_add_func("/qmp/dispatch_cmd_failure", test_dispatch_cmd_failure);
g_test_add_func("/qmp/dispatch_cmd_io", test_dispatch_cmd_io);
g_test_add_func("/qmp/dispatch_cmd_success_response",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册