From patchwork Thu Dec 19 10:49:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 182081 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp312997iln; Thu, 19 Dec 2019 02:54:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzrNAbnwfY173xCBacqRuQdKBlG9b/isIJ/JwnXRO4X0UgDm1HJzpIvpMt4KR7ai7s9Ywti X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr7648932otc.24.1576752861073; Thu, 19 Dec 2019 02:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752861; cv=none; d=google.com; s=arc-20160816; b=LeI2dhbxKZG1SUg1/9ZuJoOIrWOv4sFdycQhCoel0im1QP6bkspL2m5ogHhrmolwt7 6hefUeHHmE9ntAXGu8o92D/933w1jX9acRIPFW09Hprxs1HgMCKn9rbYMvcO+5SPFR+J ddPyE7Z2XO3dtk7ZVgTR1zAai2IjAYzsPBZxC25Tcmu00ZG0kznXkiH2DK3frsnSPuYV aoHlv9g2JRVjCnlhM19h8SjmTd+8g1yBkxNU8smY1ixpI1rfsPkeyxUQTJZBIFKYyvFu KsIKO44nIOlKIo53gw5yDmP9dnaqFR5k4dgcPX33pP/FVuFo1xZH7GHFLZElVccIn0UT iQ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=j78VBSWZWqx0l2KyIwBoPd/xnZTOHL8E2GP1Lc2+0+kZAm1aYbG27LvsImmSA4/anA PBWjdy3eKmVZ3G6MnqKDm89B9RdduTRFpdelxOt8qsY0wfbmHPR5/chhV9Mj9KHR7h6T Qfe307LXTCP1FksZlPvOj9zuzAOm62Ts1SQn1hI2XBVQDv/wtruE66pZenGYCys+ivhY X4YAPlhQ6cvy5XXTQvJeEVO+R5o669VsZYPTGsiMXvRJ94vv4ZiD9vxXDhfCWzqwFrXm KBoBTBscM3TAw/q2XIedBBnr/Ch/xKWveC4k5u5GlTN66nalrWHzWzppFd3rMePKxZ9B njhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Na0l5nj4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p22si3174781ota.43.2019.12.19.02.54.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Na0l5nj4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtRj-0005ak-TQ for patch@linaro.org; Thu, 19 Dec 2019 05:54:19 -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) 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-Received: by 2002:adf:ef8b:: with SMTP id d11mr8330316wro.45.1576752581233; Thu, 19 Dec 2019 02:49:41 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Signed-off-by: Thomas Huth Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191204154618.23560-2-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 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 continuing. if [ "$IMGFMT" = "raw" ]; then - if ! truncate --size=5T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" - fi - rm "$TEST_IMG" + _require_large_file 5T fi 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 "== Creating huge file ==" # 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=513T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" -fi -rm "$TEST_IMG" +_require_large_file 513T + IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T echo "== Populating refcounts ==" 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 } +# Check that we have a file system that allows huge (but very sparse) files +# +_require_large_file() +{ + if ! truncate --size="$1" "$TEST_IMG"; then + _notrun "file system on $TEST_DIR does not support large enough files" + fi + rm "$TEST_IMG" +} + # make sure this script returns success true