From nobody Fri Apr 26 02:26:21 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=1572009586; cv=none; d=zoho.com; s=zohoarc; b=h1aTIhOg0OdohB/f1Ny2cfItWvIbjOYmKBKVMzu0QSiHalBVHwuHM9FaYqrGeA1xG32DbbyB8z4yuknQeht056L54hKPNQpeoRFOUgxTDGpzMpRQvw9yABzoDGmuSVglla7Vk5ryWyatH2y60NJmJHhuuQHSI8GJkaEJx8BP/Io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572009586; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VghRIWnw2+Q7xuuqjrmzVqk0xoDxVbCTZRE9SlRBAJQ=; b=GgtMVSS/lk7nT4NU2Dm07iJyOFyPRmr4xmBk53hDkZkBIuijGPczRsNK+Qm3ALezaGtPwCjWYQuW8TaJP4f+wicRjJMJqw92Eh5CvUkNPYgGrgn1k92LqVV3b+7Ot8kqiLq2s8BWsNdaZJqqhd2L81Otgwvlw+DJ8I6qWmrJPTw= 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 1572009586588756.955410815748; Fri, 25 Oct 2019 06:19:46 -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-278-A1-R3-qDOMWsLQI5zn38xQ-1; Fri, 25 Oct 2019 09:19:39 -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 5D4661800DCA; Fri, 25 Oct 2019 13:19:32 +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 0415C60852; Fri, 25 Oct 2019 13:19:31 +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 453D61803B4B; Fri, 25 Oct 2019 13:19:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9PDJFoc000630 for ; Fri, 25 Oct 2019 09:19:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2ED34532; Fri, 25 Oct 2019 13:19:15 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BD3319C7F for ; Fri, 25 Oct 2019 13:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572009585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VghRIWnw2+Q7xuuqjrmzVqk0xoDxVbCTZRE9SlRBAJQ=; b=Aj4TWkD8IEVnNx7s3oqy4BkAAB7eRvKUz6Rk+4Fa+KtsC3UANJWAxbcB/Q3Rbk+ltrik5h JbO1U6iC7+AkI48S1tZpN2ETXTJXNey0lbObc0i6zemgLmBpFx4FKUyEJ2ANyD2Si/R8Fb N5IeM8SQ8ASQVpuqrFUgUnQRtPIhJy4= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 25 Oct 2019 15:19:12 +0200 Message-Id: <4ebfab0dd63c2abd2933d0a97b94bf40ada111f3.1572009552.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: make domaincapstest less anoying to debug 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: A1-R3-qDOMWsLQI5zn38xQ-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" Since 6a077cf2b3 domaincapstest does not run through all cases on failure but terminates right away. This makes it super annoying to debug or use in combination with VIR_TEST_REGNERATE_OUTPUT. Fix it by remembering failure and still running through all cases. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- tests/domaincapstest.c | 36 +++++++++++++++++++++--------------- tests/testutilsqemu.c | 8 ++++---- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index f77accdb76..e4e13c8bb3 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -313,6 +313,8 @@ doTestQemu(const char *inputDir G_GNUC_UNUSED, const char *suffix G_GNUC_UNUSED, void *opaque) { + int ret =3D 0; + if (STREQ(arch, "x86_64")) { /* For x86_64 we test three combinations: * @@ -321,13 +323,16 @@ doTestQemu(const char *inputDir G_GNUC_UNUSED, * - 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; - } + VIR_DOMAIN_VIRT_KVM, opaque) < 0) + ret =3D -1; + + if (doTestQemuInternal(version, "q35", arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0) + ret =3D -1; + + if (doTestQemuInternal(version, NULL, arch, + VIR_DOMAIN_VIRT_QEMU, opaque) < 0) + ret =3D -1; } else if (STREQ(arch, "aarch64")) { /* For aarch64 we test two combinations: * @@ -335,21 +340,22 @@ doTestQemu(const char *inputDir G_GNUC_UNUSED, * - 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; - } + VIR_DOMAIN_VIRT_KVM, opaque) < 0) + ret =3D -1; + + if (doTestQemuInternal(version, "virt", arch, + VIR_DOMAIN_VIRT_KVM, opaque) < 0) + ret =3D -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; + ret =3D -1; } - return 0; + return ret; } #endif @@ -431,7 +437,7 @@ mymain(void) abs_srcdir "/qemufirmwaredata/home/user/.confi= g/qemu/firmware"); if (testQemuCapsIterate(".xml", doTestQemu, cfg) < 0) - return EXIT_FAILURE; + ret =3D -1; /* * Run "tests/qemucapsprobe /path/to/qemu/binary >foo.replies" diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 54d6b1a0ac..34a6bd2653 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -902,6 +902,7 @@ testQemuCapsIterate(const char *suffix, DIR *dir =3D NULL; int rc; int ret =3D -1; + bool fail =3D false; if (!callback) return 0; @@ -949,12 +950,11 @@ testQemuCapsIterate(const char *suffix, * the callback. */ if (callback(TEST_QEMU_CAPS_PATH, "caps", version, - archName, suffix + 1, opaque) < 0) { - goto cleanup; - } + archName, suffix + 1, opaque) < 0) + fail =3D true; } - if (rc < 0) + if (rc < 0 || fail) goto cleanup; ret =3D 0; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list