From nobody Sun Feb 8 10:33:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555344166; cv=none; d=zoho.com; s=zohoarc; b=mJhIyDANNdRS446/xCKRvSL7ZzI2xPzOxGnTS6d8oX++MlFQGJua8OrALDAg/LnhI+Jls7lX45HtRiBmDweVBsarspkW2v7mdns2pPKRXj8hNOy9f9cdEfiiXpX6XNT5U9WpJSASyj00mcceRIIE26j50sGT6oetoN2tChv5GmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555344166; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ovJBzktn0ObTUcvdqXhsoWzgqdfIuUL5ySArmW9O6Kk=; b=hKWb3R4ElJP4FTd1zB4TmzBPYY9qcuSqWBXxVXSddO45xftTMzj8PP3YpaO2rB52WYNjCoqMTHjnqFH8xiY78xlk/IFJGWTT5I9RsW2NJSSQjRaFKnmMJMzL4vljpD047fz6vcxPmFA+8qzNPjGmGHrCvDpkMCmUW3RLrTAiUTs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555344166642548.4447234688865; Mon, 15 Apr 2019 09:02:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05D0C30833A1; Mon, 15 Apr 2019 16:02:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D702F5C22B; Mon, 15 Apr 2019 16:02:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A1E83FA46; Mon, 15 Apr 2019 16:02:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FG2IEc002790 for ; Mon, 15 Apr 2019 12:02:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CBAE1001E89; Mon, 15 Apr 2019 16:02:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 156291001E75 for ; Mon, 15 Apr 2019 16:02:17 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 18:01:54 +0200 Message-Id: <865ca1c844bbf4e3cc6e136ff63db73feecd4903.1555344008.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/21] tests: qemumonitorjson: Rename schema validation test cases X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 15 Apr 2019 16:02:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Rename DO_TEST_QAPI_SCHEMA to DO_TEST_QAPI_VALIDATE. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitorjsontest.c | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 055e201611..e3d23a8800 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2840,7 +2840,7 @@ struct testQAPISchemaData { static int -testQAPISchema(const void *opaque) +testQAPISchemaValidate(const void *opaque) { const struct testQAPISchemaData *data =3D opaque; virBuffer debug =3D VIR_BUFFER_INITIALIZER; @@ -3056,42 +3056,42 @@ mymain(void) #undef DO_TEST_BLOCK_NODE_DETECT -#define DO_TEST_QAPI_SCHEMA(nme, rootquery, scc, jsonstr) \ +#define DO_TEST_QAPI_VALIDATE(nme, rootquery, scc, jsonstr) \ do { \ qapiData.name =3D nme; \ qapiData.query =3D rootquery; \ qapiData.success =3D scc; \ qapiData.json =3D jsonstr; \ - if (virTestRun("qapi schema " nme, testQAPISchema, &qapiData) < 0)\ + if (virTestRun("qapi schema validate" nme, testQAPISchemaValidate,= &qapiData) < 0)\ ret =3D -1; \ } while (0) - DO_TEST_QAPI_SCHEMA("string", "trace-event-get-state/arg-type", true, - "{\"name\":\"test\"}"); - DO_TEST_QAPI_SCHEMA("all attrs", "trace-event-get-state/arg-type", tru= e, - "{\"name\":\"test\", \"vcpu\":123}"); - DO_TEST_QAPI_SCHEMA("attr type mismatch", "trace-event-get-state/arg-t= ype", false, - "{\"name\":123}"); - DO_TEST_QAPI_SCHEMA("missing mandatory attr", "trace-event-get-state/a= rg-type", false, - "{\"vcpu\":123}"); - DO_TEST_QAPI_SCHEMA("attr name not present", "trace-event-get-state/ar= g-type", false, - "{\"name\":\"test\", \"blah\":123}"); - DO_TEST_QAPI_SCHEMA("variant", "blockdev-add/arg-type", true, - "{\"driver\":\"file\", \"filename\":\"ble\"}"); - DO_TEST_QAPI_SCHEMA("variant wrong", "blockdev-add/arg-type", false, - "{\"driver\":\"filefilefilefile\", \"filename\":\"= ble\"}"); - DO_TEST_QAPI_SCHEMA("variant missing mandatory", "blockdev-add/arg-typ= e", false, - "{\"driver\":\"file\", \"pr-manager\":\"ble\"}"); - DO_TEST_QAPI_SCHEMA("variant missing discriminator", "blockdev-add/arg= -type", false, - "{\"node-name\":\"dfgfdg\"}"); - DO_TEST_QAPI_SCHEMA("alternate 1", "blockdev-add/arg-type", true, - "{\"driver\":\"qcow2\"," - "\"file\": { \"driver\":\"file\", \"filename\":\"= ble\"}}"); - DO_TEST_QAPI_SCHEMA("alternate 2", "blockdev-add/arg-type", true, - "{\"driver\":\"qcow2\",\"file\": \"somepath\"}"); - DO_TEST_QAPI_SCHEMA("alternate 2", "blockdev-add/arg-type", false, - "{\"driver\":\"qcow2\",\"file\": 1234}"); + DO_TEST_QAPI_VALIDATE("string", "trace-event-get-state/arg-type", true, + "{\"name\":\"test\"}"); + DO_TEST_QAPI_VALIDATE("all attrs", "trace-event-get-state/arg-type", t= rue, + "{\"name\":\"test\", \"vcpu\":123}"); + DO_TEST_QAPI_VALIDATE("attr type mismatch", "trace-event-get-state/arg= -type", false, + "{\"name\":123}"); + DO_TEST_QAPI_VALIDATE("missing mandatory attr", "trace-event-get-state= /arg-type", false, + "{\"vcpu\":123}"); + DO_TEST_QAPI_VALIDATE("attr name not present", "trace-event-get-state/= arg-type", false, + "{\"name\":\"test\", \"blah\":123}"); + DO_TEST_QAPI_VALIDATE("variant", "blockdev-add/arg-type", true, + "{\"driver\":\"file\", \"filename\":\"ble\"}"); + DO_TEST_QAPI_VALIDATE("variant wrong", "blockdev-add/arg-type", false, + "{\"driver\":\"filefilefilefile\", \"filename\":= \"ble\"}"); + DO_TEST_QAPI_VALIDATE("variant missing mandatory", "blockdev-add/arg-t= ype", false, + "{\"driver\":\"file\", \"pr-manager\":\"ble\"}"); + DO_TEST_QAPI_VALIDATE("variant missing discriminator", "blockdev-add/a= rg-type", false, + "{\"node-name\":\"dfgfdg\"}"); + DO_TEST_QAPI_VALIDATE("alternate 1", "blockdev-add/arg-type", true, + "{\"driver\":\"qcow2\"," + "\"file\": { \"driver\":\"file\", \"filename\":\= "ble\"}}"); + DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", true, + "{\"driver\":\"qcow2\",\"file\": \"somepath\"}"); + DO_TEST_QAPI_VALIDATE("alternate 2", "blockdev-add/arg-type", false, + "{\"driver\":\"qcow2\",\"file\": 1234}"); if (!(metaschema =3D testQEMUSchemaGetLatest()) || !(metaschemastr =3D virJSONValueToString(metaschema, false))) { @@ -3100,11 +3100,11 @@ mymain(void) goto cleanup; } - DO_TEST_QAPI_SCHEMA("schema-meta", "query-qmp-schema/ret-type", true, + DO_TEST_QAPI_VALIDATE("schema-meta", "query-qmp-schema/ret-type", true, metaschemastr); -#undef DO_TEST_QAPI_SCHEMA +#undef DO_TEST_QAPI_VALIDATE cleanup: VIR_FREE(metaschemastr); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list