From nobody Mon Apr 29 21:46:45 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 1553772638418577.1546021029847; Thu, 28 Mar 2019 04:30:38 -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 4493A307EA9F; Thu, 28 Mar 2019 11:30:37 +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 17915187B6; Thu, 28 Mar 2019 11:30: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 71ECA180338A; Thu, 28 Mar 2019 11:30:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2SBUZCm017828 for ; Thu, 28 Mar 2019 07:30:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93A8518A2E; Thu, 28 Mar 2019 11:30:35 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AB7D600C0 for ; Thu, 28 Mar 2019 11:30:32 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 28 Mar 2019 12:30:30 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: Disable some tests on 32 bit systems 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: , 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]); Thu, 28 Mar 2019 11:30:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" On 32 bit systems there are two tests failing currently: qemufirmwaretest and qemuxml2argvtest (not every test case in them is failing, only some of them). There are several problems: 1) in qemufirmwaretest it's 'QEMU FW precedence test' which is failing. This is because the code tests qemuFirmwareFetchConfigs() which tries to compile a list of some paths from the system and if one of the paths is an empty file it should not appear on the returned list. The code uses virFileLength() to query the file size which uses stat() under the hood. The test uses virfilewrapper to redirect stat() into qemufirmwaredata/ but for reasons beyond me real_stat() returns mangled buffer making the code see a file with a real size even for empty files. I've track this one to a problem in virfilewrapper.c which will call real___xstat() which points to a function in libvirt.so (!) which returns stat with 32bit members even though we're compiling with LARGE_FILE and therefore expect 64bit members in the stat struct. 2) qemuxml2argvtest has two tests failing: 2a) [aarch64-]os-firmware-* - These fail because of the same reason as described in 1) 2b) pseries-hostdevs-* - These fail because they again rely on some stat (lstat to be precise). When building the cmd line for these test cases the code does some search in /sys/bus/pci/... and since we have virpcimock everything works just fine. Except when virfilewrapper.c is linked in because then lstat() is taken from there and when it initializes itself it will lookup real_lstat() which will now point not to virpcimock but to glibc. Again, reasons beyond me. Signed-off-by: Michal Privoznik --- Quite frankly, I hate this patch. But the problem is in our mocking, not in the actual code its testing. And I've tried everything I was able to come up with on how to fix this. So if you have any idea, I'm all ears. tests/qemufirmwaretest.c | 7 +++++++ tests/qemuxml2argvtest.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c index 2b5cbf649b..3332bf0a34 100644 --- a/tests/qemufirmwaretest.c +++ b/tests/qemufirmwaretest.c @@ -52,6 +52,8 @@ testParseFormatFW(const void *opaque) } =20 =20 +#if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) +/* XXX Dirty hack, but mocking stat on 32bits is above my skills */ static int testFWPrecedence(const void *opaque ATTRIBUTE_UNUSED) { @@ -97,6 +99,7 @@ testFWPrecedence(const void *opaque ATTRIBUTE_UNUSED) =20 return 0; } +#endif =20 =20 static int @@ -124,8 +127,12 @@ mymain(void) DO_PARSE_TEST("usr/share/qemu/firmware/61-ovmf.json"); DO_PARSE_TEST("usr/share/qemu/firmware/70-aavmf.json"); =20 + +#if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) + /* XXX Dirty hack, but mocking stat on 32bits is above my skills */ if (virTestRun("QEMU FW precedence test", testFWPrecedence, NULL) < 0) ret =3D -1; +#endif =20 virFileWrapperClearPrefixes(); =20 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0c0dcae197..364792d24d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2038,6 +2038,8 @@ mymain(void) DO_TEST("pseries-many-buses-2", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_VIRTIO_SCSI); +# if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) + /* XXX Dirty hack, but mocking stat on 32bits is above my skills */ DO_TEST("pseries-hostdevs-1", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_VIRTIO_SCSI, @@ -2050,6 +2052,7 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); +# endif =20 DO_TEST("pseries-features", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, @@ -3157,10 +3160,13 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-graphics", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-graphics", "x86_64"); =20 +# if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) + /* XXX Dirty hack, but mocking stat on 32bits is above my skills */ DO_TEST_CAPS_LATEST("os-firmware-bios"); DO_TEST_CAPS_LATEST("os-firmware-efi"); DO_TEST_CAPS_LATEST("os-firmware-efi-secboot"); DO_TEST_CAPS_ARCH_LATEST("aarch64-os-firmware-efi", "aarch64"); +# endif =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list