From nobody Sun Feb 8 21:48:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1606762695; cv=none; d=zohomail.com; s=zohoarc; b=ImtX5M1NDieOkxN5I7bk0jlf0+Od2TU7FfylHgpgMmyp5grAu7bQdl/3ElwK8LvE9RsHo2OmPAg+HyEOPe4i3mjY138v3oeB7m7C8tRPNn9DY8sihfV0k/e3nw/3HLMzE2eYFpLSGeCDqsYeHvIjKxvvk6pKfFdTNOXLdr6A6qM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606762695; 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; bh=6G5AaSzT/klUD/FJQLHz0QaT9/HazWJW2PPx4ZW+Gog=; b=HoDupnzDKx9j8UfBgDEFUW6TTY8eBIFaUZqa9gKKtYik4AtXyphUAfyCnyy1bz6d4CDk+0jyTOwej7WmqmmqgLYHa5fW7Zq/d9KFhl1fSXLDFwIBSo1cASgqQCe02Z+131tnHsH1bJDMEBGqYF/ESq+A42+CXdW4EZ5Avyyvnkk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606762695463345.38926468433556; Mon, 30 Nov 2020 10:58:15 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-11-eufbrtFlOMSRnjmwFtQ9Ng-1; Mon, 30 Nov 2020 13:56:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EBF38030C0; Mon, 30 Nov 2020 18:56:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C5B460873; Mon, 30 Nov 2020 18:56:22 +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 0A0E31809CBB; Mon, 30 Nov 2020 18:56:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AUIu8ST014384 for ; Mon, 30 Nov 2020 13:56:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 83DDD60C6A; Mon, 30 Nov 2020 18:56:08 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id C796860C67 for ; Mon, 30 Nov 2020 18:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606762694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6G5AaSzT/klUD/FJQLHz0QaT9/HazWJW2PPx4ZW+Gog=; b=FYiCfV0ckNGHug26/aomxiwEM9EO4PrjfvN/MUZfViCmu5WBpPmSUEDYYnPBIpQEbiqlyC 89bv7gfjG/sCu2MjOwd/0MCONswLAL4A4hQjhi2b6tjaLPmv91kAaHPieddozcSn2oEEvR JDaRKcD65+4fklNO7O0Kf5APnoi6uhE= X-MC-Unique: eufbrtFlOMSRnjmwFtQ9Ng-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/24] tests: qemuxml2argv: Validate generation of JSON props for object-add Date: Mon, 30 Nov 2020 19:55:30 +0100 Message-Id: <67b4fdc521d32272c5264f329e93ff4cd043db1c.1606762033.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Similarly to the validation for blockdev-add and netdev_add, use the qemuxml2argv test repository to drive validation of props for object-add. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 225cb70edf..fafc214e57 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -526,6 +526,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, g_autoptr(virCommand) cmd =3D NULL; unsigned int parseFlags =3D info->parseFlags; bool netdevQAPIfied =3D false; + bool objectQAPIfied =3D false; if (info->schemafile) schema =3D testQEMUSchemaLoad(info->schemafile); @@ -560,6 +561,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, return -1; netdevQAPIfied =3D !virQEMUQAPISchemaPathExists("netdev_add/arg-type/t= ype/!string", schema); + objectQAPIfied =3D virQEMUQAPISchemaPathExists("object-add/arg-type/qo= m-type/^secret", schema); for (i =3D 0; i < nargs; i++) { g_auto(virBuffer) debug =3D VIR_BUFFER_INITIALIZER; @@ -593,6 +595,24 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr dr= v, return -1; } + i++; + } else if (STREQ(args[i], "-object")) { + + if (!objectQAPIfied) { + i++; + continue; + } + + if (!(jsonargs =3D virJSONValueFromString(args[i + 1]))) + return -1; + + if (testQEMUSchemaValidateCommand("object-add", jsonargs, + schema, false, false, &debug= ) < 0) { + VIR_TEST_VERBOSE("failed to validate -object '%s' against = QAPI schema: %s", + args[i + 1], virBufferCurrentContent(&deb= ug)); + return -1; + } + i++; } } --=20 2.28.0