From nobody Tue Nov 26 13:34:05 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=1574161746; cv=none; d=zoho.com; s=zohoarc; b=Ltdt+V6VOpP4on+a5R3SnJHO+gjUE9EABd/gpIhHGsZnh/tcqbqjb3imz1ceIwazYg24zgIFnFNWNnfduj3ifSBaAE4zd27MjxXn+t4h5ym4Qm1DJLhiKIu/5jPdKDx3kPzgv8qe6jYAZ4Ku2DzuMPYwNpvP9mH5G5yNabYPODU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574161746; 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=/C4uhNKVx6gf0LbsJHOsbJZeIfT06F6B36302xaStFk=; b=btkW2B0zn7x8tUfhwPzSdj36o2rwWuFzq3/v/sEZTF8DSalBcsnJ5GiV3vkyMNvsZxbBOzH9QVVT31M4qL1HkFZrGW2PLpFkxyOmRHRmCUufr42KJLxs87yUYAe6ceoB2pvsd4Bc5vWDfj1SIgqBBietMU06hEzbMO+XMAl2Vns= 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 1574161746330603.1749207924607; Tue, 19 Nov 2019 03:09:06 -0800 (PST) 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-155-Nz9swws8NhWmpMADWzDTjg-1; Tue, 19 Nov 2019 06:09:03 -0500 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 26439801FCB; Tue, 19 Nov 2019 11:08:57 +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 BB90810375D5; Tue, 19 Nov 2019 11:08:56 +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 D8BA94BB5B; Tue, 19 Nov 2019 11:08:54 +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 xAJB8qFU021166 for ; Tue, 19 Nov 2019 06:08:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA2332935C; Tue, 19 Nov 2019 11:08:52 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64E6A2935A for ; Tue, 19 Nov 2019 11:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574161745; 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=/C4uhNKVx6gf0LbsJHOsbJZeIfT06F6B36302xaStFk=; b=aKRU+g1cAanMA+4N65LSYDz/XZm5g52jfZ3UsJsg0w2skstBo25aHljYAt0TsqHlhmwUh9 5yxKSBaj4S/kHx4h2aFBx3G0LlVREhK64lCz8s9vAcX8xEOnoMNL9merE6VqWVR8aDznTn dKUaBfyQqFerk0XWEkHCE+FNluMzmo0= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 19 Nov 2019 12:08:46 +0100 Message-Id: <1112e844ae9231af01f3b4fd4f34cc980d4685ff.1574161682.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] tests: virschema: Propagate errors from directory traversal in testSchemaDir 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: Nz9swws8NhWmpMADWzDTjg-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" testSchemaDir is a helper which invokes the schema test using virTestRun on all schema files. Since the function itself is not called inside virTestRun any helper function call is not dispatched to the user and thus it's hard to debug the test. Propagate errors from the directory traversal. Signed-off-by: Peter Krempa --- tests/virschematest.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/virschematest.c b/tests/virschematest.c index 8a2322b3bd..df50ef1717 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -76,8 +76,10 @@ testSchemaDir(const char *schema, .validator =3D validator, }; - if (virDirOpen(&dir, dir_path) < 0) + if (virDirOpen(&dir, dir_path) < 0) { + virTestPropagateLibvirtError(); return -1; + } while ((rc =3D virDirRead(dir, &ent, dir_path)) > 0) { g_autofree char *test_name =3D NULL; @@ -97,8 +99,10 @@ testSchemaDir(const char *schema, ret =3D -1; } - if (rc < 0) + if (rc < 0) { + virTestPropagateLibvirtError(); ret =3D -1; + } VIR_DIR_CLOSE(dir); return ret; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list