From patchwork Sun Jan 29 14:44:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lakshmipathi.G" X-Patchwork-Id: 9544137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B588960415 for ; Sun, 29 Jan 2017 14:47:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A06427F07 for ; Sun, 29 Jan 2017 14:47:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BE2C28068; Sun, 29 Jan 2017 14:47:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5434D27F07 for ; Sun, 29 Jan 2017 14:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751115AbdA2Oqc (ORCPT ); Sun, 29 Jan 2017 09:46:32 -0500 Received: from p3nlsmtpcp01-03.prod.phx3.secureserver.net ([184.168.200.142]:44498 "EHLO p3nlsmtpcp01-03.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbdA2Oqb (ORCPT ); Sun, 29 Jan 2017 09:46:31 -0500 Received: from p3plcpnl0639.prod.phx3.secureserver.net ([50.62.176.166]) by : HOSTING RELAY : with SMTP id XqizcOJmeQTQJXqizcbt4N; Sun, 29 Jan 2017 07:45:01 -0700 Received: from [117.222.161.181] (port=49682 helo=giis.co.in) by p3plcpnl0639.prod.phx3.secureserver.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cXqiy-00006o-Gp for linux-btrfs@vger.kernel.org; Sun, 29 Jan 2017 07:45:01 -0700 Date: Sun, 29 Jan 2017 20:14:55 +0530 From: "Lakshmipathi.G" To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid Message-ID: <20170129144455.GA12174@giis.co.in> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - p3plcpnl0639.prod.phx3.secureserver.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - giis.co.in X-Get-Message-Sender-Via: p3plcpnl0639.prod.phx3.secureserver.net: authenticated_id: lakshmipathi.g@giis.co.in X-Authenticated-Sender: p3plcpnl0639.prod.phx3.secureserver.net: lakshmipathi.g@giis.co.in X-Source: X-Source-Args: X-Source-Dir: X-CMAE-Envelope: MS4wfAqpe4tvMtxqVxipQyWvx5kze24Y4n2s+oOwnvmaDqpVkLJYbMk8S/EXF3tbXjM3DaxMlBw4p1ap2AJfwhYNDe8h3iqcJSX5bUUF7fkTUzMKJPCn0k9U zcqu1+AOaMVSeIMYtafQjvumA9ZVjyOOCqoWtPxsMwVnexFfy400KVEd9uUgo+sdUhrHezwGxuBcLVzZwZ1Q8wtA1IVN7k+hi3l8AL54AMBcAK5kT7LagfcX Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simple script to verify non-raid filesystem conversion. Signed-off-by: Lakshmipathi.G --- tests/cli-tests/005-convert-btrfs-to-raid/test.sh | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 tests/cli-tests/005-convert-btrfs-to-raid/test.sh diff --git a/tests/cli-tests/005-convert-btrfs-to-raid/test.sh b/tests/cli-tests/005-convert-btrfs-to-raid/test.sh new file mode 100755 index 0000000..96772de --- /dev/null +++ b/tests/cli-tests/005-convert-btrfs-to-raid/test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# convert non-raid btrfs to raid + +source $TOP/tests/common + +check_prereq mkfs.btrfs +check_prereq btrfs + +setup_root_helper +prepare_test_dev 1g +run_check truncate -s1g img + +run_check $TOP/mkfs.btrfs -f $IMAGE +run_check_mount_test_dev + +loopdev=$(run_check_stdout $SUDO_HELPER losetup --partscan --find --show img) + +run_check $SUDO_HELPER $TOP/btrfs device add $loopdev $TEST_MNT +run_check $SUDO_HELPER $TOP/btrfs balance start -dconvert=raid1 -mconvert=raid1 $TEST_MNT + +run_check_stdout $SUDO_HELPER $TOP/btrfs filesystem show $loopdev | grep "Total devices 2" -q +if [ $? -ne 0 ]; then + run_check $SUDO_HELPER losetup -d $loopdev + rm -f img + _fail "Conversion from non-raid filesystem to raid failed." +fi +run_check_umount_test_dev + +# cleanup +run_check $SUDO_HELPER losetup -d $loopdev +rm -f img