From nobody Mon Feb 9 06:34:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575474643; cv=none; d=zohomail.com; s=zohoarc; b=b5JGQc9I1K95EpHoNAfGSwZkbGrmj4JEct87j2eCbDZT/u3e4JwU8QgCxeI5vhpT5r23N0c3HUWe0LhlCYzvTO3Sfx7kyLGhLyjqx2aktV8hWXnl6EfwcP9NTRRoXLgUdVcsLt/TZpnKcSOqa3BnZYFoIP+EIBCHek/J0j93l3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575474643; h=Content-Type:Content-Transfer-Encoding:Cc: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=oB+EOiiCttCcGlWig7+GhXmtpFmyqeMozADnXcGVpu4=; b=PAYHZ/nd86KECQl/yrEt3lRRyS5j3gp3eu3HG3so3nX/On2a8m7y+oeWJo18drSxX3jwzto8yZ2aFBTCbA7vjh14kaODF06E0QSuEX9eFa0szBZ1QdCexz90l74YlaqFu8lxRAU/IZlTeUr0fn2ITkzpZgxWcMkJVLEEkJPh//E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1575474643643269.5935303025266; Wed, 4 Dec 2019 07:50:43 -0800 (PST) Received: from localhost ([::1]:40616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icWvH-0000gD-Pt for importer@patchew.org; Wed, 04 Dec 2019 10:50:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icWrn-0007Pv-U0 for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:47:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icWrd-0000Dq-Kr for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:46:58 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25389 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1icWrY-00005w-Vi for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:46:52 -0500 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-299-ja4qg2khPZyU-Tt1v8avcQ-1; Wed, 04 Dec 2019 10:46:41 -0500 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 07DA9107ACC4; Wed, 4 Dec 2019 15:46:40 +0000 (UTC) Received: from thuth.com (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25925600C8; Wed, 4 Dec 2019 15:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575474402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oB+EOiiCttCcGlWig7+GhXmtpFmyqeMozADnXcGVpu4=; b=GYtdIGwsy9iaTikeSjgk+DWbq9rnX7ZSho/7K159bwC7W/bbsXunQODqy+ZfBv4lIxuCgg /G/XxKOQO7iARe9NRnNwgRhfmwW9JkGuH676e4MhxBiVmutbdwQdFQY3HvACpqn6x9aN4f QfceHoWU2oRVg8uhzXD8ll3HRMJaxRQ= From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Subject: [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created Date: Wed, 4 Dec 2019 16:46:15 +0100 Message-Id: <20191204154618.23560-5-thuth@redhat.com> In-Reply-To: <20191204154618.23560-1-thuth@redhat.com> References: <20191204154618.23560-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: ja4qg2khPZyU-Tt1v8avcQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org, Christian Ehrhardt , Eric Auger , Wainer dos Santos Moschetta , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In certain environments like restricted containers, we can not create huge test images. To be able to use "make check" in such container environments, too, let's skip the hd-geo-test instead of failing when the test images could not be created. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Thomas Huth Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- tests/hd-geo-test.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c index 7e86c5416c..a249800544 100644 --- a/tests/hd-geo-test.c +++ b/tests/hd-geo-test.c @@ -34,8 +34,13 @@ static char *create_test_img(int secs) fd =3D mkstemp(template); g_assert(fd >=3D 0); ret =3D ftruncate(fd, (off_t)secs * 512); - g_assert(ret =3D=3D 0); close(fd); + + if (ret) { + free(template); + template =3D NULL; + } + return template; } =20 @@ -934,6 +939,10 @@ int main(int argc, char **argv) for (i =3D 0; i < backend_last; i++) { if (img_secs[i] >=3D 0) { img_file_name[i] =3D create_test_img(img_secs[i]); + if (!img_file_name[i]) { + g_test_message("Could not create test images."); + goto test_add_done; + } } else { img_file_name[i] =3D NULL; } @@ -965,6 +974,7 @@ int main(int argc, char **argv) "skipping hd-geo/override/* tests"); } =20 +test_add_done: ret =3D g_test_run(); =20 for (i =3D 0; i < backend_last; i++) { --=20 2.18.1