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"
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"
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
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
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
##################### 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
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
}
_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
# 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
}
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=$?