From nobody Sun Feb 8 19:56:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1603110304; cv=none; d=zohomail.com; s=zohoarc; b=cJ9MVVOX4XVZt4X7FVpywiYAZ9lHMUtD8eWf0zpcoUpaBG15/z3iTkNIWKkmR53vq6ZAmynGWM+71xov6sHhkl9taKUeji6cKnp3gJ9Hakd4AMnWQ0k6T8X1klv2TcEKzA0jyVv2Nla9zu2dZtWI3d7P5Sh7KA9O+WFwWNwmVtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603110304; 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=Bgc4M3SIQnkheI/zdS+ICi23lBcssWE0DEIsHBw4WHU=; b=edIjwf9JImmlDoV0oUnkiSsW+dw7Z84FqWKMxqyf2Nv6lZJB0pGg/F74FijlgA+jGQ9cUvfwEyOqKTTB7e2DgiGD0GkBqpZzYdWY6zv+6UsBmJ51TghPQelgcKkJjuzELCLKCq0Q3u7CQKJnzrQgllTxuZZ0SH80VUJhK0EDGLU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603110304520991.3692496421555; Mon, 19 Oct 2020 05:25:04 -0700 (PDT) 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-377-AJozbsWcPZyl0sHw9wHu0A-1; Mon, 19 Oct 2020 08:24:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D5941084D62; Mon, 19 Oct 2020 12:23:58 +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 17BFB100760A; Mon, 19 Oct 2020 12:23:58 +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 DB5588C7B7; Mon, 19 Oct 2020 12:23:57 +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 09JCNuYN002294 for ; Mon, 19 Oct 2020 08:23:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2A22B6716C; Mon, 19 Oct 2020 12:23:56 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B2106198B for ; Mon, 19 Oct 2020 12:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603110303; 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=Bgc4M3SIQnkheI/zdS+ICi23lBcssWE0DEIsHBw4WHU=; b=FLILr7N569aLUpesqHFzwYfYntwGZCTyr3ylvEMdXq9zEsNH03M8PwahjR0cevQaMMTir+ fc8YrIGNmNvjmIvg3HUplT6M5ntAjM6jX/VkSc/g7z97k4pwW9v++ZahTcHwX/zSy22eH7 sVvH5SrhYDt3WXFqEOTv+6pR9PHYNNc= X-MC-Unique: AJozbsWcPZyl0sHw9wHu0A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 18/18] virschematest: Validate schema in tests/cputestdata Date: Mon, 19 Oct 2020 14:22:27 +0200 Message-Id: <68f3cd4315500c26de52e199bf740128de22f0ad.1603109876.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.84 on 10.5.11.22 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" We now have a schema file for the 'cpu' elements. Use it to validate files in 'tests/cputestdata' Unfortunately the files in the directory are too disorganised and not easy to split up to do something more straightforward. The -baseline- input files are tested by the test internally and the rest of the files are internal data feeding the tests so they don't need validation. Signed-off-by: Peter Krempa --- tests/virschematest.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 6ce09d4737..0e587c3ff0 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -323,6 +323,14 @@ static const struct testSchemaEntry schemaStorageVol[]= =3D { { .file =3D "examples/xml/test/testvol.xml" }, }; +static const struct testSchemaEntry schemaCpu[] =3D { + { . dir =3D "tests/cputestdata", + . dirRegex =3D "^[^-]+-cpuid-.*(-host|-guest|-json)\\.xml$" }, + { . dir =3D "tests/cputestdata", + . dirRegex =3D "^[^-]+-baseline-.*-result\\.xml$" }, + { . dir =3D "tests/cputestdata", + . dirRegex =3D "^[^-]+-(?!cpuid|baseline).*$" }, +}; static int mymain(void) @@ -349,6 +357,7 @@ mymain(void) DO_TEST("docs/schemas/storagepoolcaps.rng", schemaStoragepoolcaps); DO_TEST("docs/schemas/storagepool.rng", schemaStoragePool); DO_TEST("docs/schemas/storagevol.rng", schemaStorageVol); + DO_TEST("docs/schemas/cpu.rng", schemaCpu); return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.26.2