aboutsummaryrefslogtreecommitdiff
path: root/tests/test-qmp-cmds.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-10-09 14:27:17 +0800
committerMarkus Armbruster <armbru@redhat.com>2018-12-12 10:28:27 +0100
commitc55f070b7195cee4e06998c10f57f13c7df98dbd (patch)
tree42a3f0dbd1499fcebafe2b39fc321d74a82af8e0 /tests/test-qmp-cmds.c
parent192f26a74c57ca2997f6ca8e3a2fd24e943c7918 (diff)
tests: add oob functional test for test-qmp-cmds
Straightforward test just to let the test-qmp-cmds be complete. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20181009062718.1914-6-peterx@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/test-qmp-cmds.c')
-rw-r--r--tests/test-qmp-cmds.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c
index 4ab2b6e5ce..481cb069ca 100644
--- a/tests/test-qmp-cmds.c
+++ b/tests/test-qmp-cmds.c
@@ -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",