From nobody Mon Feb 9 03:13:42 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=1575474668; cv=none; d=zohomail.com; s=zohoarc; b=hGsliY2KVUjLHsqtIVh+3kyvcpm/FC91WRD81e2ffcfNXSjiZY/upwVSVxi7apoOv/QCdPqlkIGBDcVDOO45oh8x4SILKoaTDazg1he2f5TyWaAgagMqLrQq2V0zyqvlckYGSf/Haklg04GdlwOZCa1Dtd5Pom9JH9m8S2djfFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575474668; 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=lTXssPse7UZyktj9whmk8xhBp0q1OIis1hguSo9ilPs=; b=OSOyHUspQwcAG5huWZ3/07zS/GwsnDJycle19Rbs3mZYHcZ+OmfWQXpXRFDXfr4ku4zwrkBYFhq8v+kNppu1mgmzK5vgYYV8JQurWIcRRFDlmmWT3FLU6zzrQflY3Askd6FtbiDJN12mMIQ+LMDyTebetFe1Xhf++eOLDxKpl5A= 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 1575474668217943.8710592328606; Wed, 4 Dec 2019 07:51:08 -0800 (PST) Received: from localhost ([::1]:40618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icWvj-0000uh-14 for importer@patchew.org; Wed, 04 Dec 2019 10:51:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55998) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icWrO-0007NX-OP for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:46:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icWrN-0008Ss-6J for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:46:38 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29741 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 1icWrM-0008Rp-QR for qemu-devel@nongnu.org; Wed, 04 Dec 2019 10:46:36 -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-336-OUeeyZm6O_yVg9RHYos1Dw-1; Wed, 04 Dec 2019 10:46:34 -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 76BF71005509; Wed, 4 Dec 2019 15:46:33 +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 3BA6A600C8; Wed, 4 Dec 2019 15:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575474395; 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=lTXssPse7UZyktj9whmk8xhBp0q1OIis1hguSo9ilPs=; b=doDqupInRrzyHr+FG8/NSPKAG+iltP9pst5qSVas3ntJGCN2yyvIToLDHA3se8Wdbj4xK+ 3kiirBen3SfRZ5OsA2xES3zh9nXij4owNOESnKXHLDJdy5tpyziZtOeqs5ncmiaWVWJ4EX KPf7a5S+wTFcooxTcOyIgjAcDyO/FpE= From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Subject: [PATCH v2 1/7] iotests: Provide a function for checking the creation of huge files Date: Wed, 4 Dec 2019 16:46:12 +0100 Message-Id: <20191204154618.23560-2-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: OUeeyZm6O_yVg9RHYos1Dw-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: 205.139.110.61 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" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Cleber Rosa --- 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 58442762fe..b6d03ac37d 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 2d62c5dcac..15159270d3 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 0cc8acc9ed..6f0582c79a 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.18.1