#! /bin/bash
-# FS QA Test No. 073
-#
-# Test xfs_copy
-#
-#-----------------------------------------------------------------------
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2000-2003,2008 Silicon Graphics, Inc. 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
+# FS QA Test No. 073
#
-#-----------------------------------------------------------------------
+# Test xfs_copy
#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
+. ./common/attr
# don't put fs images in /tmp
imgs=$TEST_DIR/$$
_cleanup()
{
cd /
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
umount $imgs.loop 2>/dev/null
[ -d $imgs.loop ] && rmdir $imgs.loop
umount $imgs.source_dir 2>/dev/null
diff -u $tmp.manifest1 $tmp.manifest2
echo comparing new image geometry to old
- xfs_info $source_dir \
+ $XFS_INFO_PROG $source_dir \
| _filter_copy $source $source_dir '/dev/loop.' '#' \
| tr -s ' ' \
> $tmp.geometry1
- xfs_info $target_dir \
+ $XFS_INFO_PROG $target_dir \
| _filter_copy $target $target_dir '/dev/loop.' '#' \
| tr -s ' ' \
> $tmp.geometry2
_supported_fs xfs
_supported_os Linux
_require_test
-
-[ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices"
-[ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed"
-
+_require_attrs
+_require_xfs_copy
_require_scratch
_require_loop
rm -f $seqres.full
-_scratch_mkfs_xfs -m crc=0 -dsize=41m,agcount=2 | _filter_mkfs 2>/dev/null
-_scratch_mount 2>/dev/null || _fail "initial scratch mount failed"
+_scratch_mkfs_xfs -dsize=41m,agcount=2 >>$seqres.full 2>&1
+_scratch_mount
echo
echo === populating scratch device
_populate_scratch
-umount $SCRATCH_MNT 2>/dev/null
+_scratch_unmount 2>/dev/null
echo
echo === copying scratch device to single target
echo
echo === copying scratch device to single target, large ro device
-${MKFS_XFS_PROG} -m crc=0 -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
+${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \
+ | _filter_mkfs 2>/dev/null
rmdir $imgs.source_dir 2>/dev/null
mkdir $imgs.source_dir