2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
7 # Test xfs_quota when project names beginning with digits.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
30 # remove previous $seqres.full before test
33 # real QA test starts here
38 _require_xfs_quota_foreign
40 _scratch_mkfs >/dev/null 2>&1
41 _scratch_enable_pquota
45 local qa_project=123456-project
46 local dir=$SCRATCH_MNT/project
48 mkdir $dir 2>/dev/null
51 cat >$tmp.projects <<EOF
55 cat >$tmp.projid <<EOF
59 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
60 -c "project -s $qa_project" $SCRATCH_MNT > /dev/null
62 # We set & test inodes, because xfs vs ext4 consume differing
63 # amounts of space for an empty dir, but an inode is an inode...
64 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
65 -c "limit -p isoft=100 ihard=200 $qa_project" $SCRATCH_MNT
67 echo "=== quota command output ==="
68 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid \
69 -c "quota -p -v -i $qa_project" $SCRATCH_MNT | _filter_quota
71 echo "=== report command output ==="
72 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
73 -c "report -p -N -i" $SCRATCH_MNT | _filter_project_quota
77 _qmount_option "usrquota,prjquota"
79 _require_prjquota $SCRATCH_DEV