From nobody Wed Nov 5 16:15:56 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 15357056270941023.6372950164734; Fri, 31 Aug 2018 01:53:47 -0700 (PDT) Received: from localhost ([::1]:52530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvfBX-0001gS-70 for importer@patchew.org; Fri, 31 Aug 2018 04:53:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvf3h-00017Y-Eb for qemu-devel@nongnu.org; Fri, 31 Aug 2018 04:45:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvexd-0007Tm-M4 for qemu-devel@nongnu.org; Fri, 31 Aug 2018 04:39:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37082 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 1fvexd-0007S8-Gm for qemu-devel@nongnu.org; Fri, 31 Aug 2018 04:39:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30D2D40201BD; Fri, 31 Aug 2018 08:39:21 +0000 (UTC) Received: from thuth.com (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8260610D18E0; Fri, 31 Aug 2018 08:39:19 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 31 Aug 2018 10:38:56 +0200 Message-Id: <1535704738-8986-8-git-send-email-thuth@redhat.com> In-Reply-To: <1535704738-8986-1-git-send-email-thuth@redhat.com> References: <1535704738-8986-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 31 Aug 2018 08:39:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 31 Aug 2018 08:39:21 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 7/9] tests: add qmp/object-add-without-props 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: Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau test_object_add_without_props() tests a bug in qmp_object_add() we fixed in commit e64c75a975. Sadly, we don't have systematic object-add tests. This lone test can go into qmp-cmd-test for want of a better home. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qmp-cmd-test.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/qmp-cmd-test.c b/tests/qmp-cmd-test.c index c5b70df..d12cac5 100644 --- a/tests/qmp-cmd-test.c +++ b/tests/qmp-cmd-test.c @@ -197,6 +197,19 @@ static void add_query_tests(QmpSchema *schema) } } =20 +static void test_object_add_without_props(void) +{ + QTestState *qts; + QDict *resp; + + qts =3D qtest_init(common_args); + resp =3D qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" + " {'qom-type': 'memory-backend-ram', 'id': 'ram1' } }"= ); + g_assert_nonnull(resp); + qmp_assert_error_class(resp, "GenericError"); + qtest_quit(qts); +} + int main(int argc, char *argv[]) { QmpSchema schema; @@ -206,6 +219,11 @@ int main(int argc, char *argv[]) =20 qmp_schema_init(&schema); add_query_tests(&schema); + + qtest_add_func("qmp/object-add-without-props", + test_object_add_without_props); + /* TODO: add coverage of generic object-add failure modes */ + ret =3D g_test_run(); =20 qmp_schema_cleanup(&schema); --=20 1.8.3.1