From: Miao Xie <miaox@cn.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>, xfs@oss.sgi.com
Cc: anand.jain@oracle.com
Subject: [PATCH V2 3/3] xfstests: fix wrong number of the required devices and wrong deletable device check method for case 265
Date: Fri, 24 Aug 2012 16:08:08 +0800 [thread overview]
Message-ID: <50373668.3000804@cn.fujitsu.com> (raw)
In-Reply-To: <5036F1FB.80205@cn.fujitsu.com>
Case 265 need 4 devices to test RAID10, so we need 4 or more devices not 2.
And the deletable device check method is also wrong, the virtual devices in
the VMs which are drived by virtio are also not deletable(no delete entry
point), but it is not managed in the virtual directory in sysfs, so the current
method will make a mistake and thinks they are deletable. Fix it by check
the delete entry point. This fix method can also avoid the users use
partitions to run case 265.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
Changelog v1 -> v2:
- drop the independent device check
- modify the deletable device check
- do not modify README
---
265 | 2 +-
common.rc | 18 ++++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/265 b/265
index ec8410c..0687b62 100755
--- a/265
+++ b/265
@@ -50,7 +50,7 @@ _need_to_be_root
_supported_fs btrfs
_supported_os Linux
_require_scratch
-_require_scratch_dev_pool
+_require_scratch_dev_pool 4
_require_deletable_scratch_dev_pool
# Test cases related to raid in btrfs
diff --git a/common.rc b/common.rc
index 602513a..a254e0e 100644
--- a/common.rc
+++ b/common.rc
@@ -1695,16 +1695,20 @@ _test_inode_extsz()
_require_scratch_dev_pool()
{
local i
+ local ndevs=$1
if [ -z "$SCRATCH_DEV_POOL" ]; then
_notrun "this test requires a valid \$SCRATCH_DEV_POOL"
fi
- # btrfs test case needs 2 or more scratch_dev_pool; other FS not sure
+ # btrfs test case needs scratch_dev_pool; other FS not sure
# so fail it
case $FSTYP in
btrfs)
- if [ "`echo $SCRATCH_DEV_POOL|wc -w`" -lt 2 ]; then
- _notrun "btrfs and this test needs 2 or more disks in SCRATCH_DEV_POOL"
+ # We have moved a device from SCRATCH_DEV_POOL tp SCRATCH_DEV,
+ # so we must make it into account.
+ if [ $((`echo $SCRATCH_DEV_POOL | wc -w` + 1)) -lt $ndevs ]
+ then
+ _notrun "btrfs and this test needs $ndevs or more disks in SCRATCH_DEV_POOL"
fi
;;
*)
@@ -1731,17 +1735,15 @@ _require_scratch_dev_pool()
done
}
-# We will check if the device is virtual (eg: loop device) since it does not
-# have the delete entry-point. Otherwise SCSI and USB devices are fine.
+# We will check if the device is deletable.
_require_deletable_scratch_dev_pool()
{
local i
local x
for i in $SCRATCH_DEV_POOL; do
x=`echo $i | cut -d"/" -f 3`
- ls -l /sys/class/block/${x} | grep -q "virtual"
- if [ $? == "0" ]; then
- _notrun "$i is a virtual device which is not deletable"
+ if [ ! -f /sys/class/block/${x}/device/delete ]; then
+ _notrun "$i is a device which is not deletable"
fi
done
}
--
1.7.6.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2012-08-24 8:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 3:16 [PATCH 3/3] xfstests: fix wrong number of the required devices and add independent device check for case 265 Miao Xie
2012-08-24 4:18 ` Dave Chinner
2012-08-24 5:50 ` Miao Xie
2012-08-24 6:55 ` Miao Xie
2012-08-24 8:08 ` Miao Xie [this message]
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=50373668.3000804@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=anand.jain@oracle.com \
--cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox