2 # FS QA Test No. xfs/007
4 # Test to verify Q_XQUOTARM functionality.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2014 Red Hat, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #-----------------------------------------------------------------------
25 seqres=$RESULT_DIR/$seq
26 echo "QA output created by $seq"
30 status=1 # failure is the default!
31 trap "_cleanup; exit \$status" 0 1 2 3 15
39 # get standard environment, filters and checks
44 # Modify as appropriate.
46 _supported_os Linux Irix
53 _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
65 QINO_1=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
66 grep $qino_1 | awk '{print $NF}'`
67 QINO_2=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
68 grep $qino_2 | awk '{print $NF}'`
70 echo "*** Usage before quotarm ***"
71 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
72 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
75 echo "*** turn off $off_opts quotas"
76 xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
77 xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
81 echo "*** Usage after quotarm ***"
82 _scratch_xfs_db -c "inode $QINO_1" -c "p core.nblocks"
83 _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks"
87 # Test user and group first
88 _qmount_option "uquota,gquota"
90 do_test uquotino gquotino ug
92 # Test user and project. Note that pquotino only exists on v5 (crc=1)
93 # superblocks. Older supers reuse gquotino.
95 if [ $_fs_has_crcs == 0 ]; then
98 _qmount_option "uquota,pquota"
100 _require_prjquota $SCRATCH_DEV
101 do_test uquotino $PQUOTINO up