4 # Test xfs_quota when user or names beginning with digits.
5 # For example, create a 'limit' for a user or group named
6 # '12345678-abcd', then query this user and group.
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
41 # get standard environment, filters and checks
46 # remove previous $seqres.full before test
49 # real QA test starts here
54 _require_xfs_quota_foreign
56 # need user and group named 123456-fsgqa
57 _require_user 123456-fsgqa
58 _require_group 123456-fsgqa
60 _scratch_mkfs >/dev/null 2>&1
61 _qmount_option "usrquota,grpquota"
65 echo "== user test =="
66 $XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
67 echo "=== quota command output ==="
68 $XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
69 echo "=== report command output ==="
70 $XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
73 echo "== group test =="
74 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
75 echo "=== quota command output ==="
76 $XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
77 echo "=== report command output ==="
78 $XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota