#! /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
# 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"
_supported_fs xfs
_supported_os Linux
+_require_xfs_copy
_require_scratch
+_require_no_large_scratch_dev
_require_xfs_crc
_require_meta_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
}
_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
_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