From: Anand Jain <Anand.Jain@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
xfs@oss.sgi.com, Chris Mason <chris.mason@oracle.com>
Subject: [PATCH 3/3] 265: Functional test case for the btrfs raid operations
Date: Tue, 11 Oct 2011 19:28:11 +0800 [thread overview]
Message-ID: <4E94284B.1010909@oracle.com> (raw)
In-Reply-To: <20111010112151.GA28627@infradead.org>
This will verify the various raid features in btrfs and device
replacement functionality
Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
---
265 | 187
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
265.out | 2 +
group | 1 +
3 files changed, 190 insertions(+), 0 deletions(-)
create mode 100755 265
create mode 100644 265.out
diff --git a/265 b/265
new file mode 100755
index 0000000..4e35f6b
--- /dev/null
+++ b/265
@@ -0,0 +1,187 @@
+#! /bin/bash
+# FS QA Test No. 265
+#
+# btrfs vol tests
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2011 Oracle. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+# creator
+owner=anand.jain@oracle.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+dev_removed=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+ if [ $dev_removed == 1 ]; then
+ umount $SCRATCH_MNT
+ _devmgt_add "${DEVHTL}"
+ fi
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+_require_deletable_scratch_dev_pool
+
+# Test cases related to raid in btrfs
+_test_raid0()
+{
+ export MKFS_OPTIONS="-m raid0 -d raid0"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_raid1()
+{
+ export MKFS_OPTIONS="-m raid1 -d raid1"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_raid10()
+{
+ export MKFS_OPTIONS="-m raid10 -d raid10"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_single()
+{
+ export MKFS_OPTIONS="-m single -d single"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_add()
+{
+ local i
+ local devs[]="( $SCRATCH_DEV_POOL )"
+ local n=${#devs[@]}
+
+ n=$(($n-1))
+
+ export MKFS_OPTIONS=""
+ _scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ for i in `seq 1 $n`
+ do
+ btrfs device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail
"device add failed"
+ done
+ btrfs filesystem balance $SCRATCH_MNT || _fail "balance failed"
+ #btrfs filesystem show $SCRATCH_DEV 2>&1 | egrep devid |awk '{
+ # if ( $6 == "0.00" ) { exit 1 }
+ #}' || _fail "test6_add... failed"
+ umount $SCRATCH_MNT
+}
+
+_test_replace()
+{
+ local i
+ local devs=( $SCRATCH_DEV_POOL )
+ local n=${#devs[@]}
+ local ds
+ local d
+ local DEVHTL=""
+
+ # exclude the last disk in the disk pool
+ n=$(($n-1))
+ ds=${devs[@]:0:$n}
+
+ export MKFS_OPTIONS="-m raid1 -d raid1"
+ _scratch_mkfs "$ds" > /dev/null 2>&1 || _fail "tr: mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+
+ #pick the 2nd last disk
+ ds=${devs[@]:$(($n-1)):1}
+
+ # retrive the HTL for this scsi disk
+ d=`echo $ds|cut -d"/" -f3`
+ DEVHTL=`ls -l /sys/class/block/${d} | rev | cut -d "/" -f 3 | rev`
+
+ #fail disk
+ _devmgt_remove ${DEVHTL}
+ dev_removed=1
+
+ btrfs fi show $SCRATCH_DEV | grep "Some devices missing" > /dev/null
|| _fail \
+ "btrfs did not report device missing"
+
+ # add a new disk to btrfs
+ ds=${devs[@]:$(($n)):1}
+ btrfs device add ${ds} $SCRATCH_MNT > /dev/null 2>&1 || _fail "dev add
failed"
+ # in some system balance fails if there is no delay (a bug)
+ # putting sleep 10 to work around as of now
+ # sleep 10
+ btrfs fi balance $SCRATCH_MNT || _fail "dev balance failed"
+ #btrfs filesystem show | egrep devid |awk '{
+ # if ( $6 == "0.00" ) { exit 1 }
+ #}' || _fail "btrfs balance failed"
+
+ # cleaup. add the removed disk
+ umount $SCRATCH_MNT
+ _devmgt_add "${DEVHTL}"
+ dev_removed=0
+}
+
+_test_remove()
+{
+ _scratch_mkfs "$SCRATCH_DEV_POOL" > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+
+ # pick last dev in the list
+ dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
+ btrfs device delete $dev_del $SCRATCH_MNT || _fail "btrfs device
delete failed"
+ btrfs fi show $SCRATCH_DEV 2>&1 | grep $dev_del > /dev/null && _fail
"btrfs still shows the deleted dev"
+ umount $SCRATCH_MNT
+}
+
+_test_raid0
+_test_raid1
+_test_raid10
+_test_single
+_test_add
+_test_replace
+_test_remove
+
+echo "Silence is golden"
+status=0; exit
diff --git a/265.out b/265.out
new file mode 100644
index 0000000..9fa4eb0
--- /dev/null
+++ b/265.out
@@ -0,0 +1,2 @@
+QA output created by 265
+Silence is golden
diff --git a/group b/group
index b5863be..b991b24 100644
--- a/group
+++ b/group
@@ -378,3 +378,4 @@ deprecated
262 auto quick quota
263 auto quick
264 auto quick
+265 auto
--
1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: Anand Jain <Anand.Jain@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org,
Chris Mason <chris.mason@oracle.com>,
linux-btrfs@vger.kernel.org, xfs@oss.sgi.com
Subject: [PATCH 3/3] 265: Functional test case for the btrfs raid operations
Date: Tue, 11 Oct 2011 19:28:11 +0800 [thread overview]
Message-ID: <4E94284B.1010909@oracle.com> (raw)
In-Reply-To: <20111010112151.GA28627@infradead.org>
This will verify the various raid features in btrfs and device
replacement functionality
Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
---
265 | 187
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
265.out | 2 +
group | 1 +
3 files changed, 190 insertions(+), 0 deletions(-)
create mode 100755 265
create mode 100644 265.out
diff --git a/265 b/265
new file mode 100755
index 0000000..4e35f6b
--- /dev/null
+++ b/265
@@ -0,0 +1,187 @@
+#! /bin/bash
+# FS QA Test No. 265
+#
+# btrfs vol tests
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2011 Oracle. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+# creator
+owner=anand.jain@oracle.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+dev_removed=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+ if [ $dev_removed == 1 ]; then
+ umount $SCRATCH_MNT
+ _devmgt_add "${DEVHTL}"
+ fi
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+_require_deletable_scratch_dev_pool
+
+# Test cases related to raid in btrfs
+_test_raid0()
+{
+ export MKFS_OPTIONS="-m raid0 -d raid0"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_raid1()
+{
+ export MKFS_OPTIONS="-m raid1 -d raid1"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_raid10()
+{
+ export MKFS_OPTIONS="-m raid10 -d raid10"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_single()
+{
+ export MKFS_OPTIONS="-m single -d single"
+ _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ umount $SCRATCH_MNT
+}
+
+_test_add()
+{
+ local i
+ local devs[]="( $SCRATCH_DEV_POOL )"
+ local n=${#devs[@]}
+
+ n=$(($n-1))
+
+ export MKFS_OPTIONS=""
+ _scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+ for i in `seq 1 $n`
+ do
+ btrfs device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail
"device add failed"
+ done
+ btrfs filesystem balance $SCRATCH_MNT || _fail "balance failed"
+ #btrfs filesystem show $SCRATCH_DEV 2>&1 | egrep devid |awk '{
+ # if ( $6 == "0.00" ) { exit 1 }
+ #}' || _fail "test6_add... failed"
+ umount $SCRATCH_MNT
+}
+
+_test_replace()
+{
+ local i
+ local devs=( $SCRATCH_DEV_POOL )
+ local n=${#devs[@]}
+ local ds
+ local d
+ local DEVHTL=""
+
+ # exclude the last disk in the disk pool
+ n=$(($n-1))
+ ds=${devs[@]:0:$n}
+
+ export MKFS_OPTIONS="-m raid1 -d raid1"
+ _scratch_mkfs "$ds" > /dev/null 2>&1 || _fail "tr: mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+
+ #pick the 2nd last disk
+ ds=${devs[@]:$(($n-1)):1}
+
+ # retrive the HTL for this scsi disk
+ d=`echo $ds|cut -d"/" -f3`
+ DEVHTL=`ls -l /sys/class/block/${d} | rev | cut -d "/" -f 3 | rev`
+
+ #fail disk
+ _devmgt_remove ${DEVHTL}
+ dev_removed=1
+
+ btrfs fi show $SCRATCH_DEV | grep "Some devices missing" > /dev/null
|| _fail \
+ "btrfs did not report device missing"
+
+ # add a new disk to btrfs
+ ds=${devs[@]:$(($n)):1}
+ btrfs device add ${ds} $SCRATCH_MNT > /dev/null 2>&1 || _fail "dev add
failed"
+ # in some system balance fails if there is no delay (a bug)
+ # putting sleep 10 to work around as of now
+ # sleep 10
+ btrfs fi balance $SCRATCH_MNT || _fail "dev balance failed"
+ #btrfs filesystem show | egrep devid |awk '{
+ # if ( $6 == "0.00" ) { exit 1 }
+ #}' || _fail "btrfs balance failed"
+
+ # cleaup. add the removed disk
+ umount $SCRATCH_MNT
+ _devmgt_add "${DEVHTL}"
+ dev_removed=0
+}
+
+_test_remove()
+{
+ _scratch_mkfs "$SCRATCH_DEV_POOL" > /dev/null 2>&1 || _fail "mkfs failed"
+ _scratch_mount
+ _fillfs 1 10 100 4096 8192 $SCRATCH_MNT
+
+ # pick last dev in the list
+ dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
+ btrfs device delete $dev_del $SCRATCH_MNT || _fail "btrfs device
delete failed"
+ btrfs fi show $SCRATCH_DEV 2>&1 | grep $dev_del > /dev/null && _fail
"btrfs still shows the deleted dev"
+ umount $SCRATCH_MNT
+}
+
+_test_raid0
+_test_raid1
+_test_raid10
+_test_single
+_test_add
+_test_replace
+_test_remove
+
+echo "Silence is golden"
+status=0; exit
diff --git a/265.out b/265.out
new file mode 100644
index 0000000..9fa4eb0
--- /dev/null
+++ b/265.out
@@ -0,0 +1,2 @@
+QA output created by 265
+Silence is golden
diff --git a/group b/group
index b5863be..b991b24 100644
--- a/group
+++ b/group
@@ -378,3 +378,4 @@ deprecated
262 auto quick quota
263 auto quick
264 auto quick
+265 auto
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-10-11 11:28 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-05 7:59 [PATCH] snapshot, defragment and raid test cases for btrfs Anand Jain
2011-08-05 7:59 ` Anand Jain
2011-08-05 13:53 ` Amir Goldstein
2011-08-05 13:53 ` Amir Goldstein
2011-08-05 13:53 ` Amir Goldstein
2011-08-05 15:40 ` Greg Freemyer
2011-08-05 15:40 ` Greg Freemyer
2011-08-05 15:40 ` Greg Freemyer
2011-08-05 21:42 ` Greg Freemyer
2011-08-05 21:42 ` Greg Freemyer
2011-08-05 21:42 ` Greg Freemyer
2011-08-06 14:06 ` Dave Chinner
2011-08-06 14:06 ` Dave Chinner
2011-08-11 19:52 ` Anand Jain
2011-08-11 19:52 ` Anand Jain
2011-08-11 20:01 ` [PATCH 1/3] Added test case 257 for btrfs extended snapshot tests Anand Jain
2011-08-11 20:01 ` Anand Jain
2011-08-15 7:52 ` [PATCH v2 " Anand Jain
2011-08-15 7:52 ` Anand Jain
2011-09-02 8:45 ` [PATCH " Christoph Hellwig
2011-09-02 8:45 ` Christoph Hellwig
2011-08-11 20:01 ` [PATCH 2/3] Added test case 258 for btrfs defragmentation Anand Jain
2011-08-11 20:01 ` Anand Jain
2011-08-11 20:01 ` [PATCH 3/3] Added test case 259 for the btrfs raid features Anand Jain
2011-08-11 20:01 ` Anand Jain
2011-09-02 8:49 ` Christoph Hellwig
2011-09-02 8:49 ` Christoph Hellwig
2011-10-03 11:25 ` Anand Jain
2011-10-03 11:25 ` Anand Jain
2011-10-10 9:58 ` [PATCH] Changes to received review comments Anand Jain
2011-10-10 9:58 ` Anand Jain
2011-10-10 11:21 ` Christoph Hellwig
2011-10-10 11:21 ` Christoph Hellwig
2011-10-11 11:25 ` Anand Jain
2011-10-11 11:25 ` Anand Jain
2011-10-11 11:26 ` [PATCH 1/3] 263: Functional test case for the btrfs snapshot Anand Jain
2011-10-11 11:26 ` Anand Jain
2011-10-11 11:38 ` David Sterba
2011-10-11 11:38 ` David Sterba
2011-10-11 11:42 ` Christoph Hellwig
2011-10-11 11:42 ` Christoph Hellwig
2011-10-11 11:47 ` David Sterba
2011-10-11 11:47 ` David Sterba
2011-10-11 11:27 ` [PATCH 2/3] 264: Functional test case for the btrfs de-fragmentation Anand Jain
2011-10-11 11:27 ` Anand Jain
2011-10-11 11:28 ` Anand Jain [this message]
2011-10-11 11:28 ` [PATCH 3/3] 265: Functional test case for the btrfs raid operations Anand Jain
2011-10-12 4:52 ` [PATCH 0/3] xfstest patch Anand Jain
2011-10-12 4:52 ` Anand Jain
2011-10-12 4:52 ` [PATCH 1/3] 263: Functional test case for the btrfs snapshot Anand Jain
2011-10-12 4:52 ` Anand Jain
2011-10-13 0:56 ` Dave Chinner
2011-10-13 0:56 ` Dave Chinner
2011-10-18 6:28 ` [PATCH 0/3] xfstests patches Anand Jain
2011-10-18 6:28 ` Anand Jain
2011-10-18 6:28 ` [PATCH 1/3] 264: Functional test case for the btrfs snapshot Anand Jain
2011-10-18 6:28 ` Anand Jain
2011-10-19 9:42 ` Christoph Hellwig
2011-10-19 9:42 ` Christoph Hellwig
2011-10-20 15:31 ` Anand Jain
2011-10-20 15:31 ` Anand Jain
2011-10-18 6:28 ` [PATCH 2/3] 265: Functional test case for the btrfs de-fragmentation Anand Jain
2011-10-18 6:28 ` Anand Jain
2011-10-19 9:43 ` Christoph Hellwig
2011-10-19 9:43 ` Christoph Hellwig
2011-10-20 15:32 ` Anand Jain
2011-10-20 15:32 ` Anand Jain
2011-10-18 6:28 ` [PATCH 3/3] 266: Functional test case for the btrfs raid operations Anand Jain
2011-10-18 6:28 ` Anand Jain
2011-10-19 9:45 ` Christoph Hellwig
2011-10-19 9:45 ` Christoph Hellwig
2011-10-20 15:32 ` Anand Jain
2011-10-20 15:32 ` Anand Jain
2011-10-20 15:41 ` [PATCH 0/5] xfstests enhancement and bug fix Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-20 15:41 ` [PATCH 1/5] fill files with random data Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-25 11:35 ` Christoph Hellwig
2011-10-25 11:35 ` Christoph Hellwig
2011-10-20 15:41 ` [PATCH 2/5] Added SCRATCH_DEV_POOL to specify multiple disks for the btrfs RAID Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-25 11:36 ` Christoph Hellwig
2011-10-25 11:36 ` Christoph Hellwig
2011-10-20 15:41 ` [PATCH 3/5] 264: Functional test case for the btrfs snapshot Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-25 11:36 ` Christoph Hellwig
2011-10-25 11:36 ` Christoph Hellwig
2011-10-20 15:41 ` [PATCH 4/5] 265: Functional test case for the btrfs raid operations Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-25 11:37 ` Christoph Hellwig
2011-10-25 11:37 ` Christoph Hellwig
2011-10-20 15:41 ` [PATCH 5/5] _populate_fs should use OPTIND when getopts is used Anand Jain
2011-10-20 15:41 ` Anand Jain
2011-10-25 11:37 ` Christoph Hellwig
2011-10-25 11:37 ` Christoph Hellwig
2011-10-12 4:52 ` [PATCH 2/3] 264: Functional test case for the btrfs de-fragmentation Anand Jain
2011-10-12 4:52 ` Anand Jain
2011-10-12 4:52 ` [PATCH 3/3] 265: Functional test case for the btrfs raid operations Anand Jain
2011-10-12 4:52 ` Anand Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E94284B.1010909@oracle.com \
--to=anand.jain@oracle.com \
--cc=chris.mason@oracle.com \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.