From patchwork Fri Apr 3 07:01:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 6153891 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23026BF4A6 for ; Fri, 3 Apr 2015 07:03:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47C3E203AA for ; Fri, 3 Apr 2015 07:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35620203C3 for ; Fri, 3 Apr 2015 07:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbbDCHDf (ORCPT ); Fri, 3 Apr 2015 03:03:35 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:14978 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751327AbbDCHD1 (ORCPT ); Fri, 3 Apr 2015 03:03:27 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="90147287" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Apr 2015 14:59:39 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t3372J5h001976 for ; Fri, 3 Apr 2015 15:02:20 +0800 Received: from localhost.localdomain (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 3 Apr 2015 15:03:25 +0800 From: Qu Wenruo To: Subject: [PATCH 6/6] btrfs-progs: convert-tests: Add check for converted btrfs with regular file extent. Date: Fri, 3 Apr 2015 15:01:17 +0800 Message-ID: <1428044477-18485-7-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1428044477-18485-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1428044477-18485-1-git-send-email-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Regression test for previous patch "btrfs-progs: convert: Make ext*_image file obey datacsum setting." Signed-off-by: Qu Wenruo --- tests/convert-tests.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 7652a6c..42cbeb6 100644 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -9,7 +9,6 @@ unset LANG LANG=C SCRIPT_DIR=$(dirname $(realpath $0)) TOP=$(realpath $SCRIPT_DIR/../) -TEST_DEV=${TEST_DEV:-} TEST_MNT=${TEST_MNT:-$TOP/tests/mnt} RESULTS="$TOP/tests/convert-tests-results.txt" IMAGE="$TOP/tests/test.img" @@ -18,6 +17,8 @@ source $TOP/tests/common rm -f $RESULTS +setup_root_helper + convert_test() { echo " [TEST] $1" nodesize=$2 @@ -27,6 +28,13 @@ convert_test() { run_check rm -f $IMAGE run_check truncate -s 256M $IMAGE run_check $* -F $IMAGE + + # create a file to check btrfs-convert can convert regular file + # correct + run_check $SUDO_HELPER mount $IMAGE $TEST_MNT + run_check $SUDO_HELPER dd if=/dev/zero of=$TEST_MNT/test bs=$nodesize \ + count=1 1>/dev/null 2>&1 + run_check $SUDO_HELPER umount $TEST_MNT run_check $TOP/btrfs-convert -N "$nodesize" $IMAGE run_check $TOP/btrfs check $IMAGE }