From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpw0v-0002vF-9o for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:39:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpw0t-0003co-Ti for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:39:04 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52286 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fpw0t-0003cN-Io for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:39:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED8A18197001 for ; Wed, 15 Aug 2018 13:39:02 +0000 (UTC) From: Peter Xu Date: Wed, 15 Aug 2018 21:37:46 +0800 Message-Id: <20180815133747.25032-13-peterx@redhat.com> In-Reply-To: <20180815133747.25032-1-peterx@redhat.com> References: <20180815133747.25032-1-peterx@redhat.com> Subject: [Qemu-devel] [PATCH v6 12/13] tests: add oob functional test for test-qmp-cmds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Daniel P . Berrange" , Markus Armbruster , "Dr . David Alan Gilbert" , peterx@redhat.com Straightforward test just to let the test-qmp-cmds be complete. Signed-off-by: Peter Xu --- tests/test-qmp-cmds.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c index 989819b26d..a51432f09d 100644 --- a/tests/test-qmp-cmds.c +++ b/tests/test-qmp-cmds.c @@ -122,6 +122,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) { @@ -287,6 +302,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_test_add_func("/dispatch_cmd", test_dispatch_cmd); + g_test_add_func("/dispatch_cmd_oob", test_dispatch_cmd_oob); g_test_add_func("/dispatch_cmd_failure", test_dispatch_cmd_failure); g_test_add_func("/dispatch_cmd_io", test_dispatch_cmd_io); g_test_add_func("/dealloc_types", test_dealloc_types); -- 2.17.1