From patchwork Tue Aug 22 13:22:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 804467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xcBsX1mv6z9sRq for ; Tue, 22 Aug 2017 23:55:44 +1000 (AEST) Received: from localhost ([::1]:47187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk9eg-0001Qo-1U for incoming@patchwork.ozlabs.org; Tue, 22 Aug 2017 09:55:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk9JU-000887-6k for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk9JQ-00074H-1I for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38644) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dk9JP-00073O-Rb for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BACB9883DA for ; Tue, 22 Aug 2017 13:27:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BACB9883DA Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com Received: from localhost (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0964A60466; Tue, 22 Aug 2017 13:27:18 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 22 Aug 2017 15:22:49 +0200 Message-Id: <20170822132255.23945-49-marcandre.lureau@redhat.com> In-Reply-To: <20170822132255.23945-1-marcandre.lureau@redhat.com> References: <20170822132255.23945-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 22 Aug 2017 13:27:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 48/54] tests/qmp-test: add query-qmp-schema test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The following patch is going to make qmp introspection per-target, and test-qobject-input-visitor.c can no longer link with qmp_schema_qlit. Use a run-time QMP test instead to validate the query-qmp-schema schema. Signed-off-by: Marc-André Lureau --- tests/qmp-test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/qmp-test.c b/tests/qmp-test.c index 5d0260b2be..1fd37092b5 100644 --- a/tests/qmp-test.c +++ b/tests/qmp-test.c @@ -129,11 +129,32 @@ static void test_qmp_protocol(void) qtest_end(); } +static void test_qmp_query_schema(void) +{ + SchemaInfoList *schema; + QDict *resp; + Visitor *v; + + qtest_start(common_args); + + resp = qmp("{'execute': 'query-qmp-schema'}"); + v = qobject_input_visitor_new(qdict_get(resp, "return")); + visit_type_SchemaInfoList(v, NULL, &schema, &error_abort); + g_assert(schema); + + qapi_free_SchemaInfoList(schema); + visit_free(v); + QDECREF(resp); + + qtest_end(); +} + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); qtest_add_func("qmp/protocol", test_qmp_protocol); + qtest_add_func("qmp/query-schema", test_qmp_query_schema); return g_test_run(); }