4 # Test xfs_quota when project names beginning with digits.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2015 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"
31 status=1 # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
40 # get standard environment, filters and checks
45 # remove previous $seqres.full before test
48 # real QA test starts here
53 _require_xfs_quota_foreign
55 _scratch_mkfs >/dev/null 2>&1
56 _scratch_enable_pquota
60 local qa_project=123456-project
61 local dir=$SCRATCH_MNT/project
63 mkdir $dir 2>/dev/null
66 cat >$tmp.projects <<EOF
70 cat >$tmp.projid <<EOF
74 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
75 -c "project -s $qa_project" $SCRATCH_MNT > /dev/null
77 # We set & test inodes, because xfs vs ext4 consume differing
78 # amounts of space for an empty dir, but an inode is an inode...
79 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
80 -c "limit -p isoft=100 ihard=200 $qa_project" $SCRATCH_MNT
82 echo "=== quota command output ==="
83 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid \
84 -c "quota -p -v -i $qa_project" $SCRATCH_MNT | _filter_quota
86 echo "=== report command output ==="
87 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
88 -c "report -p -N -i" $SCRATCH_MNT | _filter_project_quota
92 _qmount_option "usrquota,prjquota"
94 _require_prjquota $SCRATCH_DEV