]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfstests: enable test 032 (mkfs overwrite) for btrfs
authorEric Sandeen <sandeen@redhat.com>
Wed, 13 Mar 2013 16:01:00 +0000 (16:01 +0000)
committerRich Johnston <rjohnston@sgi.com>
Fri, 15 Mar 2013 16:28:11 +0000 (11:28 -0500)
Now that btrfs has an "-f" arg, we can test that it doesn't
improperly overwrite other filesystems in 032 like we do
for xfs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
032

diff --git a/032 b/032
index bf884928cdca422f9ceae1eba6849a04014c96db..89fb22584913a4e46efc2d1c6f4a5af0ff164e3a 100755 (executable)
--- a/032
+++ b/032
@@ -38,12 +38,18 @@ rm -f $seq.full
 . ./common.filter
 
 # real QA test starts here
-_supported_fs xfs
+_supported_fs xfs btrfs
 _supported_os Linux
 
 _require_nobigloopfs
 _require_scratch
 
+# mkfs.btrfs did not have overwrite detection at first
+if [ "$FSTYP" == "btrfs" ]; then
+       grep -q 'force overwrite' `echo $MKFS_BTRFS_PROG | awk '{print $1}'` || \
+               _notrun "Installed mkfs.btrfs does not support -f option"
+fi
+
 echo "Silence is golden."
 for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
 do
@@ -61,7 +67,7 @@ do
        [ $fs = gfs2 ] && preop="echo y |" && preargs="-p lock_nolock -j 1"
        [ $fs = reiserfs ] && preop="echo y |" && preargs="-f"
        # cramfs mkfs requires a directory argument
-       [ $fs = cramfs ] && preargs=/proc/fs/xfs
+       [ $fs = cramfs ] && preargs=/proc/fs
        [ $fs = ext2 ] && preargs="-F"
        [ $fs = ext3 ] && preargs="-F"
        [ $fs = ext4 ] && preargs="-F"
@@ -77,8 +83,8 @@ do
 
        if [ $? -eq 0 ] ; then
                # next, ensure we don't overwrite it
-               echo "=== Attempting XFS overwrite of $fs..." >>$seq.full
-               ${MKFS_PROG}.xfs $SCRATCH_DEV >>$seq.full 2>&1
+               echo "=== Attempting $FSTYP overwrite of $fs..." >>$seq.full
+               ${MKFS_PROG}.$FSTYP $SCRATCH_DEV >>$seq.full 2>&1
 
                [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
        else