]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: use BTRFS_UTIL_PROG instead of btrfs
authorDavid Sterba <dsterba@suse.cz>
Thu, 28 Mar 2013 16:13:43 +0000 (16:13 +0000)
committerRich Johnston <rjohnston@sgi.com>
Thu, 28 Mar 2013 21:36:25 +0000 (16:36 -0500)
Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
tests/btrfs/254
tests/btrfs/264
tests/btrfs/265
tests/btrfs/284

index 4a3336c0c023c5dc5cce7ab6f76c67dae8b8f8d8..140e53586a3ee29f7848ea81bb478d4159ca3cf3 100755 (executable)
@@ -58,7 +58,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &> /dev/null
 echo "List root dir"
 ls $SCRATCH_MNT
 echo "Creating snapshot of root dir"
-btrfs subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch
+$BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch
 echo "List root dir after snapshot"
 ls $SCRATCH_MNT
 echo "List snapshot dir"
@@ -70,7 +70,7 @@ echo "List snapshot dir"
 ls $SCRATCH_MNT/snap
 
 # Test creating a normal subvolme
-btrfs subvolume create $SCRATCH_MNT/subvol | _filter_scratch
+$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol | _filter_scratch
 echo "Listing root dir"
 ls $SCRATCH_MNT
 echo "Listing subvol"
@@ -80,7 +80,7 @@ ls $SCRATCH_MNT/subvol
 echo "Creating file bar in subvol"
 dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null
 echo "Setting subvol to the default"
-btrfs subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch
+$BTRFS_UTIL_PROG subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch
 _scratch_remount
 echo "List root dir which is now subvol"
 ls $SCRATCH_MNT
@@ -90,17 +90,17 @@ _scratch_mount "-o subvolid=0"
 echo "List root dir"
 ls $SCRATCH_MNT
 echo "Setting the root dir as the default again"
-btrfs subvolume set-default 0 $SCRATCH_MNT | _filter_scratch
+$BTRFS_UTIL_PROG subvolume set-default 0 $SCRATCH_MNT | _filter_scratch
 _scratch_remount
 echo "List root dir"
 ls $SCRATCH_MNT
 
 # Test listing the subvolumes
 echo "Listing subvolumes"
-btrfs subvolume list $SCRATCH_MNT | awk '{ print $NF }'
+$BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | awk '{ print $NF }'
 
 # Delete the snapshot
-btrfs subvolume delete $SCRATCH_MNT/snap | _filter_scratch
+$BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/snap | _filter_scratch
 echo "List root dir"
 ls $SCRATCH_MNT
 _scratch_remount
index ed084035c787692c6ddfbebca122497c28cc891b..ab814c701db5ffa1acabdce302b639b27fab5cd1 100755 (executable)
@@ -83,7 +83,7 @@ _create_snap()
        local x
        [ -d $1 ] || _fail "Destination dir $1 not present"
        SNAPNAME=`mktemp -u $SCRATCH_MNT/snap.XXXXXX`
-       btrfs subvolume snapshot $1 $SNAPNAME > /dev/null || _fail "snapshot create failed"
+       $BTRFS_UTIL_PROG subvolume snapshot $1 $SNAPNAME > /dev/null || _fail "snapshot create failed"
 }
 
 # Reads and writes new data but does not allocate new blocks
@@ -152,7 +152,7 @@ _append_file()
 ##################### real QA test starts here###################################
 # sv1 - is just a name nothing spl
 firstvol="$SCRATCH_MNT/sv1"
-btrfs subvolume create $firstvol > /dev/null || _fail "btrfs subvolume create $firstvol failed"
+$BTRFS_UTIL_PROG subvolume create $firstvol > /dev/null || _fail "btrfs subvolume create $firstvol failed"
 dirp=`mktemp -duq $firstvol/dir.XXXXXX`
 _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10 -x
 SNAPNAME=0
index f78ed24477fe61104117d29f68521a8a6e78cb6b..7837cc373a8f18a4336d4d33b6c0ca2bb9539b18 100755 (executable)
@@ -110,9 +110,9 @@ _test_add()
        dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
        _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
        for i in `seq 1 $n`; do
-               btrfs device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail "device add failed"
+               $BTRFS_UTIL_PROG device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail "device add failed"
        done
-       btrfs filesystem balance $SCRATCH_MNT || _fail "balance failed"
+       $BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT || _fail "balance failed"
        umount $SCRATCH_MNT
 }
 
@@ -146,16 +146,16 @@ _test_replace()
        _devmgt_remove ${DEVHTL}
        dev_removed=1
 
-       btrfs fi show $SCRATCH_DEV | grep "Some devices missing" > /dev/null || _fail \
+       $BTRFS_UTIL_PROG 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"
+       $BTRFS_UTIL_PROG 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_UTIL_PROG filesystem balance $SCRATCH_MNT || _fail "dev balance failed"
 
        # cleaup. add the removed disk
        umount $SCRATCH_MNT
@@ -172,8 +172,8 @@ _test_remove()
 
        # 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"
+       $BTRFS_UTIL_PROG device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
+       $BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV 2>&1 | grep $dev_del > /dev/null && _fail "btrfs still shows the deleted dev"
        umount $SCRATCH_MNT
 }
 
index 9c260b215af8e47151c7a4527c89059750925b50..1f79acc3e42657f143e7890c07336b8571287eaa 100644 (file)
@@ -79,14 +79,14 @@ _btrfs_online_defrag()
        fi
 
        if [ "$str" != "" ]; then
-               btrfs filesystem defragment $str $SCRATCH_MNT/tmp_file
+               $BTRFS_UTIL_PROG filesystem defragment $str $SCRATCH_MNT/tmp_file
        else
                if [ "$1" = "1" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT/tmp_file
+                       $BTRFS_UTIL_PROG filesystem defragment $SCRATCH_MNT/tmp_file
                elif [ "$1" = "2" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT/tmp_dir
+                       $BTRFS_UTIL_PROG filesystem defragment $SCRATCH_MNT/tmp_dir
                elif [ "$1" = "3" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT
+                       $BTRFS_UTIL_PROG filesystem defragment $SCRATCH_MNT
                fi
        fi
        ret_val=$?