#! /bin/bash
-# FS QA Test No. 285
-#
-# Test to verify project quota xfs_admin, xfsdump/xfsrestore and
-# xfs_db functionality
-#
-#-----------------------------------------------------------------------
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2012 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.
+# FS QA Test No. 287
#
-# 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
-#
-#-----------------------------------------------------------------------
+# Test to verify project quota xfs_admin, xfsdump/xfsrestore and
+# xfs_db functionality
#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_cleanup()
{
+ _cleanup_dump
cd /
- umount $SCRATCH_MNT 2>/dev/null
rm -rf $tmp.*
}
_print_projid()
{
- $XFS_DB_PROG -r -c "inode $1" \
+ _scratch_xfs_db -r -c "inode $1" \
-c "print core.projid_lo" \
- -c "print core.projid_hi" \
- $SCRATCH_DEV
+ -c "print core.projid_hi"
}
# real QA test starts here
$XFS_IO_PROG -r -c "lsproj" $dir/16bit
$XFS_IO_PROG -r -c "lsproj" $dir/32bit
-umount $SCRATCH_MNT
+_scratch_unmount
# Now, enable projid32bit support by xfs_admin
-xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed"
+_scratch_xfs_admin -p >> $seqres.full 2>&1 || _fail "xfs_admin failed"
# Now mount the fs, 32bit project quotas shall be supported, now
_qmount_option "pquota"
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bit
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bitv2
-umount $SCRATCH_MNT
+_scratch_unmount
# Now, we can examine the file systems with xfs_db
echo "These two values of 16bit project quota ids shall be the same"