From nobody Fri May 3 20:41:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528119205581382.37574995506986; Mon, 4 Jun 2018 06:33:25 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D0E8D30BEFB1; Mon, 4 Jun 2018 13:33:23 +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 752A0608EF; Mon, 4 Jun 2018 13:33:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3FA8E4A469; Mon, 4 Jun 2018 13:33:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w54DXHIp030578 for ; Mon, 4 Jun 2018 09:33:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0AD0B20292A8; Mon, 4 Jun 2018 13:33:17 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3172200BCBB for ; Mon, 4 Jun 2018 13:33:16 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 15:33:03 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: qemuxml2argv: Make tests based on DO_TEST_CAPS_INTERNAL stable 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 04 Jun 2018 13:33:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To avoid problems with test cases specifying an alias machine type which would change once capabilities for a newer version are added strip all alias machine types for the DO_TEST_CAPS_INTERNAL based tests. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 17 +++++++++++++= ++++ src/qemu/qemu_capspriv.h | 3 +++ .../disk-virtio-scsi-reservations.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/genid-auto.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/genid.x86_64-latest.args | 2 +- tests/qemuxml2argvtest.c | 1 + 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b8764eacd8..a4a89cedfd 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5156,3 +5156,20 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCa= ps, { qemuCaps->microcodeVersion =3D microcodeVersion; } + + +/** + * virQEMUCapsStripMachineAliases: + * @qemuCaps: capabilities object to process + * + * Remove all aliases so that the tests depending on the latest capabiliti= es + * file can be stable when new files are added. + */ +void +virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps) +{ + size_t i; + + for (i =3D 0; i < qemuCaps->nmachineTypes; i++) + VIR_FREE(qemuCaps->machineTypes[i].alias); +} diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index fea039ef3a..021260de2f 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -97,4 +97,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, void virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, unsigned int microcodeVersion); + +void +virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps); #endif diff --git a/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-la= test.args b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-lat= est.args index 768bc22f9f..927173fa03 100644 --- a/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-latest.ar= gs +++ b/tests/qemuxml2argvdata/disk-virtio-scsi-reservations.x86_64-latest.ar= gs @@ -13,7 +13,7 @@ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ path=3D/tmp/lib/domain--1-QEMUGuest1/pr-helper0.sock \ -object pr-manager-helper,id=3Dpr-helper-scsi0-0-0-1,\ path=3D/path/to/qemu-pr-helper.sock \ --machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 214 \ -realtime mlock=3Doff \ -smp 8,sockets=3D8,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/genid-auto.x86_64-latest.args b/tests/q= emuxml2argvdata/genid-auto.x86_64-latest.args index ce163020b9..7412651479 100644 --- a/tests/qemuxml2argvdata/genid-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/genid-auto.x86_64-latest.args @@ -9,7 +9,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ --machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/genid.x86_64-latest.args b/tests/qemuxm= l2argvdata/genid.x86_64-latest.args index 54e00f4bdb..dbffa7e1d2 100644 --- a/tests/qemuxml2argvdata/genid.x86_64-latest.args +++ b/tests/qemuxml2argvdata/genid.x86_64-latest.args @@ -9,7 +9,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ --machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 61c7ae59aa..ab7a50817a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -705,6 +705,7 @@ mymain(void) if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ return EXIT_FAILURE; \ + virQEMUCapsStripMachineAliases(info.qemuCaps); \ if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list