From patchwork Thu Jun 12 16:08:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Buchbinder X-Patchwork-Id: 4343171 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26DD8BEEAA for ; Thu, 12 Jun 2014 16:08:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 516F2201F7 for ; Thu, 12 Jun 2014 16:08:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CF8E201C7 for ; Thu, 12 Jun 2014 16:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933650AbaFLQIl (ORCPT ); Thu, 12 Jun 2014 12:08:41 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:56688 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933295AbaFLQIk (ORCPT ); Thu, 12 Jun 2014 12:08:40 -0400 Received: by mail-pd0-f169.google.com with SMTP id w10so1123113pde.0 for ; Thu, 12 Jun 2014 09:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=6Fe+lJ9u5P/NXUqRSV9Z20m1VOpF0VnIoPHHVHqIHuk=; b=JqEQou6DtYz6dbqhAgHJ7sMBaXS502NV60UxZ4lIJ+5nIzZAnBGbvNGlTHXQInE3E2 TKDOcTuom6k1ozPEtFVGSjhoKZYAA1fppmDRdkrnSTV0e2binxomSchwAUuSfMA2PUM3 Xi5tq1vP4BsTgtHiTN2GOdGp/r5CxUiZ3hWCmB0jZGOy5y32jLw5w4y9AiKTGCBV0vkf /EFzy7oSrVXK4L44KKpYxZNBHJRl8fTSoJU6Z5rw76dU8tL76ulR9TTUyWfDqW+vRal6 ZLOVrWRs0plBsKDf9VMvIgrXCq5lvnXXsWlMtVAkxHcJeV7pnkAli6/9uX5+F0KJIlh3 IIKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6Fe+lJ9u5P/NXUqRSV9Z20m1VOpF0VnIoPHHVHqIHuk=; b=E0NAWSQGosdB3RbJpU5YBU9STmPhAcOReOkRpk/h8NxWUiHeQK4w4aMbGvIyDM4Nji zh/AiHo0CM6VgdgLGrWLb7AnMUXtIwaaXHd3itraOA2F1TAkVY9H42Cm2zAXik067nJR 8eHbid43iEboYBvHMK5/3rYfwcrgHiKHS+C3eUxVAcsLIWV914TLylDuBoaWc1Of9piC hTpEAD1KvAedwJxds24TQgNKwaGj+QX3BaycuYVaHDXd1I6wIAL0kPqwRw1v51awoG+4 0LvLqk3RrtWBuCpgtV/xd/+2UhQu6w3RD8grNUaPkfcEL4dIrIckADC3BS/BJqLTYBu8 jv3A== X-Gm-Message-State: ALoCoQlyCY9G2NakRg/9hwoe2CnA8a/GeuuQhV9NK1kSdaoSG1khaHHALDe+BQ1hhD3KBfCDKyuT/0viXcGIFt0yLEm2s3UBdOIDsvAeBRW9kjf1h0VCuX0tk/fNxjICqtUJzG09y6+viUPbQK208q9CEGFjX9tlmg== X-Received: by 10.68.136.99 with SMTP id pz3mr13841261pbb.150.1402589319970; Thu, 12 Jun 2014 09:08:39 -0700 (PDT) Received: from abuchbinder-glaptop.corp.google.com (dhcp-172-19-65-142.mtv.corp.google.com [172.19.65.142]) by mx.google.com with ESMTPSA id no9sm81118716pbc.83.2014.06.12.09.08.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 09:08:39 -0700 (PDT) From: Adam Buchbinder To: linux-btrfs@vger.kernel.org Cc: dave@jikos.cz, Adam Buchbinder Subject: [PATCH] Use sparse files for filesystem conversion tests. Date: Thu, 12 Jun 2014 09:08:33 -0700 Message-Id: <1402589313-15493-1-git-send-email-abuchbinder@google.com> X-Mailer: git-send-email 2.0.0.526.g5318336 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On my system, this brings the FS conversion test suite's runtime from over ten seconds down to under two. Thanks to Julien Muchembled for the suggestion. Signed-off-by: Adam Buchbinder --- tests/convert-tests.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 87369c5..9f7a5c8 100644 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -13,15 +13,16 @@ _fail() } rm -f convert-tests-results.txt -rm -f test.img test(){ echo " [TEST] $1" - shift - echo "creating ext image with: $*" >> convert-tests-results.txt + shift + echo "creating ext image with: $*" >> convert-tests-results.txt # 256MB is the smallest acceptable btrfs image. - dd if=/dev/zero of=$here/test.img bs=1024 count=$((256*1024)) \ - >> convert-tests-results.txt 2>&1 || _fail "dd failed" + rm -f $here/test.img >> convert-tests-results.txt 2>&1 \ + || _fail "could not remove test image file" + truncate -s 256M $here/test.img >> convert-tests-results.txt 2>&1 \ + || _fail "could not create test image file" $* -F $here/test.img >> convert-tests-results.txt 2>&1 \ || _fail "filesystem create failed" $here/btrfs-convert $here/test.img >> convert-tests-results.txt 2>&1 \ @@ -30,6 +31,7 @@ test(){ || _fail "btrfsck detected errors" } -test "ext2, 4k blocksize" mke2fs -b 4096 -test "ext3, 4k blocksize" mke2fs -j -b 4096 -test "ext4, 4k blocksize" mke2fs -t ext4 -b 4096 +# btrfs-convert requires 4k blocksize. +test "ext2" mke2fs -b 4096 +test "ext3" mke2fs -j -b 4096 +test "ext4" mke2fs -t ext4 -b 4096