generic/611: Use _getfattr instead of GETFATTR_PROG
[xfstests-dev.git] / tests / generic / 381
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
4 #
5 # FS QA Test 381
6 #
7 # Test xfs_quota when user or names beginning with digits.
8 # For example, create a 'limit' for a user or group named
9 # '12345678-abcd', then query this user and group.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29 . ./common/quota
30
31 # remove previous $seqres.full before test
32 rm -f $seqres.full
33
34 # real QA test starts here
35 _supported_fs generic
36 _require_scratch
37 _require_quota
38 _require_xfs_quota_foreign
39
40 # need user and group named 123456-fsgqa
41 _require_user 123456-fsgqa
42 _require_group 123456-fsgqa
43
44 _scratch_mkfs >/dev/null 2>&1
45 _qmount_option "usrquota,grpquota"
46 _qmount
47
48 # user test
49 echo "== user test =="
50 $XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
51 echo "=== quota command output ==="
52 $XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
53 echo "=== report command output ==="
54 $XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
55
56 # group test
57 echo "== group test =="
58 $XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
59 echo "=== quota command output ==="
60 $XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
61 echo "=== report command output ==="
62 $XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
63
64 # success, all done
65 status=0
66 exit