From nobody Tue Feb 10 11:12:49 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576494565; cv=none; d=zohomail.com; s=zohoarc; b=R05c9VAR+iI3NSp+AXd28g41IDLdLR0LaUstJPTrZYTgG6iXtNlxuF1xfI+BqBxM0afHoQgN1N1kKI2ZJLYFs0CJ6av0dglOQPhNnPcIr7yVW4G820YPznsV0v5gdjDnO6vcy0VyGm4XCqRB9sKkAGSibPVW/tJyES0GMFgWjCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576494565; 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=sekHCSundFwN1XwOB6e9ZV5liIqc5bIq/ABEnUutdkA=; b=TifbEkrjzbrSvoBwDvOGVy6cKEmTQBzA24h0c/95S3spEswqZ3yyNoY1KF5rv2F3jQBxk7LeBstYMcItMngZF+NcSN/xs7eTyt5NdxMJcAFToy10dgzzyNb3WZbLyNSwzsTlmOoNBEHFSec5+JzGYY6GOJHCFW54tMLJOajhCxU= 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 1576494565051899.7302840734267; Mon, 16 Dec 2019 03:09:25 -0800 (PST) Received: from localhost ([::1]:51052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igoFf-0006xv-6l for importer@patchew.org; Mon, 16 Dec 2019 06:09:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igoE3-0005EY-6h for qemu-devel@nongnu.org; Mon, 16 Dec 2019 06:07:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igoE1-0003b7-RU for qemu-devel@nongnu.org; Mon, 16 Dec 2019 06:07:43 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:33129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igoE1-0003aH-K7 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 06:07:41 -0500 Received: by mail-wr1-x42b.google.com with SMTP id b6so6749433wrq.0 for ; Mon, 16 Dec 2019 03:07:41 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s16sm21253491wrn.78.2019.12.16.03.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 03:07:37 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8148E1FF91; Mon, 16 Dec 2019 11:07:32 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sekHCSundFwN1XwOB6e9ZV5liIqc5bIq/ABEnUutdkA=; b=GjSAJ76J/nGCIVqYmfN3poFlcLv/lQxivXLSlIAxgEA+gVJDcKRZcvCSG8P+pviVCG LfplcImINo9lInuv7MAlD1ZdJvDQZNpme/nrDOPXCHGLtVe3etZ9Nb40FaYY4tmuGlKd z7xgPq++vlvaEtq7+omXOT/AkI29hil+qnCtvyEcfJDhNuGWKCdsBs9S0ZlC4/IaKysx ll0c+fFe6YLGSPEq/qoU7wTSP3Dwlcz1LhJVZe+Jl+HERx6xi4vYf8dcfIPOYCnfp627 UPCmE9ITthDTdqxdI9X6q5cxlXBhckd/iQId4o7ngd16XU4f7dT7FGkgw03Rc88w/CgB D4CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sekHCSundFwN1XwOB6e9ZV5liIqc5bIq/ABEnUutdkA=; b=l8e/D4SjF9WmaN1Bi8HVcgrYXeNVHk4laMGUIfD744xPlal94qzOtbKi/0X3wB72nD +Zm8Qw7h76rtS+wVjlf3a1uUkdPe5wFJk44T7m5LSMjmOL2Kx1ugc67Rk2C17d/rjNfN Z93O66m4E6wwXAc/zx1fCzj9K+xewUiqeT/xDV9Q517uKZh5SyzAl3gO0ekMt7P9ysKr U0ckWQe2PuVku+uDEVZCUcc/gpyUEXlLMXHgiFsHRvCSo0XTAKZqUMwweI6q/JqFwWbB AQCHTtSX5eWkTcgdr/HQXUNMf7v3DTG4ZC3xoaS+WJsE2I6LV4Mx0g8jCBdNYNLybWix Wnfw== X-Gm-Message-State: APjAAAWZ8PbRHlgiSkWsuYF8mPuXSmLp0Fh+4KhM/8/Y4+7PLHn75TUl e1R8/WFUGVqI5jfhdMpOMl7C8Q== X-Google-Smtp-Source: APXvYqwIhOP0LrG9RLVNzwFEK7N3jMyhF1qRMy2FG9FI4d6i1KgL03lEuRbkCT2xtn6X1+23Kuj5+A== X-Received: by 2002:adf:e78b:: with SMTP id n11mr29657532wrm.10.1576494460522; Mon, 16 Dec 2019 03:07:40 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/16] iotests: Provide a function for checking the creation of huge files Date: Mon, 16 Dec 2019 11:07:20 +0000 Message-Id: <20191216110732.24027-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191216110732.24027-1-alex.bennee@linaro.org> References: <20191216110732.24027-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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: fam@euphon.net, Kevin Wolf , Thomas Huth , berrange@redhat.com, "open list:Block layer core" , stefanb@linux.vnet.ibm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Cleber Rosa , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, stefanha@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, Max Reitz , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Thomas Huth Some tests create huge (but sparse) files, and to be able to run those tests in certain limited environments (like CI containers), we have to check for the possibility to create such files first. Thus let's introduce a common function to check for large files, and replace the already existing checks in the iotests 005 and 220 with this function. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Thomas Huth Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191204154618.23560-2-thuth@redhat.com> Signed-off-by: Alex Benn=C3=A9e --- tests/qemu-iotests/005 | 5 +---- tests/qemu-iotests/220 | 6 ++---- tests/qemu-iotests/common.rc | 10 ++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005 index 58442762fe3..b6d03ac37de 100755 --- a/tests/qemu-iotests/005 +++ b/tests/qemu-iotests/005 @@ -59,10 +59,7 @@ fi # Sanity check: For raw, we require a file system that permits the creation # of a HUGE (but very sparse) file. Check we can create it before continui= ng. if [ "$IMGFMT" =3D "raw" ]; then - if ! truncate --size=3D5T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough fi= les" - fi - rm "$TEST_IMG" + _require_large_file 5T fi =20 echo diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220 index 2d62c5dcac2..15159270d33 100755 --- a/tests/qemu-iotests/220 +++ b/tests/qemu-iotests/220 @@ -42,10 +42,8 @@ echo "=3D=3D Creating huge file =3D=3D" =20 # Sanity check: We require a file system that permits the creation # of a HUGE (but very sparse) file. tmpfs works, ext4 does not. -if ! truncate --size=3D513T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" -fi -rm "$TEST_IMG" +_require_large_file 513T + IMGOPTS=3D'cluster_size=3D2M,refcount_bits=3D1' _make_test_img 513T =20 echo "=3D=3D Populating refcounts =3D=3D" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 0cc8acc9edd..6f0582c79af 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -643,5 +643,15 @@ _require_drivers() done } =20 +# Check that we have a file system that allows huge (but very sparse) files +# +_require_large_file() +{ + if ! truncate --size=3D"$1" "$TEST_IMG"; then + _notrun "file system on $TEST_DIR does not support large enough fi= les" + fi + rm "$TEST_IMG" +} + # make sure this script returns success true --=20 2.20.1