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
37 _require_xfs_quota_foreign
39 _scratch_mkfs >/dev/null 2>&1
40 _scratch_enable_pquota
44 local qa_project=123456-project
45 local dir=$SCRATCH_MNT/project
47 mkdir $dir 2>/dev/null
50 cat >$tmp.projects <<EOF
54 cat >$tmp.projid <<EOF
58 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
59 -c "project -s $qa_project" $SCRATCH_MNT > /dev/null
61 # We set & test inodes, because xfs vs ext4 consume differing
62 # amounts of space for an empty dir, but an inode is an inode...
63 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
64 -c "limit -p isoft=100 ihard=200 $qa_project" $SCRATCH_MNT
66 echo "=== quota command output ==="
67 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid \
68 -c "quota -p -v -i $qa_project" $SCRATCH_MNT | _filter_quota
70 echo "=== report command output ==="
71 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
72 -c "report -p -N -i" $SCRATCH_MNT | _filter_project_quota
76 _qmount_option "usrquota,prjquota"
78 _require_prjquota $SCRATCH_DEV