From nobody Tue Feb 10 15:45:26 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=1576752822; cv=none; d=zohomail.com; s=zohoarc; b=k64VQMO9bfCt0Ydejg1uCIMt6PyfA8i+/rgkTmGL77RlJgXatBHTUlLXW8EEu8Rphft0kBpQGlHZBwGEeS28riQWrTrdffANhp/Z7XCXVVUVPSz4X7gEcON6hbxMWkM4Ttn4+PHIj5NPZ2668hl8LNGG7KTmJx8EXpaCYy0WY2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576752822; 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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=h77OIz9wVzWGttlUDMlZ2Ew8is/WWda5RWMXkgAhzQtgY1IA/4LiUQzLZko9My+DUeiD0aPqYYRc7b0P3lYU47eSa/fAScbaDUM7mL9o4BywN0vjbel2g2nyRlxTzgflacUKXo8f6FEKnq4Vt2/g6dgsnuze2kcvp05xWrewfqs= 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 1576752822270202.89055887127586; Thu, 19 Dec 2019 02:53:42 -0800 (PST) Received: from localhost ([::1]:38772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtR6-0003x3-9w for importer@patchew.org; Thu, 19 Dec 2019 05:53:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38584) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNI-0006Z0-3b for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNG-0008I2-NY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNG-0008Bu-DL for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:42 -0500 Received: by mail-wr1-x432.google.com with SMTP id q6so5457391wro.9 for ; Thu, 19 Dec 2019 02:49:42 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c195sm6275377wmd.45.2019.12.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CF9CD1FF91; Thu, 19 Dec 2019 10:49:34 +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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=Na0l5nj4hsrrKx0LC54oQSHzoqJeVqjZ9Zcw1rqB0PImGZkYVpu+lQ6X26MPPqI7B4 ZyMJFZKIRmcWCylm2x4ifIZMpqzkyD+WXYgJHECowd5fEaAHwbcbyusHPnrZU99dWWy7 oSTkQeKeSrV+k23+0+mlhO1neGnEkair68rl+0GaSN/vJqA5WUkr5eA/pCx6Eln9g/k2 /8iJS5mMLA8DGi79vjGLeHnQQFHdbMOI1N4pCdMYoQ5XhnIoF6nHXZHqvPv7yeWTctd9 1gG4aWZ8q6ua6L8nPD862NrFs9thsnmJLscspyRCCXQoGNts3/uaQK8LMje87cLuYsDm 2f3g== 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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=g+gCpogFeIVgtOMAvvoXIKe3S/nDLA8D7rGmtqJYNHwnMKf7hrgB6YVxhsKsLMJWk+ aDcCCwv8SBuDkWJKvksVkJopHGfuT/KTX8F4yn/M76rCY49+LyiO7SCF4SZdjhC4B1J7 bGpqidPuA1JC+oDu9arZJavgvamsCU+zBVurr6wL2SyOcJqYbT0rZmMXjw+pxkpw1a58 oenTRnMPlMwhSb5EcYsl+DM2bm44O7886MADidKp+7PNS0MXiigzDLRf6VCIUN7/RsSy SVfQdigNkhWHPH2v3c2kxPX/dsmx3ueKsQe1MdOsCpoZAXsluk4wdjJTN82o/ewdiHU1 NvNA== X-Gm-Message-State: APjAAAWxTf0pCsDNzzVA9GPR74Rjm3vkDGLiiZFJurUgpmeVDSUrjZ13 CUZIvGASTV+hIfA+oa7yXBiRrQ== X-Google-Smtp-Source: APXvYqzZjg2+JW4KO66zB/EINWeWe8D1sIQqZ5/mu3IWhx6pNHu7xEfQFRfyJQHLv3fdEhjzPk55EQ== X-Received: by 2002:adf:ef8b:: with SMTP id d11mr8330316wro.45.1576752581233; Thu, 19 Dec 2019 02:49:41 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/25] iotests: Provide a function for checking the creation of huge files Date: Thu, 19 Dec 2019 10:49:13 +0000 Message-Id: <20191219104934.866-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-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::432 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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 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