From nobody Sun Apr 28 05:24:37 2024 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=1602155936; cv=none; d=zohomail.com; s=zohoarc; b=MfDIJkBDPfuTNFU4Q13KbSZY2U1j1GTnpMqi3df8k7R0ILx/pZQC+nO0PDfU1SCbc5ZKGHa4Nbsywi4clRYmpXZtQMouvLQniScy386nM53wjnUnnyg5YuGlq8vqjbnd+uBV3dHilNtqTHsshz4WHuRqFDANPP6zycpfqW0uMWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602155936; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=S/czls32naGqDBVJc555dEhFy0bFQ/5p6DqZNS8RlRQ=; b=Me+TZq61zSAmAUBehPqr6tbBUBB1vtWPzSZT1krclrbR1ENw7b/i3Ui7vOyQAWWzo1BltUf1M+564jNyjJKaw6fc2XfPIADI/+IKXT39MLLQhd8kwq7/a9uFd29gH2HBuSXxvK/r6OAULWTEL9sMzsA7/HWiiEV1yfTH4PVD8lk= 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 1602155936220449.0581487525617; Thu, 8 Oct 2020 04:18:56 -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-218--nNmq16GNg6OdJQfQvDx9Q-1; Thu, 08 Oct 2020 07:18:52 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8509164143; Thu, 8 Oct 2020 11:18:47 +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 5F1F55C1BD; Thu, 8 Oct 2020 11:18:47 +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 F0F408C7BB; Thu, 8 Oct 2020 11:18:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 098BIjHn026777 for ; Thu, 8 Oct 2020 07:18:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id D00995D9F3; Thu, 8 Oct 2020 11:18:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18BED5D9F1 for ; Thu, 8 Oct 2020 11:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602155935; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=S/czls32naGqDBVJc555dEhFy0bFQ/5p6DqZNS8RlRQ=; b=i5KmqS3iWHrgCipTCEreW/jL038PaCzvJ3BpKFy8sexA5P3e0AjqcxkY19EWkb3e8f0wht QqjLNPDY6ft7p8dSsyVCXyDsv94F0NsEm27BhtByViYUcHvxtRY/Eccddx3Nuept8VVmE5 s7DZ6e8PMZvzedUSewqNGIcsCotB+TA= X-MC-Unique: -nNmq16GNg6OdJQfQvDx9Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] virschematest: Validate schema in tests/cputestdata Date: Thu, 8 Oct 2020 13:18:40 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.16 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 --- This applies on top of my previous series refactoring the virschematest. 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