From nobody Wed Oct 29 17:30:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524841893359951.6514104257222; Fri, 27 Apr 2018 08:11:33 -0700 (PDT) Received: from localhost ([::1]:48646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC51z-000620-3k for importer@patchew.org; Fri, 27 Apr 2018 11:11:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC4xF-0002Lr-8z for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fC4xC-0003QT-LK for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43050 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 1fC4xC-0003QJ-Fx for qemu-devel@nongnu.org; Fri, 27 Apr 2018 11:06:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23E50406C74B for ; Fri, 27 Apr 2018 15:06:30 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4307B202323B; Fri, 27 Apr 2018 15:06:29 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 27 Apr 2018 17:05:19 +0200 Message-Id: <1524841523-95513-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1524841523-95513-1-git-send-email-imammedo@redhat.com> References: <1524841523-95513-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 15:06:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 15:06:30 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'imammedo@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v6 07/11] tests: add allowed-in-preconfig-test for qapi-schema 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: pkrempa@redhat.com, ehabkost@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" make sure the QAPISchema can parse allowed-in-preconfig correctly Signed-off-by: Igor Mammedov --- tests/Makefile.include | 1 + tests/qapi-schema/allowed-in-preconfig-test.err | 1 + tests/qapi-schema/allowed-in-preconfig-test.exit | 1 + tests/qapi-schema/allowed-in-preconfig-test.json | 2 ++ tests/qapi-schema/allowed-in-preconfig-test.out | 0 tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 2 ++ tests/test-qmp-cmds.c | 4 ++++ 8 files changed, 14 insertions(+) create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.err create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.exit create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.json create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.out diff --git a/tests/Makefile.include b/tests/Makefile.include index 3b9a5e3..4d2460d 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -524,6 +524,7 @@ qapi-schema +=3D missing-type.json qapi-schema +=3D nested-struct-data.json qapi-schema +=3D non-objects.json qapi-schema +=3D oob-test.json +qapi-schema +=3D allowed-in-preconfig-test.json qapi-schema +=3D pragma-doc-required-crap.json qapi-schema +=3D pragma-extra-junk.json qapi-schema +=3D pragma-name-case-whitelist-crap.json diff --git a/tests/qapi-schema/allowed-in-preconfig-test.err b/tests/qapi-s= chema/allowed-in-preconfig-test.err new file mode 100644 index 0000000..2b0511b --- /dev/null +++ b/tests/qapi-schema/allowed-in-preconfig-test.err @@ -0,0 +1 @@ +tests/qapi-schema/allowed-in-preconfig-test.json:2: 'allowed-in-preconfig'= of command 'allowed-in-preconfig-test' should only use true value diff --git a/tests/qapi-schema/allowed-in-preconfig-test.exit b/tests/qapi-= schema/allowed-in-preconfig-test.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/allowed-in-preconfig-test.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/allowed-in-preconfig-test.json b/tests/qapi-= schema/allowed-in-preconfig-test.json new file mode 100644 index 0000000..7e0e6cb --- /dev/null +++ b/tests/qapi-schema/allowed-in-preconfig-test.json @@ -0,0 +1,2 @@ +# Check against allowed-in-preconfig illegal value +{ 'command': 'allowed-in-preconfig-test', 'allowed-in-preconfig': 'some-st= ring' } diff --git a/tests/qapi-schema/allowed-in-preconfig-test.out b/tests/qapi-s= chema/allowed-in-preconfig-test.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qa= pi-schema-test.json index 06e30f4..608ca35 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -142,6 +142,9 @@ # Smoke test on Out-Of-Band { 'command': 'an-oob-command', 'allow-oob': true } =20 +# test allowed-in-preconfig flag +{ 'command': 'allowed-in-preconfig-test', 'allowed-in-preconfig': true } + # For testing integer range flattening in opts-visitor. The following sche= ma # corresponds to the option format: # diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qap= i-schema-test.out index 1f5038f..c955e2d 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -168,6 +168,8 @@ command boxed-union UserDefNativeListUnion -> None gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse command an-oob-command None -> None gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DTrue preconfig= =3DFalse +command allowed-in-preconfig-test None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DTrue object UserDefOptions member i64: intList optional=3DTrue member u64: uint64List optional=3DTrue diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c index db690cc..730476a 100644 --- a/tests/test-qmp-cmds.c +++ b/tests/test-qmp-cmds.c @@ -20,6 +20,10 @@ void qmp_an_oob_command(Error **errp) { } =20 +void qmp_allowed_in_preconfig_test(Error **errp) +{ +} + Empty2 *qmp_user_def_cmd0(Error **errp) { return g_new0(Empty2, 1); --=20 2.7.4