xfs: add a _require_xfs_copy helper
[xfstests-dev.git] / tests / xfs / 077
index 007d05de4579616091eaf314ae3c48a296cbc6b4..b11b2c07abff235a5995d80370711c8cd97250d4 100755 (executable)
@@ -1,4 +1,7 @@
 #! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2015 Red Hat, Inc.  All Rights Reserved.
+#
 # FS QA Test 077
 #
 # test UUID modification of CRC-enabled filesystems
@@ -9,24 +12,6 @@
 # matches all the existing metadata) to a new superblock location.
 # Exercise some of that behavior.
 #
-#-----------------------------------------------------------------------
-# Copyright (c) 2015 Red Hat, 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
-#-----------------------------------------------------------------------
-#
-
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
@@ -50,7 +35,9 @@ _cleanup()
 
 _supported_fs xfs
 _supported_os Linux
+_require_xfs_copy
 _require_scratch
+_require_no_large_scratch_dev
 _require_xfs_crc
 _require_meta_uuid
 
@@ -64,11 +51,11 @@ _test_uuid()
        ACTION=$1
        EXPECTED_UUID=$2
 
-       $XFS_DB_PROG -x -c "uuid $ACTION" $SCRATCH_DEV \
+       _scratch_xfs_db -x -c "uuid $ACTION" \
                                        | _filter_uuid $EXPECTED_UUID
-       NEW_UUID=`$XFS_DB_PROG -c "uuid"  $SCRATCH_DEV | awk '{print $NF}'`
+       NEW_UUID=`_scratch_xfs_db -c "uuid"  | awk '{print $NF}'`
        _check_scratch_fs
-       _scratch_mount || _fail "Mount failed after UUID $ACTION"
+       _try_scratch_mount || _fail "Mount failed after UUID $ACTION"
        _scratch_unmount
 
 }
@@ -83,7 +70,7 @@ rm -f $seqres.full
 
 _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
 
-ORIG_UUID=`$XFS_DB_PROG -c "uuid" $SCRATCH_DEV | awk '{print $NF}'`
+ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'`
 
 _scratch_mount
 # Put some stuff on the fs
@@ -125,7 +112,7 @@ $XFS_COPY_PROG $SCRATCH_DEV $IMGFILE 2>&1 >> $seqres.full || \
 _check_xfs_filesystem $IMGFILE none none || _fail "Copy looks corrupted"
 # The copy should have META_UUID feature set
 _fs_has_META_UUID $IMGFILE || _fail "META_UUID feature not set on copy"
-_scratch_mount || _fail "Mount failed after UUID rewrite"
+_try_scratch_mount || _fail "Mount failed after UUID rewrite"
 _scratch_unmount
 
 rm -f $IMGFILE