xfs: add a _require_xfs_copy helper
[xfstests-dev.git] / tests / xfs / 073
index 7228dd92d6ae67c6c707a23a2f31e6704e8873e2..dc0cde4f2f909d27b1b3654e7b0530261f7ba78d 100755 (executable)
@@ -1,27 +1,11 @@
 #! /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"
@@ -107,11 +91,11 @@ _verify_copy()
        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
@@ -129,17 +113,14 @@ _supported_fs xfs
 _supported_os Linux
 _require_test
 _require_attrs
-
-[ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices"
-[ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed"
-
+_require_xfs_copy
 _require_scratch
 _require_loop
 
 rm -f $seqres.full
 
 _scratch_mkfs_xfs -dsize=41m,agcount=2 >>$seqres.full 2>&1
-_scratch_mount 2>/dev/null || _fail "initial scratch mount failed"
+_scratch_mount
 
 echo
 echo === populating scratch device