From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571827405; cv=none; d=zoho.com; s=zohoarc; b=GBka1xep709IN9WiyDmbH8S7W6Pkyp5lI/Lcqlq2wYVI34tP0P7wDDSVWNo20eZ2bFgsxtSl7UHGDh+/UQwVSKHEBR4V1AMwQX14bbO/srIwBI8eRyPHUREc5/arE8PdCSsdv4/yFTDDoVVyuuBRALxyiGPaYWqd0lswbRg66aY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827405; 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=Ai+NYoGxliaGvI1ujzogd+LEM0lBric80ImxsvQEB5I=; b=Q24gh6MLhNG8EteBvNaTvFG+yVWotvKPdP5tHnie/jDCJxdjXEm+kuPnlG6YZxSOKFHqN6tgJe6Q8XSQPgwA5zavXt/LUeJ8KuIckW63FGaDj1B/r9WFLC0sS+nlim9Ux5GfihDTf0yKLMhxznEX1dNoYcji1atmnXNguafj3z4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571827405122467.72346809276803; Wed, 23 Oct 2019 03:43:25 -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-267-pZ17ZxsrOzmuPBMXOUK_4A-1; Wed, 23 Oct 2019 06:43:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DBA01005509; Wed, 23 Oct 2019 10:43:17 +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 CC883605AD; Wed, 23 Oct 2019 10:43:16 +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 2A12E4E58A; Wed, 23 Oct 2019 10:43:16 +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 x9NAhEik020236 for ; Wed, 23 Oct 2019 06:43:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED04EBAA4; Wed, 23 Oct 2019 10:43:14 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 584EF60E1C for ; Wed, 23 Oct 2019 10:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827403; 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=Ai+NYoGxliaGvI1ujzogd+LEM0lBric80ImxsvQEB5I=; b=J3djD/cs0ZvE/jqp5VuJawe5wgL16yTBR6mov6YXaDwUhdTwE5ZTUqhm6gefFlv0cFpMyF RwrzFlvXk4ie6ldQhjDwQYB1Uf/D4RrwWFeMjetclRYc5Zt5G/QwZxdrYx9rA23wZbu3rj mF9bbQmKByPBnktowfcKOl+buAFjVJU= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:51 +0200 Message-Id: <20191023104302.26669-2-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/12] tests/qemucapabilities: Separate inputDir and outputDir 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.11 X-MC-Unique: pZ17ZxsrOzmuPBMXOUK_4A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We'll need this later. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index a9a1e75587..bb4ce74a29 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -35,7 +35,8 @@ typedef struct _testQemuData testQemuData; typedef testQemuData *testQemuDataPtr; struct _testQemuData { virQEMUDriver driver; - const char *dataDir; + const char *inputDir; + const char *outputDir; const char *archName; const char *base; int ret; @@ -48,7 +49,8 @@ testQemuDataInit(testQemuDataPtr data) if (qemuTestDriverInit(&data->driver) < 0) return -1; =20 - data->dataDir =3D TEST_QEMU_CAPS_PATH; + data->inputDir =3D TEST_QEMU_CAPS_PATH; + data->outputDir =3D TEST_QEMU_CAPS_PATH; =20 data->ret =3D 0; =20 @@ -77,9 +79,9 @@ testQemuCaps(const void *opaque) const char *p; =20 if (virAsprintf(&repliesFile, "%s/%s.%s.replies", - data->dataDir, data->base, data->archName) < 0 || + data->inputDir, data->base, data->archName) < 0 || virAsprintf(&capsFile, "%s/%s.%s.xml", - data->dataDir, data->base, data->archName) < 0) + data->outputDir, data->base, data->archName) < 0) goto cleanup; =20 if (!(mon =3D qemuMonitorTestNewFromFileFull(repliesFile, &data->drive= r, NULL, @@ -146,7 +148,7 @@ testQemuCapsCopy(const void *opaque) char *actual =3D NULL; =20 if (virAsprintf(&capsFile, "%s/%s.%s.xml", - data->dataDir, data->base, data->archName) < 0) + data->outputDir, data->base, data->archName) < 0) goto cleanup; =20 if (!(caps =3D virCapabilitiesNew(virArchFromString(data->archName), --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1571827413; cv=none; d=zoho.com; s=zohoarc; b=famGXdrITXvaaiXdhYfDuSgKof/N95co/4BhWkqhdPzYgWYSBbSgzXO+faEZC9WgUSUTUOU9vDsKq1p8cS5dcbI//FaRjBK7s//G9Vh525Mad8/1VhXHHHJifukHbBAl0vounnSqj5+SpkMW7twxqe6s8s3PMo7EYBj6OOyzAX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827413; 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=ppQxKv8YodbF/ouiu43fLblRm1jMrEZJkiLrfGgxStA=; b=PELZcz1GWa36tH48L82/noKMV9Dw+eKai2GCoOwSOmXAG+4Jtr3sOUjZfEMqQpZJFmN2kPmlPO99EP0yAhRc0FV9QImI63PuTUNJv9roCsMFNW4nKdupKxpz1a4OypYIetiNF1LSVJq10T1M5GlVCZ1JuTCJu9XszYBAUG6e12k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 157182741392725.227934669477804; Wed, 23 Oct 2019 03:43:33 -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-224-R2sGEZiHPnauH4ybf2_gSQ-1; Wed, 23 Oct 2019 06:43:31 -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 3303D47B; Wed, 23 Oct 2019 10:43:26 +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 08D7F1001E75; Wed, 23 Oct 2019 10:43:26 +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 BDBB94EDA5; Wed, 23 Oct 2019 10:43:25 +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 x9NAhFRI020244 for ; Wed, 23 Oct 2019 06:43:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id EC46360E1C; Wed, 23 Oct 2019 10:43:15 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53933BAA4 for ; Wed, 23 Oct 2019 10:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827412; 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=ppQxKv8YodbF/ouiu43fLblRm1jMrEZJkiLrfGgxStA=; b=X3DKdbNUZ97RMVR44KNqaSImak+rExZreB2kgNWFzO3JpWSAY8a4t9F2q0ueDCqV8D2LYS HNEEsCpPP/K2ULJ1dipW3tISazjNtae9l8DYfG4RoAm7zSWOVAMb6+oEFc9E27Kl3kyaXB TuL/G5m2AtQVfb9atXFa4irXHCnkTi4= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:52 +0200 Message-Id: <20191023104302.26669-3-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/12] tests: testQemuCapsIterate: Don't ignore malformed file names 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 X-MC-Unique: R2sGEZiHPnauH4ybf2_gSQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If files whose name doesn't follow the expected format are added to the repository, it's better to make the test suite fail than to silently ignore them. Signed-off-by: Andrea Bolognani --- tests/testutilsqemu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 0faa9cb84a..7a2ea3bf4e 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -910,7 +910,7 @@ testQemuCapsIterate(const char *suffix, goto cleanup; =20 while ((rc =3D virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH)) > 0) { - char *tmp =3D ent->d_name; + g_autofree char *tmp =3D g_strdup(ent->d_name); char *base =3D NULL; char *archName =3D NULL; =20 @@ -918,9 +918,11 @@ testQemuCapsIterate(const char *suffix, if (!virStringStripSuffix(tmp, suffix)) continue; =20 - /* Find the last dot, moving on if none is present */ - if (!(archName =3D strrchr(tmp, '.'))) - continue; + /* Find the last dot */ + if (!(archName =3D strrchr(tmp, '.'))) { + VIR_TEST_VERBOSE("malformed file name '%s'", ent->d_name); + goto cleanup; + } =20 /* The base name is everything before the last dot, and * the architecture name everything after it */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571827420; cv=none; d=zoho.com; s=zohoarc; b=cbsCwKrr3C3jnP1xDce37eDpEzJ3LqCmfcUyipAQDvAten0VXU6/T87l2gTq381lmG1j+p6TPa1eOiabh69euD+i690PjKqNRl3qEVF/iDH+aLr0susdPdckW0xlEfvRc4dFOVHXw+TpiswNWa2Wn+fbBJLhSm4IF8IbiudrfNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827420; 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=INiCp7b/7zlLAvof5/2ErLBBqrpQHTqUr7ZUIGlHxts=; b=SsN7f24dyuJKXZe8WYq/E5l8O95iESg0aK1la/E1L9vVO73oq0+lZybMPGaT6z/QCvuXtSpqTpl/8vcl9gLN79WZnzNdMdxsOizOrR4MEptw9CjouxhWHw8LUc0iWcPTAmJ9YLph3BjsKkdoP9IQoaFsnLWrmOLcXPZ+tcEhgTU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157182742064782.79510184257879; Wed, 23 Oct 2019 03:43:40 -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-359-9qtZ-k8tMk-ZjntK-g6DUA-1; Wed, 23 Oct 2019 06:43:35 -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 D152B1005512; Wed, 23 Oct 2019 10:43:29 +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 A94135C54A; Wed, 23 Oct 2019 10:43:29 +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 69432180B780; Wed, 23 Oct 2019 10:43:29 +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 x9NAhGAJ020252 for ; Wed, 23 Oct 2019 06:43:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id D20C5BAA5; Wed, 23 Oct 2019 10:43:16 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A97960E1C for ; Wed, 23 Oct 2019 10:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827417; 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=INiCp7b/7zlLAvof5/2ErLBBqrpQHTqUr7ZUIGlHxts=; b=SPK+FjwTgd266+S8W3MHmSFNe5ajQ1JPTgNrF6sNe2pyZd3G+XB0SnAZgfK1sDLFRQV5ko c5Mron/6JTFO/JKhPNPvwqo/e9Co1VSdkE3xsnhH4ck2mKkUfbkNJEtnBmDXmg2Uy9Bx2a GXS2xmNIJBrYLSs4pI4i3fRHxfEjal0= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:53 +0200 Message-Id: <20191023104302.26669-4-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/12] tests: testQemuCapsIterate: Validate suffix 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 X-MC-Unique: 9qtZ-k8tMk-ZjntK-g6DUA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We're going to depend on the fact that the suffix starts with a dot later on, so we better ensure that it does. Signed-off-by: Andrea Bolognani --- tests/testutilsqemu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 7a2ea3bf4e..c602255149 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -906,6 +906,12 @@ testQemuCapsIterate(const char *suffix, if (!callback) return 0; =20 + /* Validate suffix */ + if (!STRPREFIX(suffix, ".")) { + VIR_TEST_VERBOSE("malformed suffix '%s'", suffix); + goto cleanup; + } + if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0) goto cleanup; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571827565; cv=none; d=zoho.com; s=zohoarc; b=lYyqlVzf5PWj7m6etklHOIBk8r+B0tILCvjnmn2Z31rZrrif2wmDuML1uVyUTOR9HkGW/IK6ibmJwS/X4HpjcX8ZQfPulFT0b1sbZXli11tjmOa6oChfj06TmsHt3YjTaetfc8823rACtOM6SkPaGcLe5fYhg09w0zxtMBDKy5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827565; 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=IobXASXpEpDwsP9gjpuN8UsebJvoLZBvhRxjPCDumL0=; b=EgHOaUbRP7b8V38zrNWaMjt+X4Jb9rVHhF8XyqJGWRB8mpn0BF2uML29BQoeNgPbLZvMoQQmQ7TDmgNIIMfLOcm4Qfm1MoEcVnZy+gTLmVjsDP3zcD+RDMMW8EyFLqczDSZUnmfNftjiUGvArH2gi8Px2/h4qhaGZ5xUIzQVuko= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571827565576811.4239868704911; Wed, 23 Oct 2019 03:46:05 -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-285-jqXtjds9PeWywV8luc_BwQ-1; Wed, 23 Oct 2019 06:43:38 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60ADB801E66; Wed, 23 Oct 2019 10:43:33 +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 346D460467; Wed, 23 Oct 2019 10:43:33 +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 E68564EE6F; Wed, 23 Oct 2019 10:43:32 +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 x9NAhH20020261 for ; Wed, 23 Oct 2019 06:43:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id C73B760E1C; Wed, 23 Oct 2019 10:43:17 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45D48BAA5 for ; Wed, 23 Oct 2019 10:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827562; 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=IobXASXpEpDwsP9gjpuN8UsebJvoLZBvhRxjPCDumL0=; b=OchbQ54vDglG94TKwVw9kD/SVgjfOwf6n/byJw2hAVg0GL+0JK0r5qxPQm7luwgPPCRp6q 94Kcp7nBvZtDqUKJRtgQwH2DBnDIP/Ve4ucSZ5/nNUt4ckSo+LKnXoPbf6IApXvn+dRfe6 4ZA+rpeu5blioifxpx3s4ZXZbcDfZQQ= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:54 +0200 Message-Id: <20191023104302.26669-5-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/12] tests: testQemuCapsIterate: Pass inputDir to callback 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.11 X-MC-Unique: jqXtjds9PeWywV8luc_BwQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Right now users need to know input file live inside TEST_QEMU_CAPS_PATH, which is bad layering. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 5 +++-- tests/qemucaps2xmltest.c | 5 +++-- tests/testutilsqemu.c | 2 +- tests/testutilsqemu.h | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index bb4ce74a29..6b8d2676e3 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -49,7 +49,6 @@ testQemuDataInit(testQemuDataPtr data) if (qemuTestDriverInit(&data->driver) < 0) return -1; =20 - data->inputDir =3D TEST_QEMU_CAPS_PATH; data->outputDir =3D TEST_QEMU_CAPS_PATH; =20 data->ret =3D 0; @@ -180,7 +179,8 @@ testQemuCapsCopy(const void *opaque) =20 =20 static int -doCapsTest(const char *base, +doCapsTest(const char *inputDir, + const char *base, const char *archName, void *opaque) { @@ -193,6 +193,7 @@ doCapsTest(const char *base, return -1; } =20 + data->inputDir =3D inputDir; data->base =3D base; data->archName =3D archName; =20 diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index f5aecaa391..8985b20ac6 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -39,7 +39,6 @@ struct _testQemuData { static int testQemuDataInit(testQemuDataPtr data) { - data->inputDir =3D TEST_QEMU_CAPS_PATH; data->outputDir =3D abs_srcdir "/qemucaps2xmloutdata"; =20 data->ret =3D 0; @@ -174,7 +173,8 @@ testQemuCapsXML(const void *opaque) } =20 static int -doCapsTest(const char *base, +doCapsTest(const char *inputDir, + const char *base, const char *archName, void *opaque) { @@ -184,6 +184,7 @@ doCapsTest(const char *base, if (virAsprintf(&title, "%s (%s)", base, archName) < 0) return -1; =20 + data->inputDir =3D inputDir; data->base =3D base; data->archName =3D archName; =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index c602255149..75c8180c7a 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -937,7 +937,7 @@ testQemuCapsIterate(const char *suffix, archName++; =20 /* Run the user-provided callback */ - if (callback(base, archName, opaque) < 0) + if (callback(TEST_QEMU_CAPS_PATH, base, archName, opaque) < 0) goto cleanup; } =20 diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index a2f7bfcc26..07373f8ce6 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -96,7 +96,8 @@ char *testQemuGetLatestCapsForArch(const char *arch, const char *suffix); virHashTablePtr testQemuGetLatestCaps(void); =20 -typedef int (*testQemuCapsIterateCallback)(const char *base, +typedef int (*testQemuCapsIterateCallback)(const char *inputDir, + const char *base, const char *archName, void *opaque); int testQemuCapsIterate(const char *suffix, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571827427; cv=none; d=zoho.com; s=zohoarc; b=F+USu2sUsZ2kJ1R01fZdJQbA5fZtZPCjxSpNZSc42FGZTqQ2lz+XE27pd/KQbO8GGGe/c+8c6n7j0BPQxYLxAkRk8hjxdKpFmctVKzNy4zCZOcAOrLac6bINy9baMTZjbk7AtzyhYOjPrdKCscuDjPg5V7cJ0md//tLu6jXzIDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827427; 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=sjefGXGNdOOoJM0X9xNIc9f5Z05H4kwY1LOe1Psdu5c=; b=ndTFpQmuo51rlVpeZ3Qqbt5PhMoXvIiB0F3S1elfBG08bksLD4OVGjoZxp4TxH9br7ia7LoeQ3qh/gZVQQ/CoJ1RcRLR44VwaqkKuI1vg/422daLcGi40EL0fgzqRqxwOYj8F/za7DBzsQcB4Iq8ncVymzkmzm9DgQqRsXZi8E4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157182742717115.568818054481426; Wed, 23 Oct 2019 03:43:47 -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-102-Vsaqf15JMfubtchysjw5cw-1; Wed, 23 Oct 2019 06:43:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6814D1800E01; Wed, 23 Oct 2019 10:43:38 +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 C88BB60E1C; Wed, 23 Oct 2019 10:43:36 +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 69FB4180BAA2; Wed, 23 Oct 2019 10:43:36 +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 x9NAhI2A020268 for ; Wed, 23 Oct 2019 06:43:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC956BA79; Wed, 23 Oct 2019 10:43:18 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2637360E1C for ; Wed, 23 Oct 2019 10:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827426; 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=sjefGXGNdOOoJM0X9xNIc9f5Z05H4kwY1LOe1Psdu5c=; b=RyQK82dveoD964AwoPityf4ARKxtc3KCXjX5bZbQmhrfSR9dty2Q1q+lFwp1gvdpVVoDuC uCcElwBQp9tYKXe26y52QmWucDQIJy7oXlWvmSEvsFUF5aOpr9PjO8y+fHeT4z0z6vUqPk 1iMJNwvmUKb6lMCHA1tr/72SARWEo5I= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:55 +0200 Message-Id: <20191023104302.26669-6-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/12] tests: testQemuCapsIterate: Pass suffix to callback 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.12 X-MC-Unique: Vsaqf15JMfubtchysjw5cw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Right now users need to hardcode the suffix, which is not a big deal since they're the ones who passed it to testQemuCapsIterate() in the first place; however, since we're already passing most of the information to the callback and we're going to add more later on, it makes sense to be consistent and pass the suffix too. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 8 ++++++-- tests/qemucaps2xmltest.c | 8 ++++++-- tests/testutilsqemu.c | 11 +++++++++-- tests/testutilsqemu.h | 1 + 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 6b8d2676e3..cc2242df50 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -38,6 +38,7 @@ struct _testQemuData { const char *inputDir; const char *outputDir; const char *archName; + const char *suffix; const char *base; int ret; }; @@ -77,8 +78,9 @@ testQemuCaps(const void *opaque) unsigned int fakeMicrocodeVersion =3D 0; const char *p; =20 - if (virAsprintf(&repliesFile, "%s/%s.%s.replies", - data->inputDir, data->base, data->archName) < 0 || + if (virAsprintf(&repliesFile, "%s/%s.%s.%s", + data->inputDir, data->base, + data->archName, data->suffix) < 0 || virAsprintf(&capsFile, "%s/%s.%s.xml", data->outputDir, data->base, data->archName) < 0) goto cleanup; @@ -182,6 +184,7 @@ static int doCapsTest(const char *inputDir, const char *base, const char *archName, + const char *suffix, void *opaque) { testQemuDataPtr data =3D (testQemuDataPtr) opaque; @@ -196,6 +199,7 @@ doCapsTest(const char *inputDir, data->inputDir =3D inputDir; data->base =3D base; data->archName =3D archName; + data->suffix =3D suffix; =20 if (virTestRun(title, testQemuCaps, data) < 0) data->ret =3D -1; diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 8985b20ac6..7a41e9cdd3 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -33,6 +33,7 @@ struct _testQemuData { const char *outputDir; const char *base; const char *archName; + const char *suffix; int ret; }; =20 @@ -145,8 +146,9 @@ testQemuCapsXML(const void *opaque) data->outputDir, data->archName) < 0) goto cleanup; =20 - if (virAsprintf(&capsFile, "%s/%s.%s.xml", - data->inputDir, data->base, data->archName) < 0) + if (virAsprintf(&capsFile, "%s/%s.%s.%s", + data->inputDir, data->base, + data->archName, data->suffix) < 0) goto cleanup; =20 if (virTestLoadFile(capsFile, &capsData) < 0) @@ -176,6 +178,7 @@ static int doCapsTest(const char *inputDir, const char *base, const char *archName, + const char *suffix, void *opaque) { testQemuDataPtr data =3D (testQemuDataPtr) opaque; @@ -187,6 +190,7 @@ doCapsTest(const char *inputDir, data->inputDir =3D inputDir; data->base =3D base; data->archName =3D archName; + data->suffix =3D suffix; =20 if (virTestRun(title, testQemuCapsXML, data) < 0) data->ret =3D -1; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 75c8180c7a..1f0270f488 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -936,9 +936,16 @@ testQemuCapsIterate(const char *suffix, archName[0] =3D '\0'; archName++; =20 - /* Run the user-provided callback */ - if (callback(TEST_QEMU_CAPS_PATH, base, archName, opaque) < 0) + /* Run the user-provided callback. + * + * We skip the dot that, as verified earlier, starts the suffix + * to make it nicer to rebuild the original file name from inside + * the callback. + */ + if (callback(TEST_QEMU_CAPS_PATH, base, + archName, suffix + 1, opaque) < 0) { goto cleanup; + } } =20 if (rc < 0) diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 07373f8ce6..2c8c4960e9 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -99,6 +99,7 @@ virHashTablePtr testQemuGetLatestCaps(void); typedef int (*testQemuCapsIterateCallback)(const char *inputDir, const char *base, const char *archName, + const char *suffix, void *opaque); int testQemuCapsIterate(const char *suffix, testQemuCapsIterateCallback callback, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571827414; cv=none; d=zoho.com; s=zohoarc; b=FWU9xmAE8Df9Kb8IAg1wJyFhXf9RcloOmQt8zdCF/GMRF2UCg6W1GjlFnLsGJtwtTwQlq91AvzpROHexSSFzwhz/AYTTYykk+e0LCykoYBZPl/Fiu2fquSqMM9Bp8BheVWR+qtaenhM45IGLRULqYttFizH5/PGDyrcAecKesXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827414; 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=1a2wpu65C1w3YvJjcEKqFrENnTOOPrZbGk39mt75Jnk=; b=H/4tpqdCpFQkZw3lV3Tc3zXverl2WDa1tR2Sjd+ZV4cFushmTh/6gw5ED+WFnHZHNYvPdclpjJtub1OQMLDZSYR1b3a7SrtFvcceLnYgJHKPsg5xVxvHe8jBFEio5xHshCNYFhdH3KDkbZjCeGVZklY5cZrefN6aZ0odvGIyvlc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571827414260455.79149904920075; Wed, 23 Oct 2019 03:43:34 -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-105--USGOMurMgWiBxqqF1P5Sw-1; Wed, 23 Oct 2019 06:43:31 -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 382871800DFF; Wed, 23 Oct 2019 10:43:26 +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 118221001E91; Wed, 23 Oct 2019 10:43:26 +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 C74A84EDA6; Wed, 23 Oct 2019 10:43:25 +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 x9NAhJH6020281 for ; Wed, 23 Oct 2019 06:43:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id E1EDD60E1C; Wed, 23 Oct 2019 10:43:19 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2083DBA79 for ; Wed, 23 Oct 2019 10:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827413; 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=1a2wpu65C1w3YvJjcEKqFrENnTOOPrZbGk39mt75Jnk=; b=GGIV3YxYEPZODYCq7VeZOTWU4Kq268s0NRUYPH47Bk2JMwTId9WTBdR/qqpa8SFOq9kLXx tk+6VOKv+vVle7hCnwt+qX4HBz9SikGl9QEPUAsaAH/ljonsuwdr2S/3NhDxOEe4ZbIS77 lZcRY7OuEq1omy90HD+j9BKWYbnxNqs= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:56 +0200 Message-Id: <20191023104302.26669-7-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/12] tests: testQemuCapsIterate: Pass prefix and version to callback 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 X-MC-Unique: -USGOMurMgWiBxqqF1P5Sw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Right now we're passing a "base" string that contains both, separated by an underscore. Some changes that we're going to introduce later will require us to have the version number on its own, and instead of delegating the task of splitting the two apart to the callback it make more sense to perform it upfront. This change results in quite a bit of churn because we're now using the version number only, without the prefix, to calculate the dummy microcodeVersion. Signed-off-by: Andrea Bolognani --- .../caps_1.5.3.x86_64.xml | 2 +- .../caps_1.6.0.x86_64.xml | 2 +- .../caps_1.7.0.x86_64.xml | 2 +- .../caps_2.1.1.x86_64.xml | 2 +- .../caps_2.10.0.aarch64.xml | 2 +- .../caps_2.10.0.ppc64.xml | 2 +- .../caps_2.10.0.s390x.xml | 2 +- .../caps_2.10.0.x86_64.xml | 2 +- .../caps_2.11.0.s390x.xml | 2 +- .../caps_2.11.0.x86_64.xml | 2 +- .../caps_2.12.0.aarch64.xml | 2 +- .../caps_2.12.0.ppc64.xml | 2 +- .../caps_2.12.0.s390x.xml | 2 +- .../caps_2.12.0.x86_64.xml | 2 +- .../caps_2.4.0.x86_64.xml | 2 +- .../caps_2.5.0.x86_64.xml | 2 +- .../caps_2.6.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 2 +- .../caps_2.6.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 +- .../caps_2.7.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 +- .../caps_2.8.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 2 +- .../caps_2.9.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 2 +- .../caps_3.0.0.x86_64.xml | 2 +- .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 2 +- .../caps_3.1.0.x86_64.xml | 2 +- .../caps_4.0.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 2 +- .../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 2 +- .../caps_4.0.0.x86_64.xml | 2 +- .../caps_4.1.0.x86_64.xml | 2 +- .../caps_4.2.0.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 2 +- .../caps_4.2.0.x86_64.xml | 2 +- tests/qemucapabilitiestest.c | 29 +++++++++++-------- tests/qemucaps2xmltest.c | 15 ++++++---- tests/testutilsqemu.c | 16 ++++++---- tests/testutilsqemu.h | 3 +- 43 files changed, 78 insertions(+), 63 deletions(-) diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.5.3.x86_64.xml index 780d75a513..8b573070d5 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -85,7 +85,7 @@ 1005003 0 - 43100763 + 43100245 x86_64 [... many more changes exactly like this one ...] diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index cc2242df50..8fa4104f20 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -37,9 +37,10 @@ struct _testQemuData { virQEMUDriver driver; const char *inputDir; const char *outputDir; + const char *prefix; + const char *version; const char *archName; const char *suffix; - const char *base; int ret; }; =20 @@ -78,11 +79,12 @@ testQemuCaps(const void *opaque) unsigned int fakeMicrocodeVersion =3D 0; const char *p; =20 - if (virAsprintf(&repliesFile, "%s/%s.%s.%s", - data->inputDir, data->base, + if (virAsprintf(&repliesFile, "%s/%s_%s.%s.%s", + data->inputDir, data->prefix, data->version, data->archName, data->suffix) < 0 || - virAsprintf(&capsFile, "%s/%s.%s.xml", - data->outputDir, data->base, data->archName) < 0) + virAsprintf(&capsFile, "%s/%s_%s.%s.xml", + data->outputDir, data->prefix, data->version, + data->archName) < 0) goto cleanup; =20 if (!(mon =3D qemuMonitorTestNewFromFileFull(repliesFile, &data->drive= r, NULL, @@ -114,7 +116,7 @@ testQemuCaps(const void *opaque) =20 fakeMicrocodeVersion *=3D 100000; =20 - for (p =3D data->base; *p; p++) + for (p =3D data->version; *p; p++) fakeMicrocodeVersion +=3D *p; =20 virQEMUCapsSetMicrocodeVersion(capsActual, fakeMicrocodeVersion); @@ -148,8 +150,9 @@ testQemuCapsCopy(const void *opaque) virQEMUCapsPtr copy =3D NULL; char *actual =3D NULL; =20 - if (virAsprintf(&capsFile, "%s/%s.%s.xml", - data->outputDir, data->base, data->archName) < 0) + if (virAsprintf(&capsFile, "%s/%s_%s.%s.xml", + data->outputDir, data->prefix, data->version, + data->archName) < 0) goto cleanup; =20 if (!(caps =3D virCapabilitiesNew(virArchFromString(data->archName), @@ -182,7 +185,8 @@ testQemuCapsCopy(const void *opaque) =20 static int doCapsTest(const char *inputDir, - const char *base, + const char *prefix, + const char *version, const char *archName, const char *suffix, void *opaque) @@ -191,13 +195,14 @@ doCapsTest(const char *inputDir, g_autofree char *title =3D NULL; g_autofree char *copyTitle =3D NULL; =20 - if (virAsprintf(&title, "%s (%s)", base, archName) < 0 || - virAsprintf(©Title, "copy %s (%s)", base, archName) < 0) { + if (virAsprintf(&title, "%s (%s)", version, archName) < 0 || + virAsprintf(©Title, "copy %s (%s)", version, archName) < 0) { return -1; } =20 data->inputDir =3D inputDir; - data->base =3D base; + data->prefix =3D prefix; + data->version =3D version; data->archName =3D archName; data->suffix =3D suffix; =20 diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 7a41e9cdd3..365efbe4b1 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -31,7 +31,8 @@ typedef testQemuData *testQemuDataPtr; struct _testQemuData { const char *inputDir; const char *outputDir; - const char *base; + const char *prefix; + const char *version; const char *archName; const char *suffix; int ret; @@ -146,8 +147,8 @@ testQemuCapsXML(const void *opaque) data->outputDir, data->archName) < 0) goto cleanup; =20 - if (virAsprintf(&capsFile, "%s/%s.%s.%s", - data->inputDir, data->base, + if (virAsprintf(&capsFile, "%s/%s_%s.%s.%s", + data->inputDir, data->prefix, data->version, data->archName, data->suffix) < 0) goto cleanup; =20 @@ -176,7 +177,8 @@ testQemuCapsXML(const void *opaque) =20 static int doCapsTest(const char *inputDir, - const char *base, + const char *prefix, + const char *version, const char *archName, const char *suffix, void *opaque) @@ -184,11 +186,12 @@ doCapsTest(const char *inputDir, testQemuDataPtr data =3D (testQemuDataPtr) opaque; g_autofree char *title =3D NULL; =20 - if (virAsprintf(&title, "%s (%s)", base, archName) < 0) + if (virAsprintf(&title, "%s (%s)", version, archName) < 0) return -1; =20 data->inputDir =3D inputDir; - data->base =3D base; + data->prefix =3D prefix; + data->version =3D version; data->archName =3D archName; data->suffix =3D suffix; =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 1f0270f488..54d6b1a0ac 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -917,22 +917,28 @@ testQemuCapsIterate(const char *suffix, =20 while ((rc =3D virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH)) > 0) { g_autofree char *tmp =3D g_strdup(ent->d_name); - char *base =3D NULL; + char *version =3D NULL; char *archName =3D NULL; =20 /* Strip the trailing suffix, moving on if it's not present */ if (!virStringStripSuffix(tmp, suffix)) continue; =20 + /* Strip the leading prefix */ + if (!(version =3D STRSKIP(tmp, "caps_"))) { + VIR_TEST_VERBOSE("malformed file name '%s'", ent->d_name); + goto cleanup; + } + /* Find the last dot */ if (!(archName =3D strrchr(tmp, '.'))) { VIR_TEST_VERBOSE("malformed file name '%s'", ent->d_name); goto cleanup; } =20 - /* The base name is everything before the last dot, and - * the architecture name everything after it */ - base =3D tmp; + /* The version number and the architecture name are separated by + * a dot: overwriting that dot with \0 results in both being usable + * as independent, null-terminated strings */ archName[0] =3D '\0'; archName++; =20 @@ -942,7 +948,7 @@ testQemuCapsIterate(const char *suffix, * to make it nicer to rebuild the original file name from inside * the callback. */ - if (callback(TEST_QEMU_CAPS_PATH, base, + if (callback(TEST_QEMU_CAPS_PATH, "caps", version, archName, suffix + 1, opaque) < 0) { goto cleanup; } diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 2c8c4960e9..714a95bb7a 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -97,7 +97,8 @@ char *testQemuGetLatestCapsForArch(const char *arch, virHashTablePtr testQemuGetLatestCaps(void); =20 typedef int (*testQemuCapsIterateCallback)(const char *inputDir, - const char *base, + const char *prefix, + const char *version, const char *archName, const char *suffix, void *opaque); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1571827419; cv=none; d=zoho.com; s=zohoarc; b=cJ1e5QyrpTt34hxiyJDC6By5E/a3kchBZRTUcIWwgXtAyMfs1OrIZVmGnmXJTOF3dU0pXIp0MIO1/0lA02L05fqwz4GGJ2BPGbNebxdFnkohwRr/on7cbSXeTsS+iSi1UKps4FJv5SaTDCkhkYtiji6FOxm9/2nJYQG6z/ASkK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827419; 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=Y3UsH5zL2Z4t7HyrcnTG2EWxMrk7mjpG7yOuv2x5350=; b=nizjMHgSaCF/NtL7WZuIWgXrXXWnDHTrYtToLUlDmHz4vN+GX5AUAtbNM7Cg2UxcbDBks4c7ykz9oUyu65Mm6CtjcnhF7spU7g40LPOAn47ONx4NCSwFj/mK7Lk3BAmRA4gh1HdbyQATG9yVMOC6fGIByBNU2jeMBQpdyiCfGVg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157182741986192.32491028157415; Wed, 23 Oct 2019 03:43:39 -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-49--FnDESzWMJam5N7SLb6ydw-1; Wed, 23 Oct 2019 06:43:34 -0400 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 CD0A0801E72; Wed, 23 Oct 2019 10:43:29 +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 A5269614CD; Wed, 23 Oct 2019 10:43:29 +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 62A16180B76F; Wed, 23 Oct 2019 10:43:29 +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 x9NAhKKJ020291 for ; Wed, 23 Oct 2019 06:43:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id F1046BA79; Wed, 23 Oct 2019 10:43:20 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57AB160E1C for ; Wed, 23 Oct 2019 10:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827417; 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=Y3UsH5zL2Z4t7HyrcnTG2EWxMrk7mjpG7yOuv2x5350=; b=PnK2kh0nlscPfm9Ib+I53A5+p4A79sHIgHeqzx9K8rnMzJw1b2oXLf0I4U187Z3Kd1hr52 zOZP1yQTHAgUtYze3s4nczy8OoJ1E9FBjpESEbrLn6uU74g5V0eXtmNnL+Ag3B9xjNbziK KR88hblLlO3/ac8BN+vfD1Y6m+8Jgqg= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:57 +0200 Message-Id: <20191023104302.26669-8-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/12] tests: Rename domaincapsschemadata/ -> domaincapsdata/ 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 X-MC-Unique: -FnDESzWMJam5N7SLb6ydw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The usual convention is to use ${foo}test.c for the test program itself and either ${foo}data/ or ${foo}outdata/, depending on whether it contains both input and output files or only the latter, for the corresponding data directory. Signed-off-by: Andrea Bolognani --- tests/Makefile.am | 2 +- .../bhyve_basic.x86_64.xml | 0 .../bhyve_fbuf.x86_64.xml | 0 .../bhyve_uefi.x86_64.xml | 0 tests/{domaincapsschemadata =3D> domaincapsdata}/empty.xml | 0 tests/{domaincapsschemadata =3D> domaincapsdata}/libxl-xenfv.xml | 0 tests/{domaincapsschemadata =3D> domaincapsdata}/libxl-xenpv.xml | 0 .../qemu_1.7.0.x86_64.xml | 0 .../qemu_2.12.0-virt.aarch64.xml | 0 .../qemu_2.12.0.ppc64.xml | 0 .../qemu_2.12.0.s390x.xml | 0 .../qemu_2.12.0.x86_64.xml | 0 .../qemu_2.6.0-virt.aarch64.xml | 0 .../qemu_2.6.0.aarch64.xml | 0 .../qemu_2.6.0.ppc64.xml | 0 .../qemu_2.6.0.x86_64.xml | 0 .../qemu_2.7.0.s390x.xml | 0 .../qemu_2.8.0-tcg.x86_64.xml | 0 .../qemu_2.8.0.s390x.xml | 0 .../qemu_2.8.0.x86_64.xml | 0 .../qemu_2.9.0-q35.x86_64.xml | 0 .../qemu_2.9.0-tcg.x86_64.xml | 0 .../qemu_2.9.0.x86_64.xml | 0 .../qemu_3.0.0.s390x.xml | 0 .../qemu_3.1.0.x86_64.xml | 0 .../qemu_4.0.0.s390x.xml | 0 .../qemu_4.0.0.x86_64.xml | 0 .../qemu_4.1.0.x86_64.xml | 0 .../qemu_4.2.0.aarch64.xml | 0 .../qemu_4.2.0.ppc64.xml | 0 .../qemu_4.2.0.x86_64.xml | 0 tests/domaincapstest.c | 2 +- tests/virschematest.c | 2 +- 33 files changed, 3 insertions(+), 3 deletions(-) rename tests/{domaincapsschemadata =3D> domaincapsdata}/bhyve_basic.x86_64= .xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/bhyve_fbuf.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/bhyve_uefi.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/empty.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/libxl-xenfv.xml (1= 00%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/libxl-xenpv.xml (1= 00%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_1.7.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.12.0-virt.a= arch64.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.12.0.ppc64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.12.0.s390x.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.12.0.x86_64= .xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.6.0-virt.aa= rch64.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.6.0.aarch64= .xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.6.0.ppc64.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.6.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.7.0.s390x.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.8.0-tcg.x86= _64.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.8.0.s390x.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.8.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.9.0-q35.x86= _64.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.9.0-tcg.x86= _64.xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_2.9.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_3.0.0.s390x.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_3.1.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.0.0.s390x.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.0.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.1.0.x86_64.= xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.2.0.aarch64= .xml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.2.0.ppc64.x= ml (100%) rename tests/{domaincapsschemadata =3D> domaincapsdata}/qemu_4.2.0.x86_64.= xml (100%) diff --git a/tests/Makefile.am b/tests/Makefile.am index a9acd88670..10a309bd76 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -89,7 +89,7 @@ EXTRA_DIST =3D \ capabilityschemadata \ commanddata \ cputestdata \ - domaincapsschemadata \ + domaincapsdata \ domainconfdata \ domainschemadata \ fchostdata \ diff --git a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml b/tests/doma= incapsdata/bhyve_basic.x86_64.xml similarity index 100% rename from tests/domaincapsschemadata/bhyve_basic.x86_64.xml rename to tests/domaincapsdata/bhyve_basic.x86_64.xml [... many more files get moved ...] diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 61bc019671..7a69543a45 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -217,7 +217,7 @@ test_virDomainCapsFormat(const void *opaque) char *domCapsXML =3D NULL; int ret =3D -1; =20 - if (virAsprintf(&path, "%s/domaincapsschemadata/%s.xml", + if (virAsprintf(&path, "%s/domaincapsdata/%s.xml", abs_srcdir, data->name) < 0) goto cleanup; =20 diff --git a/tests/virschematest.c b/tests/virschematest.c index dabbc02163..050da0c972 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -221,7 +221,7 @@ mymain(void) "lxcxml2xmloutdata", "bhyvexml2argvdata", "genericxml2xmli= ndata", "genericxml2xmloutdata", "xlconfigdata", "libxlxml2domconf= igdata", "qemuhotplugtestdomains"); - DO_TEST_DIR("domaincaps.rng", "domaincapsschemadata"); + DO_TEST_DIR("domaincaps.rng", "domaincapsdata"); DO_TEST_DIR("domaincheckpoint.rng", "qemudomaincheckpointxml2xmlin", "qemudomaincheckpointxml2xmlout"); DO_TEST_DIR("domainsnapshot.rng", "qemudomainsnapshotxml2xmlin", --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1571827413; cv=none; d=zoho.com; s=zohoarc; b=h1jKEWcJUoXScVVxMqRqV22lIrBcmTEn9kOFMd7hQ2tx1sBfVY8gydvdoNnLbT87co3eLkwslmCGzBhHnqrlRh0nG/6jF4G+88ibsq39vMpRhVcKLGqwfR0YRuoi/lzGw4+RL+GCt7RPSvAnXS5j4KE3R8JjXqesYVIqEsCkCs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827413; 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=mW2/prthOfOrrA/mDViiqvWqe5g6CHm9O0/GRMP+2s0=; b=koN93uW49cU9VR6NZtJT2g3KYEZSzBwADJXBwv4lloGf40RYuRFeI4NVLQfzrJzzg66kDWdWwStGCWtCbQ4x+GfGO0P4jJYhNVrCbJjOsIEIUvbQVWGwR685IW33bO8v1nLcl6+iSCcz1JBzDOnca3OKc2Wpqs7oQ84U9q2mp00= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157182741341514.100866073661564; Wed, 23 Oct 2019 03:43:33 -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-65-T1oi1MLHPAiJsGBKEkjkBA-1; Wed, 23 Oct 2019 06:43:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C3151005512; Wed, 23 Oct 2019 10:43:24 +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 3450C798B; Wed, 23 Oct 2019 10:43:24 +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 EB48A4E9F2; Wed, 23 Oct 2019 10:43:23 +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 x9NAhL8l020298 for ; Wed, 23 Oct 2019 06:43:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id E65C160E1C; Wed, 23 Oct 2019 10:43:21 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 521A8BA79 for ; Wed, 23 Oct 2019 10:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827412; 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=mW2/prthOfOrrA/mDViiqvWqe5g6CHm9O0/GRMP+2s0=; b=h3c0T0QIfrEeC5IP1THZFmba/yqXWsDm4aCndw2BOZ12xXr4BDpvK8FoVupMqPWSKnU0u+ 4UksBZsarJ66493mIFHoc6JLPGW1L+05ngD+VqIYSLAv27Z1NZliIjXNlIH/xeLnqw19Bi xw2jMg7StZCvgbJ2s2tXpW0slXmaHVk= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:58 +0200 Message-Id: <20191023104302.26669-9-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/12] tests/domaincaps: Don't mess with test name 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.23 X-MC-Unique: T1oi1MLHPAiJsGBKEkjkBA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Requiring the user to provide the final string themselves will make subsequent changes easier to implement. Signed-off-by: Andrea Bolognani --- tests/domaincapstest.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 7a69543a45..f38f5fb047 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -299,9 +299,8 @@ mymain(void) #define DO_TEST_QEMU(Name, CapsName, Emulator, Machine, Arch, Type) \ do { \ char *name =3D NULL; \ - if (virAsprintf(&name, "qemu_%s%s%s.%s", \ + if (virAsprintf(&name, "qemu_%s.%s", \ Name, \ - Machine ? "-" : "", Machine ? Machine : "", \ Arch) < 0) { \ ret =3D -1; \ break; \ @@ -387,7 +386,7 @@ mymain(void) "/usr/bin/qemu-system-x86_64", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.9.0", "caps_2.9.0", + DO_TEST_QEMU("2.9.0-q35", "caps_2.9.0", "/usr/bin/qemu-system-x86_64", "q35", "x86_64", VIR_DOMAIN_VIRT_KVM); =20 @@ -403,11 +402,11 @@ mymain(void) "/usr/bin/qemu-system-aarch64", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0", "caps_2.6.0", + DO_TEST_QEMU("2.6.0-virt", "caps_2.6.0", "/usr/bin/qemu-system-aarch64", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.12.0", "caps_2.12.0", + DO_TEST_QEMU("2.12.0-virt", "caps_2.12.0", "/usr/bin/qemu-system-aarch64", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571827424; cv=none; d=zoho.com; s=zohoarc; b=mF9RlbNCLPdzI/ieb+svZbbeBywD2DfNE4HKYM+zmsUA1HyfVjGg9wR3HwYpczHUoVAp9swpW/HaDcv4cudFaEvUw+HclVpHeLGJweE3MxO8jei1FRDNXel8FKNN+C7iHINzsrKZwUfzkLcYRfsskCsEeyC6hTRBvuh7ZIWGa0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827424; 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=s8seQ/ULa7im47BlkL0S26wASDovLG9qY3sS5aYEBGs=; b=L/9KqcwdlD8OynUmfy5PBG20FxN+tlxYNwrf0UvUVsnSff7MEJNO6fWF6n4f+y6RYU33VoeCHVhEi49XrCcGHGepNwW1YeCvftzZWIOx3NB1v0Qga8+hiNulMLl34GuCgEnnsm6EuAApG6vu+6cjQiRLuB/A/WNfWOTDOU0QJIk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571827424057804.1300388971376; Wed, 23 Oct 2019 03:43:44 -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-40-4314XAtdNz-D4i91-uu98g-1; Wed, 23 Oct 2019 06:43:39 -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 279D3107AD3C; Wed, 23 Oct 2019 10:43:34 +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 EF1221001DF0; Wed, 23 Oct 2019 10:43:33 +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 AD94F180BA9F; Wed, 23 Oct 2019 10:43:33 +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 x9NAhMoj020304 for ; Wed, 23 Oct 2019 06:43:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD01EBA79; Wed, 23 Oct 2019 10:43:22 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B3E860E1C for ; Wed, 23 Oct 2019 10:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827422; 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=s8seQ/ULa7im47BlkL0S26wASDovLG9qY3sS5aYEBGs=; b=B/r4qA79rw5DD7Og4zQwvpmu91bjEJMQmhIzIN0sNZ1iHGDUwnAGGdPFwR0C5bRyj3jYrr r2yJgv/YpAuy70j8JydYfITXHwwu3VLNBhVRNXR1vcC/TZdNtnr0pQnPU99bEDmC/pRz1M b3fEOCb17W5XivZFi1kPuH4M146WYoY= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:42:59 +0200 Message-Id: <20191023104302.26669-10-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/12] tests/domaincaps: Move most of DO_TEST_QEMU() into a function 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 X-MC-Unique: 4314XAtdNz-D4i91-uu98g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Macros become less and less appealing the more work you perform inside them: DO_TEST_QEMU() has arguably already crossed that threshold, and we're going to add even more code later on. While factoring the code out of the macro, convert it to use the GLib string manipulation functions and take advantage of autofree. Signed-off-by: Andrea Bolognani --- tests/domaincapstest.c | 50 ++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index f38f5fb047..e35eddc659 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -266,6 +266,36 @@ test_virDomainCapsFormat(const void *opaque) return ret; } =20 +static int +doTestQemu(const char *partialName, + const char *capsName, + const char *emulator, + const char *machine, + const char *arch, + virDomainVirtType type, + void *opaque) +{ + g_autofree char *name =3D NULL; + + name =3D g_strdup_printf("qemu_%s.%s", partialName, arch); + + struct testData data =3D { + .name =3D name, + .emulator =3D emulator, + .machine =3D machine, + .arch =3D arch, + .type =3D type, + .capsType =3D CAPS_QEMU, + .capsName =3D capsName, + .capsOpaque =3D opaque, + }; + + if (virTestRun(name, test_virDomainCapsFormat, &data) < 0) + return -1; + + return 0; +} + static int mymain(void) { @@ -298,26 +328,8 @@ mymain(void) =20 #define DO_TEST_QEMU(Name, CapsName, Emulator, Machine, Arch, Type) \ do { \ - char *name =3D NULL; \ - if (virAsprintf(&name, "qemu_%s.%s", \ - Name, \ - Arch) < 0) { \ + if (doTestQemu(Name, CapsName, Emulator, Machine, Arch, Type, cfg)= < 0) \ ret =3D -1; \ - break; \ - } \ - struct testData data =3D { \ - .name =3D name, \ - .emulator =3D Emulator, \ - .machine =3D Machine, \ - .arch =3D Arch, \ - .type =3D Type, \ - .capsType =3D CAPS_QEMU, \ - .capsName =3D CapsName, \ - .capsOpaque =3D cfg, \ - }; \ - if (virTestRun(name, test_virDomainCapsFormat, &data) < 0) \ - ret =3D -1; \ - VIR_FREE(name); \ } while (0) =20 #define DO_TEST_LIBXL(Name, Emulator, Machine, Arch, Type) \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571827422; cv=none; d=zoho.com; s=zohoarc; b=HEV4plgevhtMvq/EI7Ej/iogeYDFtnjFdjWHREtFjwGECOjIcnpmk7Y3+8v2AGfFM1CFU5oeSoHo8S2+BxHZ0DDQybVnDBaW/1DfaBMppUyfRs/SA8kN9Xjh644cnidoH9UY8SMALUu2voTKuoGqohuKNJXWeqRnRT3NVvUYxRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827422; 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=AHQ80fI4UbrMjV50/or8ha//Y6R0suKCVz72Spw6vX4=; b=jJrCwfLX2OJl6rQwNC41ddouj4TZmDZYexSLR0daZl3I80z4QTi/81S6nDRBBhkZ+Xr1AKLplAyGqcH99/jJXUwENFZp9o7VB9FEY1EWN6qLXLxz2AcIm9dpYo+zT1IUYUbBD4fLZTA3uYljAPsuz1UETSpKPR1TbVDpPqf2MHQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571827422309621.0984231711774; Wed, 23 Oct 2019 03:43:42 -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-185-f5wV18ipP-mCy2sHAyB4JQ-1; Wed, 23 Oct 2019 06:43:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EC511005528; Wed, 23 Oct 2019 10:43:31 +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 D5B9360467; Wed, 23 Oct 2019 10:43:30 +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 94F614EE6D; Wed, 23 Oct 2019 10:43:30 +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 x9NAhRw5020331 for ; Wed, 23 Oct 2019 06:43:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id DF71FBAA2; Wed, 23 Oct 2019 10:43:27 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A191BAA1 for ; Wed, 23 Oct 2019 10:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827419; 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=AHQ80fI4UbrMjV50/or8ha//Y6R0suKCVz72Spw6vX4=; b=P6dw6Gys5NO7lWbnBHaHpHCJoFutNivY/rVT7bkF1ghWZ6e5XTTcQsQEMGGxG2NemHW3gr /91PsQOHItZT8GaV33S3NvL8sMoXXbfBWrUexGp3BlX9dRN1ex9GYu3WDOnQTP19WsYZlP m55XrJUtFLUn5yfqWzZwQCEdJOgE3kE= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:43:00 +0200 Message-Id: <20191023104302.26669-11-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/12] tests/domaincaps: Don't require redundant information 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.11 X-MC-Unique: f5wV18ipP-mCy2sHAyB4JQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The full name of the test case, as well as the name of the QEMU binary and corresponding capabilities file, can all be derived from other information passed to the test, so there's no point in asking the user to provide them. Signed-off-by: Andrea Bolognani --- tests/domaincapstest.c | 127 ++++++++++++----------------------------- 1 file changed, 36 insertions(+), 91 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index e35eddc659..e3329ef1ff 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -267,17 +267,23 @@ test_virDomainCapsFormat(const void *opaque) } =20 static int -doTestQemu(const char *partialName, - const char *capsName, - const char *emulator, +doTestQemu(const char *version, const char *machine, const char *arch, virDomainVirtType type, void *opaque) { g_autofree char *name =3D NULL; + g_autofree char *capsName =3D NULL; + g_autofree char *emulator =3D NULL; =20 - name =3D g_strdup_printf("qemu_%s.%s", partialName, arch); + name =3D g_strdup_printf("qemu_%s%s%s%s.%s", + version, + (type =3D=3D VIR_DOMAIN_VIRT_QEMU ? "-tcg" : ""= ), + (machine ? "-" : ""), (machine ? machine : ""), + arch); + capsName =3D g_strdup_printf("caps_%s", version); + emulator =3D g_strdup_printf("/usr/bin/qemu-system-%s", arch); =20 struct testData data =3D { .name =3D name, @@ -326,9 +332,9 @@ mymain(void) ret =3D -1; \ } while (0) =20 -#define DO_TEST_QEMU(Name, CapsName, Emulator, Machine, Arch, Type) \ +#define DO_TEST_QEMU(Version, Machine, Arch, Type) \ do { \ - if (doTestQemu(Name, CapsName, Emulator, Machine, Arch, Type, cfg)= < 0) \ + if (doTestQemu(Version, Machine, Arch, Type, cfg) < 0) \ ret =3D -1; \ } while (0) =20 @@ -378,101 +384,40 @@ mymain(void) virFileWrapperAddPrefix("/home/user/.config/qemu/firmware", abs_srcdir "/qemufirmwaredata/home/user/.confi= g/qemu/firmware"); =20 - DO_TEST_QEMU("1.7.0", "caps_1.7.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("1.7.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.8.0", "caps_2.8.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.7.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.8.0-tcg", "caps_2.8.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("2.8.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.9.0", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", "q35", "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); =20 - DO_TEST_QEMU("2.9.0-q35", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", "q35", - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.9.0-tcg", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("3.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("3.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-aarch64", NULL, - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.0.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0-virt", "caps_2.6.0", - "/usr/bin/qemu-system-aarch64", "virt", - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.12.0-virt", "caps_2.12.0", - "/usr/bin/qemu-system-aarch64", "virt", - "aarch64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.7.0", "caps_2.7.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.8.0", "caps_2.8.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("3.0.0", "caps_3.0.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("3.1.0", "caps_3.1.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.0.0", "caps_4.0.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.0.0", "caps_4.0.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.1.0", "caps_4.1.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-aarch64", NULL, - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); =20 virObjectUnref(cfg); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1571827565; cv=none; d=zoho.com; s=zohoarc; b=N6nC3bBn7AOICSNiMG2bH6MUQmA46+WmVRnWPYSxLZZYhT5r6zE0a+a70AqiryuRhZUs569Q+OvFQ2iZcIHycY6WG7apu0YIg7cVdSatXtvXJzQf1h85y6T1R6PDoqIIKFsQ5cprFYDIUAE2jc8Fj6IG4AGY+rQRpgneW5jRDW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827565; 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=XPj6iVIFoj+TJe7tuBSQkcRsm3cd51nBLdBRLU+0/Co=; b=S5EUxkg6QnZZHZd0MKBbu/70h4w1yUlRDeNntRYtjrzMqqKKrzOAn3GAECnBW0sDz7JFiECIbmEoZgueU82lAG1ES8+ZdRmCSZeyWprYNj31IBxY+b2CvIyMul6NuHet+VQpkI1lHQ2UoTYXY9MNO9q8g3cQwmK/lhQMVzP/3Us= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571827565812913.5620857993978; Wed, 23 Oct 2019 03:46:05 -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-177-LRZG0VmoNyWKKB7ftfjPVQ-1; Wed, 23 Oct 2019 06:43:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE6365EC; Wed, 23 Oct 2019 10:43:41 +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 BADFA5458A; Wed, 23 Oct 2019 10:43:40 +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 3C68D4EE7E; Wed, 23 Oct 2019 10:43:40 +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 x9NAhSgr020337 for ; Wed, 23 Oct 2019 06:43:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id C4A65BAA2; Wed, 23 Oct 2019 10:43:28 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F0FEBAA1 for ; Wed, 23 Oct 2019 10:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827562; 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=XPj6iVIFoj+TJe7tuBSQkcRsm3cd51nBLdBRLU+0/Co=; b=ILuc6XXAjUzaFEM4ddsCMq/sFcrhOycc9vc9/04qDWanXIVswGGx9qn6GOAI/qQfSqguOO mL3GnSH0lapyG06UzbJBQ+xB9JWZV/y8NolgsFZeTAnFCiNwANZm5AnuDv7+vz2Ww+UzLh xgkXbgi+dPKlfSy9vIj8pk/LPx6IHG0= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:43:01 +0200 Message-Id: <20191023104302.26669-12-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/12] tests/domaincaps: Make test matrix programmatic 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.15 X-MC-Unique: LRZG0VmoNyWKKB7ftfjPVQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For each QEMU version there are usually several different, architecture-dependedn scenarios that we're interested in testing; however, since the test matrix has to be explicitly created by calling DO_TEST_QEMU() multiple times with different arguments, we end up with spotty coverage. Fix this by implementing the arch-specific rules in code, which result in the full coverage for a (version, arch) combo being automatically achieved with a single call to DO_TEST_QEMU(). Unsurprisingly, this change results in a bunch of extra output files being created. Signed-off-by: Andrea Bolognani --- .../domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 134 +++++++++++++ .../domaincapsdata/qemu_1.7.0-tcg.x86_64.xml | 134 +++++++++++++ .../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 172 ++++++++++++++++ .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 186 +++++++++++++++++ tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 138 +++++++++++++ .../domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 143 ++++++++++++++ .../domaincapsdata/qemu_2.6.0-tcg.x86_64.xml | 143 ++++++++++++++ .../domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 144 ++++++++++++++ .../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 172 ++++++++++++++++ .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 187 ++++++++++++++++++ .../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 172 ++++++++++++++++ .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 187 ++++++++++++++++++ .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 176 +++++++++++++++++ .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 187 ++++++++++++++++++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 176 +++++++++++++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 187 ++++++++++++++++++ .../qemu_4.2.0-virt.aarch64.xml | 150 ++++++++++++++ tests/domaincapstest.c | 102 +++++++--- 18 files changed, 2859 insertions(+), 31 deletions(-) create mode 100644 tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.12.0.aarch64.xml create mode 100644 tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml diff --git a/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_1.7.0-q35.x86_64.xml new file mode 100644 index 0000000000..79b753fa09 --- /dev/null +++ b/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml @@ -0,0 +1,134 @@ + + /usr/bin/qemu-system-x86_64 + kvm + pc-q35-1.7 + x86_64 + + + + + bios + efi + + + /usr/share/AAVMF/AAVMF_CODE.fd + /usr/share/AAVMF/AAVMF32_CODE.fd + /usr/share/OVMF/OVMF_CODE.fd + + rom + pflash + + + yes + no + + + yes + no + + + + + + + Broadwell + + + Opteron_G5 + Opteron_G4 + Opteron_G3 + Opteron_G2 + Opteron_G1 + Haswell + SandyBridge + Westmere + Nehalem + Penryn + Conroe + n270 + athlon + pentium3 + pentium2 + pentium + 486 + coreduo + kvm32 + qemu32 + kvm64 + core2duo + phenom + qemu64 + + + + + + disk + cdrom + floppy + lun + + + fdc + scsi + virtio + usb + sata + + + virtio + + + + + sdl + vnc + spice + + + + + + subsystem + + + default + mandatory + requisite + optional + + + usb + pci + scsi + + + + default + vfio + + + + + virtio + + + random + egd + + + + + + + + + + [... many more files like this one get generated ...] diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index e3329ef1ff..4476423228 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -267,11 +267,11 @@ test_virDomainCapsFormat(const void *opaque) } =20 static int -doTestQemu(const char *version, - const char *machine, - const char *arch, - virDomainVirtType type, - void *opaque) +doTestQemuInternal(const char *version, + const char *machine, + const char *arch, + virDomainVirtType type, + void *opaque) { g_autofree char *name =3D NULL; g_autofree char *capsName =3D NULL; @@ -302,6 +302,50 @@ doTestQemu(const char *version, return 0; } =20 +static int +doTestQemu(const char *version, + const char *arch, + void *opaque) +{ + if (STREQ(arch, "x86_64")) { + /* For x86_64 we test three combinations: + * + * - KVM with default machine + * - KVM with Q35 machine + * - TCG with default machine + */ + if (doTestQemuInternal(version, NULL, arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0 || + doTestQemuInternal(version, "q35", arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0 || + doTestQemuInternal(version, NULL, arch, + VIR_DOMAIN_VIRT_QEMU, opaque) < 0) { + return -1; + } + } else if (STREQ(arch, "aarch64")) { + /* For aarch64 we test two combinations: + * + * - KVM with default machine + * - KVM with virt machine + */ + if (doTestQemuInternal(version, NULL, arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0 || + doTestQemuInternal(version, "virt", arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0) { + return -1; + } + } else if (STRPREFIX(arch, "riscv")) { + /* Unfortunately we have to skip RISC-V at the moment */ + return 0; + } else { + if (doTestQemuInternal(version, NULL, arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0) + return -1; + } + + return 0; +} + static int mymain(void) { @@ -332,9 +376,9 @@ mymain(void) ret =3D -1; \ } while (0) =20 -#define DO_TEST_QEMU(Version, Machine, Arch, Type) \ +#define DO_TEST_QEMU(Version, Arch) \ do { \ - if (doTestQemu(Version, Machine, Arch, Type, cfg) < 0) \ + if (doTestQemu(Version, Arch, cfg) < 0) \ ret =3D -1; \ } while (0) =20 @@ -384,40 +428,36 @@ mymain(void) virFileWrapperAddPrefix("/home/user/.config/qemu/firmware", abs_srcdir "/qemufirmwaredata/home/user/.confi= g/qemu/firmware"); =20 - DO_TEST_QEMU("1.7.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("1.7.0", "x86_64"); =20 - DO_TEST_QEMU("2.6.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.6.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.6.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.6.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", "x86_64"); + DO_TEST_QEMU("2.6.0", "aarch64"); + DO_TEST_QEMU("2.6.0", "ppc64"); =20 - DO_TEST_QEMU("2.7.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.7.0", "s390x"); =20 - DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); - DO_TEST_QEMU("2.8.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.8.0", "x86_64"); + DO_TEST_QEMU("2.8.0", "s390x"); =20 - DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.9.0", "q35", "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("2.9.0", "x86_64"); =20 - DO_TEST_QEMU("2.12.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.12.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.12.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("2.12.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", "x86_64"); + DO_TEST_QEMU("2.12.0", "aarch64"); + DO_TEST_QEMU("2.12.0", "ppc64"); + DO_TEST_QEMU("2.12.0", "s390x"); =20 - DO_TEST_QEMU("3.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("3.0.0", "s390x"); =20 - DO_TEST_QEMU("3.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("3.1.0", "x86_64"); =20 - DO_TEST_QEMU("4.0.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("4.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.0.0", "x86_64"); + DO_TEST_QEMU("4.0.0", "s390x"); =20 - DO_TEST_QEMU("4.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.1.0", "x86_64"); =20 - DO_TEST_QEMU("4.2.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("4.2.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); - DO_TEST_QEMU("4.2.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", "x86_64"); + DO_TEST_QEMU("4.2.0", "ppc64"); + DO_TEST_QEMU("4.2.0", "aarch64"); =20 virObjectUnref(cfg); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 11:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1571827448; cv=none; d=zoho.com; s=zohoarc; b=JVjvnugak551WQscNInoEIy8rP6kaJ5cBUT6AjQMoyCessf5ZpChAr5y+oqIIhwYiljUOHEEPgT3ieMsk0FbezZoJZQshpAcBk5YuZDNScLrExMHaA0b29m6MtUVvFkejCu2qPGWORO6ipg3kIvZjq6HEWdvB1k/boKTnlUxB3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827448; 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=PTqOVYs77+uqMUrj+biAAv3R3+Rj+/YBHTZZ0G1bfVk=; b=iPEGNF2QhxV4VN/VhpPc17oA7rs5bJ94C5yf3lBnWpTr04RUQbXEaROS9nU1MwWRUpkit3kQGcZyxNU5CSVePoC0fYc6z12W0QnZk+e2OXuYC5HfjG/lg9qQ/Hti3gykMqeWgLw5u17xqtOlauEozeWMG8DSHuwEhl6v/QE3DgI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571827448216352.7227798821648; Wed, 23 Oct 2019 03:44:08 -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-aEfAEw-FNJqLwCC-iflQfg-1; Wed, 23 Oct 2019 06:43:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7F31801E78; Wed, 23 Oct 2019 10:43:39 +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 C736F60FA2; Wed, 23 Oct 2019 10:43:37 +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 3FD6F4EE73; Wed, 23 Oct 2019 10:43:37 +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 x9NAhaxJ020354 for ; Wed, 23 Oct 2019 06:43:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA445BA8D; Wed, 23 Oct 2019 10:43:35 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2DA426CE61 for ; Wed, 23 Oct 2019 10:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827446; 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=PTqOVYs77+uqMUrj+biAAv3R3+Rj+/YBHTZZ0G1bfVk=; b=DStYzSNdpwUHrB7gK1u9+o0iWmEavO/lNgUBxmoke0Z6XE4HsWc38a85IZaJRALRrTRxRB Gk8rn+J6iIEdrbISkTgmKahR/S76dsO/zkkz0WiEGRtPTLXyzKXl2NEyB1ccHQ94mv5+vw Lwtxsy4TaczQxbM799nHNyTnoQ9pswc= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:43:02 +0200 Message-Id: <20191023104302.26669-13-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/12] tests/domaincaps: Use testQemuCapsIterate() 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.12 X-MC-Unique: aEfAEw-FNJqLwCC-iflQfg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that the only data we need for fully testing a QEMU binary is the (version, arch) combo, we can stop providing that information ourselves and instead rely on testQemuCapsIterate() automatically picking up new input files as they are added to the repository, the same way the qemucapabilities and qemucaps2xml tests already behave. Unsurprisingly, this change results in a bunch of extra output files being created, significantly expanding our test coverage. Signed-off-by: Andrea Bolognani Reviewed-by: Jiri Denemark --- .../domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 134 ++++++++++++ .../domaincapsdata/qemu_1.5.3-tcg.x86_64.xml | 134 ++++++++++++ tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 134 ++++++++++++ .../domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 134 ++++++++++++ .../domaincapsdata/qemu_1.6.0-tcg.x86_64.xml | 134 ++++++++++++ tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 134 ++++++++++++ .../domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 135 ++++++++++++ .../domaincapsdata/qemu_2.1.1-tcg.x86_64.xml | 135 ++++++++++++ tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 135 ++++++++++++ .../domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 158 ++++++++++++++ .../domaincapsdata/qemu_2.10.0-tcg.x86_64.xml | 177 ++++++++++++++++ .../qemu_2.10.0-virt.aarch64.xml | 142 +++++++++++++ tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 136 ++++++++++++ tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 108 ++++++++++ tests/domaincapsdata/qemu_2.10.0.s390x.xml | 198 ++++++++++++++++++ tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 158 ++++++++++++++ .../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 156 ++++++++++++++ .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml | 172 +++++++++++++++ tests/domaincapsdata/qemu_2.11.0.s390x.xml | 197 +++++++++++++++++ tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 156 ++++++++++++++ .../domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 143 +++++++++++++ .../domaincapsdata/qemu_2.4.0-tcg.x86_64.xml | 143 +++++++++++++ tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 143 +++++++++++++ .../domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 143 +++++++++++++ .../domaincapsdata/qemu_2.5.0-tcg.x86_64.xml | 143 +++++++++++++ tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 143 +++++++++++++ .../domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 144 +++++++++++++ .../domaincapsdata/qemu_2.7.0-tcg.x86_64.xml | 144 +++++++++++++ tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 144 +++++++++++++ tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 108 ++++++++++ tests/domaincapsdata/qemu_2.9.0.s390x.xml | 183 ++++++++++++++++ .../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 169 +++++++++++++++ .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml | 184 ++++++++++++++++ tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 109 ++++++++++ tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 169 +++++++++++++++ tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 110 ++++++++++ .../qemu_4.0.0-virt.aarch64.xml | 150 +++++++++++++ tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 144 +++++++++++++ tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 111 ++++++++++ tests/domaincapstest.c | 57 ++--- 40 files changed, 5715 insertions(+), 36 deletions(-) create mode 100644 tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.5.3.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_1.6.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.1.1.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0.aarch64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0.ppc64.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0.s390x.xml create mode 100644 tests/domaincapsdata/qemu_2.10.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.11.0.s390x.xml create mode 100644 tests/domaincapsdata/qemu_2.11.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.4.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.5.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.7.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_2.9.0.ppc64.xml create mode 100644 tests/domaincapsdata/qemu_2.9.0.s390x.xml create mode 100644 tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_3.0.0.ppc64.xml create mode 100644 tests/domaincapsdata/qemu_3.0.0.x86_64.xml create mode 100644 tests/domaincapsdata/qemu_3.1.0.ppc64.xml create mode 100644 tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml create mode 100644 tests/domaincapsdata/qemu_4.0.0.aarch64.xml create mode 100644 tests/domaincapsdata/qemu_4.0.0.ppc64.xml diff --git a/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml b/tests/domainc= apsdata/qemu_1.5.3-q35.x86_64.xml new file mode 100644 index 0000000000..c6b090ed06 --- /dev/null +++ b/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml @@ -0,0 +1,134 @@ + + /usr/bin/qemu-system-x86_64 + kvm + pc-q35-1.5 + x86_64 + + + + + bios + efi + + + /usr/share/AAVMF/AAVMF_CODE.fd + /usr/share/AAVMF/AAVMF32_CODE.fd + /usr/share/OVMF/OVMF_CODE.fd + + rom + pflash + + + yes + no + + + yes + no + + + + + + + Broadwell + + + Opteron_G5 + Opteron_G4 + Opteron_G3 + Opteron_G2 + Opteron_G1 + Haswell + SandyBridge + Westmere + Nehalem + Penryn + Conroe + n270 + athlon + pentium3 + pentium2 + pentium + 486 + coreduo + kvm32 + qemu32 + kvm64 + core2duo + phenom + qemu64 + + + + + + disk + cdrom + floppy + lun + + + fdc + scsi + virtio + usb + sata + + + virtio + + + + + sdl + vnc + spice + + + + + + subsystem + + + default + mandatory + requisite + optional + + + usb + pci + scsi + + + + default + vfio + + + + + virtio + + + random + egd + + + + + + + + + + [... many more files like this one get generated ...] diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 4476423228..0197c61c8a 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -303,8 +303,11 @@ doTestQemuInternal(const char *version, } =20 static int -doTestQemu(const char *version, +doTestQemu(const char *inputDir G_GNUC_UNUSED, + const char *prefix G_GNUC_UNUSED, + const char *version, const char *arch, + const char *suffix G_GNUC_UNUSED, void *opaque) { if (STREQ(arch, "x86_64")) { @@ -376,12 +379,6 @@ mymain(void) ret =3D -1; \ } while (0) =20 -#define DO_TEST_QEMU(Version, Arch) \ - do { \ - if (doTestQemu(Version, Arch, cfg) < 0) \ - ret =3D -1; \ - } while (0) - #define DO_TEST_LIBXL(Name, Emulator, Machine, Arch, Type) \ do { \ struct testData data =3D { \ @@ -428,36 +425,24 @@ mymain(void) virFileWrapperAddPrefix("/home/user/.config/qemu/firmware", abs_srcdir "/qemufirmwaredata/home/user/.confi= g/qemu/firmware"); =20 - DO_TEST_QEMU("1.7.0", "x86_64"); - - DO_TEST_QEMU("2.6.0", "x86_64"); - DO_TEST_QEMU("2.6.0", "aarch64"); - DO_TEST_QEMU("2.6.0", "ppc64"); - - DO_TEST_QEMU("2.7.0", "s390x"); - - DO_TEST_QEMU("2.8.0", "x86_64"); - DO_TEST_QEMU("2.8.0", "s390x"); - - DO_TEST_QEMU("2.9.0", "x86_64"); - - DO_TEST_QEMU("2.12.0", "x86_64"); - DO_TEST_QEMU("2.12.0", "aarch64"); - DO_TEST_QEMU("2.12.0", "ppc64"); - DO_TEST_QEMU("2.12.0", "s390x"); - - DO_TEST_QEMU("3.0.0", "s390x"); - - DO_TEST_QEMU("3.1.0", "x86_64"); - - DO_TEST_QEMU("4.0.0", "x86_64"); - DO_TEST_QEMU("4.0.0", "s390x"); - - DO_TEST_QEMU("4.1.0", "x86_64"); + if (testQemuCapsIterate(".xml", doTestQemu, cfg) < 0) + return EXIT_FAILURE; =20 - DO_TEST_QEMU("4.2.0", "x86_64"); - DO_TEST_QEMU("4.2.0", "ppc64"); - DO_TEST_QEMU("4.2.0", "aarch64"); + /* + * Run "tests/qemucapsprobe /path/to/qemu/binary >foo.replies" + * to generate updated or new *.replies data files. + * + * If you manually edit replies files you can run + * "tests/qemucapsfixreplies foo.replies" to fix the replies ids. + * + * Once a replies file has been generated and tweaked if necessary, + * you can drop it into tests/qemucapabilitiesdata/ (with a sensible + * name - look at what's already there for inspiration) and test + * programs will automatically pick it up. + * + * To generate the corresponding output files after a new replies + * file has been added, run "VIR_TEST_REGENERATE_OUTPUT=3D1 make check= ". + */ =20 virObjectUnref(cfg); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list