#! /bin/bash
-# FS QA Test No. 271
-#
-# Check that getfsmap reports the AG metadata we're expecting.
-#
-#-----------------------------------------------------------------------
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2016, Oracle and/or its affiliates. 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.
+# FS QA Test No. 271
#
-# 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.
+# Check that getfsmap reports the AG metadata we're expecting.
#
-# 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"
_scratch_mkfs > "$seqres.full" 2>&1
_scratch_mount
-agcount=$($XFS_INFO_PROG $SCRATCH_MNT | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')
+agcount=$(_xfs_mount_agcount $SCRATCH_MNT)
echo "Get fsmap" | tee -a $seqres.full
$XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT > $TEST_DIR/fsmap