From patchwork Tue Nov 19 17:08:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 1197557 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="UfmmXtXs"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47HXb32c3gz9sR8 for ; Wed, 20 Nov 2019 04:18:06 +1100 (AEDT) Received: from localhost ([::1]:48220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX78e-0000W8-KM for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 12:18:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47235) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6zZ-0005R9-F7 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 12:08:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX6zX-0004Iq-PC for qemu-devel@nongnu.org; Tue, 19 Nov 2019 12:08:40 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:56514 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 1iX6zV-0004Gb-Q6 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 12:08:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574183317; 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=g64psGGRmKBLb4/hri+5uIdTiIG+yWcY+l9qZO/+XtA=; b=UfmmXtXs8V15g/C0TuxuJOl/HkgjZuhp/4A9sSJZuU2QG5qbRGOuFsSaRik5X43S7Jj0Nu wN7kezJxMoihkJvAGyYuHIcs+WR5/MJJdts3np+JAW/nJj3wgaI1GHUQpuGK8AAJYSQohr uVBCK/gouqzmZtrhsxT8aE7wvf8ut7I= 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-313-yBfZCSMtNX2Un-jBBsVRmQ-1; Tue, 19 Nov 2019 12:08:35 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72DF18A2129; Tue, 19 Nov 2019 17:08:34 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-181.ams2.redhat.com [10.36.117.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A21C5ED2C; Tue, 19 Nov 2019 17:08:32 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Kevin Wolf , Max Reitz , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH 3/6] tests/hd-geo-test: Skip test when images can not be created Date: Tue, 19 Nov 2019 18:08:18 +0100 Message-Id: <20191119170822.45649-4-thuth@redhat.com> In-Reply-To: <20191119170822.45649-1-thuth@redhat.com> References: <20191119170822.45649-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: yBfZCSMtNX2Un-jBBsVRmQ-1 X-Mimecast-Spam-Score: 0 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: Laurent Vivier , Christian Borntraeger , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- 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 = mkstemp(template); g_assert(fd >= 0); ret = ftruncate(fd, (off_t)secs * 512); - g_assert(ret == 0); close(fd); + + if (ret) { + free(template); + template = NULL; + } + return template; } @@ -934,6 +939,10 @@ int main(int argc, char **argv) for (i = 0; i < backend_last; i++) { if (img_secs[i] >= 0) { img_file_name[i] = 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] = NULL; } @@ -965,6 +974,7 @@ int main(int argc, char **argv) "skipping hd-geo/override/* tests"); } +test_add_done: ret = g_test_run(); for (i = 0; i < backend_last; i++) {